Interactivity
This commit is contained in:
parent
1666dd55cd
commit
5e37b43fc9
3 changed files with 30 additions and 9 deletions
|
@ -3,13 +3,10 @@ namespace PersonaForge;
|
|||
public class PersonaProfile
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Archetype { 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 }
|
||||
);
|
||||
|
||||
public static string ToJson(PersonaProfile profile) => JsonSerializer.Serialize(profile, new JsonSerializerOptions { WriteIndented = true });
|
||||
}
|
||||
|
|
30
Program.cs
30
Program.cs
|
@ -3,6 +3,30 @@
|
|||
|
||||
using PersonaForge;
|
||||
|
||||
var traits = PersonalityGen.GenerateRandom();
|
||||
var profile = PersonaProfile.ToJson(traits, "John Doe");
|
||||
Console.WriteLine(profile);
|
||||
Console.WriteLine("=== Welcome to The Sims 2 Personality Generator ===");
|
||||
|
||||
Console.Write("Enter Sim's name: ");
|
||||
string name = Console.ReadLine() ?? "Unndanmed Sim";
|
||||
|
||||
var qualities = PersonalityGen.GenerateRandom();
|
||||
var profile = new PersonaProfile
|
||||
{
|
||||
Name = name,
|
||||
Qualities = qualities,
|
||||
Archetype = "Random"
|
||||
};
|
||||
|
||||
Console.WriteLine($"{name}'s Profile{Environment.NewLine}{PersonaProfile.ToJson(profile)}");
|
||||
|
||||
Console.Write("Save profile? (y/n): ");
|
||||
var saveInput = Console.ReadLine()?.Trim().ToLowerInvariant();
|
||||
|
||||
if (saveInput == "y")
|
||||
{
|
||||
var safeName = name.Replace(" ", "_").Replace("\"", "");
|
||||
File.WriteAllText($"{safeName}.json", PersonaProfile.ToJson(profile));
|
||||
Console.WriteLine($"Profile saved as {name}.json");
|
||||
}
|
||||
|
||||
Console.WriteLine($"Done. Forge on! 🔥{Environment.NewLine}Press any key to exit...");
|
||||
Console.ReadKey();
|
||||
|
|
|
@ -18,7 +18,7 @@ With Sims 3 and later, creating personalities is as simple as selecting a trait.
|
|||
| ----- | ------------------------------------------- | ------ |
|
||||
| v0.1 | Core random point generator (working) | ✅ |
|
||||
| v0.2 | PersonalityProfile class | ✅ |
|
||||
| v0.3 | JSON export | ✅ |
|
||||
| v0.3 | Interactive JSON export | ✅ |
|
||||
| v0.4 | Archetypes with weighted biases | 🔜 |
|
||||
| v0.5 | Profile import/load from JSON | 🔜 |
|
||||
| v1.0 | Stable "Release" version with documentation | 🔜 |
|
||||
|
|
Loading…
Add table
Reference in a new issue