I am looking to create a scene graph for my F # somthing like project:
root
->player_bob
-->torch
->enemy_1
-->extravagant_hat
-->enemies_cat_jess
->loot
etc., etc.
Each element must contain a collection of game objects to represent its children.
For example, the list of enemies1 contains a cat and a hat, and the list of cats contains fleas and a fur ball
Therefore, I plan to make them all inheritable from the class containing the collection that describes these objects.
Now to my question:
Should I drop child objects in GameObject and store them in the list of the base class "GameObject" OR create a discriminatory union, for example
type SceneObject =
|Character of Character
|Item of Item
"SceneObjects", / .. , , / : , ..
+ - ; , FP, , , , .
,
JD