Introduced PersonaProfile

- PersonaProfile is for the exported JSON file
- Renamed a few classes
This commit is contained in:
Tony Bark 2025-04-28 09:00:12 -04:00
parent 63f4de6ffd
commit 1666dd55cd
6 changed files with 56 additions and 34 deletions

2
.gitignore vendored
View file

@ -544,3 +544,5 @@ FodyWeavers.xsd
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
.idea/**
profiles/**
export/**

15
PersonaProfile.cs Normal file
View file

@ -0,0 +1,15 @@
namespace PersonaForge;
public class PersonaProfile
{
public string Name { get; set; } = string.Empty;
// Fandom Wiki calls them "Qualities," but I use the term "Traits" internally
public PersonalityTraits Qualities { get; set; } = new();
public static string ToJson(PersonalityTraits qualities, string name) => JsonSerializer.Serialize(
new PersonaProfile { Name = name, Qualities = qualities },
new JsonSerializerOptions { WriteIndented = true }
);
}

View file

@ -6,9 +6,9 @@ public static class PersonalityGen
const int TotalBudget = 25;
static readonly Random rng = new();
public static PersonalityProfile GenerateRandom()
public static PersonalityTraits GenerateRandom()
{
var profile = PersonalityProfile.Create();
var profile = PersonalityTraits.Create();
var traits = new List<string> { "Outgoing", "Nice", "Playful", "Neat", "Active" };
var remaining = TotalBudget;
@ -28,7 +28,7 @@ public static class PersonalityGen
return profile;
}
static int GetCurrentTraitPoints(PersonalityProfile p, string trait) => trait switch
static int GetCurrentTraitPoints(PersonalityTraits p, string trait) => trait switch
{
"Outgoing" => p.Outgoing,
"Nice" => p.Nice,
@ -38,7 +38,7 @@ public static class PersonalityGen
_ => 0
};
static void SetTraitPoints(PersonalityProfile p, string trait, int points)
static void SetTraitPoints(PersonalityTraits p, string trait, int points)
{
switch (trait)
{

View file

@ -1,6 +1,6 @@
namespace PersonaForge;
public class PersonalityProfile
public class PersonalityTraits
{
public int Outgoing { get; set; }
public int Nice { get; set; }
@ -8,9 +8,7 @@ public class PersonalityProfile
public int Neat { get; set; }
public int Active { get; set; }
public static PersonalityProfile Create() => new();
public static PersonalityTraits Create() => new();
public int TotalPoints() => Outgoing + Nice + Playful + Neat + Active;
public string ToJson() => JsonSerializer.Serialize(this, new JsonSerializerOptions { WriteIndented = true });
}

View file

@ -3,5 +3,6 @@
using PersonaForge;
var profile = PersonalityGen.GenerateRandom();
Console.WriteLine(profile.ToJson());
var traits = PersonalityGen.GenerateRandom();
var profile = PersonaProfile.ToJson(traits, "John Doe");
Console.WriteLine(profile);

View file

@ -3,6 +3,7 @@
PersonaForge is a lightweight personality generator for The Sims 2. It balances randomness with user choice without complexity.
It helps if you want to:
- Have a specific Sim but arent sure how to fairly distribute leftover points.
- Need a fast and balanced Sims that still has a natural personality without min-maxing
- Are just tired of flying blind
@ -14,11 +15,12 @@ With Sims 3 and later, creating personalities is as simple as selecting a trait.
## 🛣️ Project Roadmap
| Phase | Goal | Status |
| --- | --- | --- |
| ----- | ------------------------------------------- | ------ |
| v0.1 | Core random point generator (working) | ✅ |
| v0.2 | PersonalityProfile class + JSON export | ✅ |
| v0.3 | Archetypes with weighted biases | 🔜 |
| v0.4 | Profile import/load from JSON | 🔜 |
| v0.2 | PersonalityProfile class | ✅ |
| v0.3 | JSON export | ✅ |
| v0.4 | Archetypes with weighted biases | 🔜 |
| v0.5 | Profile import/load from JSON | 🔜 |
| v1.0 | Stable "Release" version with documentation | 🔜 |
## 🧩 Tech Stack
@ -29,6 +31,7 @@ With Sims 3 and later, creating personalities is as simple as selecting a trait.
- Pure backend logic (no UI planned)
## 📐 Design Principles
- Simple with no bloat or feature creep
- Stay true to The Sims 2
- Respect randomness
@ -39,11 +42,14 @@ With Sims 3 and later, creating personalities is as simple as selecting a trait.
```json
{
"Outgoing": 7,
"Nice": 5,
"Name": "Max Casey",
"Qualities": {
"Outgoing": 6,
"Nice": 4,
"Playful": 6,
"Neat": 4,
"Active": 3
"Neat": 5,
"Active": 4
}
}
```
@ -55,7 +61,7 @@ With Sims 3 and later, creating personalities is as simple as selecting a trait.
## 📌 Stretch Goals
- Cross-platform dotnet tool. (e.g. ``dotnet tool install``)
- Cross-platform dotnet tool. (e.g. `dotnet tool install`)
## 🗓️ Update Cycle
@ -65,22 +71,22 @@ With Sims 3 and later, creating personalities is as simple as selecting a trait.
| Patch Update | As needed | Bug fixes, security updates |
| Major Update | As needed | Framework upgrades, major refactors |
* Reserve months: June (Mid-Year Chill) & December (End-Year Freeze)
- Reserve months: June (Mid-Year Chill) & December (End-Year Freeze)
## 🛡️ Status
* [x] Active Support
* [ ] Limited Support (Security patches only)
* [ ] Maintenance Mode (Dependency-only updates)
* [ ] Archived (No active work planned)
- [x] Active Support
- [ ] Limited Support (Security patches only)
- [ ] Maintenance Mode (Dependency-only updates)
- [ ] Archived (No active work planned)
## 🎮 Relaxation Practices
* 20% creative/recovery space built into development
* Mandatory cooldowns after major launches (minimum 1 week)
* Crisis Mode Activates if:
* Critical vulnerabilities
* Framework-breaking issues
- 20% creative/recovery space built into development
- Mandatory cooldowns after major launches (minimum 1 week)
- Crisis Mode Activates if:
- Critical vulnerabilities
- Framework-breaking issues
## License