I’ve a category Furnishings with a subclass of FurnitureState the place all of the “stay” knowledge can be saved. Throughout gameplay when the furnishings can be turned off or relocated (Participant motion) it’ll change the fields of this state class.
The concept is that i can simply serialize all of the states throughout the save operation by simply iterating over all furnitures, objects, enemies.
public class Furnishings
{
[System.Serializable]
public class FurnitureState
{
public string furnitureType;
public int x;
public int y;
public int enabled;
}
public FurnitureState state;
}
Is that this an excellent strategy or ought to i maintain the state lessons in separate information with all different states for participant, objects, enemies?
Is it good apply to have the state class to be serializable or ought to i exploit one other class which is able to extract the properties that sould be saved/loaded?