diff --git a/PersonalityArchetype.cs b/PersonalityArchetype.cs new file mode 100644 index 0000000..aecdfb7 --- /dev/null +++ b/PersonalityArchetype.cs @@ -0,0 +1,36 @@ +namespace PersonaForge; + +public class PersonalityArchetype +{ + public string Name { get; set; } + public Dictionary TraitBiases { get; set; } = new(); + + // TODO: Load default archetypes from a file or database + public static List DefaultArchetypes() => new() + { + new PersonalityArchetype + { + Name = "Grumpy", + TraitBiases = new Dictionary + { + { "Nice", 0.2 }, + { "Playful", 0.4 }, + { "Outgoing", 0.6 }, + { "Neat", 0.7 }, + { "Active", 0.5 } + } + }, + new PersonalityArchetype + { + Name = "Party Animal", + TraitBiases = new Dictionary + { + { "Outgoing", 0.9 }, + { "Playful", 0.8 }, + { "Active", 0.7 }, + { "Nice", 0.5 }, + { "Neat", 0.3 } + } + } + }; +} diff --git a/PersonalityGen.cs b/PersonalityGen.cs index 8a67c5b..ef99b98 100644 --- a/PersonalityGen.cs +++ b/PersonalityGen.cs @@ -6,7 +6,7 @@ public static class PersonalityGen const int TotalBudget = 25; static readonly Random rng = new(); - public static PersonalityProfile GeneratePersonalityProfile() + public static PersonalityProfile GenerateRandom() { var profile = PersonalityProfile.Create(); var traits = new List { "Outgoing", "Nice", "Playful", "Neat", "Active" }; diff --git a/Program.cs b/Program.cs index 3ec1ef6..01d9a12 100644 --- a/Program.cs +++ b/Program.cs @@ -1,59 +1,7 @@ // .NET 8 C# - Random Sims 2 Personality Allocator // Clear, minimal, portable, with basic validation. -var totalPoints = 25; -const int MaxPointsPerTrait = 10; -string[] traits = ["Outgoing", "Nice", "Playful", "Neat", "Active"]; -Dictionary personality = new(); -Random rng = new(); +using PersonaForge; -// Shuffle traits to prevent boring patterns -traits = traits.OrderBy(_ => rng.Next()).ToArray(); - -// Initialize -foreach (var trait in traits) -{ - personality[trait] = 0; -} - -// Assign points while respecting max constraints -while (totalPoints > 0) -{ - var availableTraits = new List(); - - foreach (var trait in traits) - { - if (personality[trait] < MaxPointsPerTrait) - availableTraits.Add(trait); - } - - if (availableTraits.Count == 0) - { - // No available traits left to increment - something's off - Console.WriteLine("Warning: No traits available to increment."); - break; - } - - var selectedTrait = availableTraits[rng.Next(availableTraits.Count)]; - - // "Extremes" are rare: only allow adding 1 point usually, maybe 2 points if random chance - var pointsToAdd = (rng.NextDouble() < 0.1) ? Math.Min(2, MaxPointsPerTrait - personality[selectedTrait]) : 1; - pointsToAdd = Math.Min(pointsToAdd, totalPoints); - - personality[selectedTrait] += pointsToAdd; - totalPoints -= pointsToAdd; -} - -// Display results -Console.WriteLine("=== Sims 2 Personality Points ==="); -foreach (var kvp in personality) -{ - Console.WriteLine($"{kvp.Key}: {kvp.Value}"); -} -Console.WriteLine($"Remaining Budget (should be 0): {totalPoints}"); - -// Safety check -if (totalPoints != 0) -{ - Console.WriteLine("⚠️ Budget mismatch detected! Something funky happened."); -} +var profile = PersonalityGen.GenerateRandom(); +Console.WriteLine(profile.ToJson());