Here's what my objects look like:
Code: Select all
/// <summary>
/// Represents the state of the minigame.
/// </summary>
public class MinigameState
{
public bool complete { get; set; }
public PatientDifficulty currentDifficulty { get; set; }
public List<Patient> easy { get; set; }
public List<Patient> medium { get; set; }
public List<Patient> hard { get; set; }
}
/// <summary>
/// Represents a patient with an ailment.
/// </summary>
public class Patient
{
public PatientStatus status { get; set; }
public PatientWalkerAnimator walkerAnimator { get; set; }
public PatientPortraitAnimator portraitAnimator { get; set; }
public string ailmentTextId { get; set; } // unique id
public List<CureIngredientInformation> cureIngredientList { get; set; }
}
/// <summary>
/// CureIngredientInformation contains information about a cure's ingredient and it's value.
/// </summary>
public class CureIngredientInformation
{
public string name { get; set; }
public float value { get; set; }
public bool isBonus { get; set; }
}
/// <summary>
/// Various statuses a patient can have. If they are healed, the are removed from the list during the scoring phase.
/// </summary>
public enum PatientStatus
{
Sick,
Angry,
Healthy,
VeryHealthy,
}
/// <summary>
/// Enum representing difficulty of the patient.
/// </summary>
public enum PatientDifficulty
{
Easy,
Medium,
Hard,
}
My question is should I be side-stepping the save system and just serialize the data to a text file, or is there some way to write this object to a lua table or something.
ALSO if there is some way to do that, what's the best place to do it? Start of a newgame?