From 1666dd55cd654f558f699798aee29017e7fbc5a5 Mon Sep 17 00:00:00 2001 From: Tony Bark Date: Mon, 28 Apr 2025 09:00:12 -0400 Subject: [PATCH] Introduced PersonaProfile - PersonaProfile is for the exported JSON file - Renamed a few classes --- .gitignore | 4 +- PersonaProfile.cs | 15 ++++++ PersonalityGen.cs | 8 +-- PersonalityProfile.cs => PersonalityTraits.cs | 6 +-- Program.cs | 5 +- README.md | 52 +++++++++++-------- 6 files changed, 56 insertions(+), 34 deletions(-) create mode 100644 PersonaProfile.cs rename PersonalityProfile.cs => PersonalityTraits.cs (58%) diff --git a/.gitignore b/.gitignore index d30a9c2..6351487 100644 --- a/.gitignore +++ b/.gitignore @@ -543,4 +543,6 @@ FodyWeavers.xsd # Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) -.idea/** \ No newline at end of file +.idea/** +profiles/** +export/** diff --git a/PersonaProfile.cs b/PersonaProfile.cs new file mode 100644 index 0000000..2a80a57 --- /dev/null +++ b/PersonaProfile.cs @@ -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 } + ); + +} diff --git a/PersonalityGen.cs b/PersonalityGen.cs index ef99b98..d43ad20 100644 --- a/PersonalityGen.cs +++ b/PersonalityGen.cs @@ -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 { "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) { diff --git a/PersonalityProfile.cs b/PersonalityTraits.cs similarity index 58% rename from PersonalityProfile.cs rename to PersonalityTraits.cs index 6c6feed..3498562 100644 --- a/PersonalityProfile.cs +++ b/PersonalityTraits.cs @@ -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 }); } diff --git a/Program.cs b/Program.cs index 01d9a12..6766ac9 100644 --- a/Program.cs +++ b/Program.cs @@ -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); diff --git a/README.md b/README.md index 9aa1a69..542c89b 100644 --- a/README.md +++ b/README.md @@ -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 arenโ€™t 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 @@ -13,13 +14,14 @@ 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 | ๐Ÿ”œ | -| v1.0 | Stable "Release" version with documentation | ๐Ÿ”œ | +| Phase | Goal | Status | +| ----- | ------------------------------------------- | ------ | +| v0.1 | Core random point generator (working) | โœ… | +| 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, - "Playful": 6, - "Neat": 4, - "Active": 3 + "Name": "Max Casey", + "Qualities": { + "Outgoing": 6, + "Nice": 4, + "Playful": 6, + "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