Monday, October 3, 2022
HomeGame Developmentknowledge construction - Ought to the state object be outlined contained in...

knowledge construction – Ought to the state object be outlined contained in the precise object? For Save/Load function


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?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments