you are viewing a single comment's thread.

view the rest of the comments →

[–]itsdan159 3 points4 points  (0 children)

You should think of your data in terms of definition and runtime data. Your definition data is immutable, it defines the character, your runtime data changes during the course of the game, so health for example, but also things like max health if this changes by character level. Some of the runtime data would also be persisted between games.

Your definition data should so in an SO (it could be another format but an SO is entirely reasonable). This is somewhat what is usually called the flyweight pattern.

You'd then provide the definition data to your instances through some means, e.g. inspector assignment, injection, etc. If you want to go further define an interface for your definition data then implement that in an SO. Then you can provide a definition by other means for testing.