Hi guys,
I'm designing the system of the engine, and I started to work with class Item (basically, you can equip the item, and it will replace the model, example if I equip some pants, I will get the model from the ItemID, hide current pants and show the equiped pants model).
My issue come's when I think how to do it. Because I have a little Entity like system, I have a base class (Entity) and a few that inherit from it (example Model which it's only purpose is to render the model), now with the Attach system, I could in theory attach 3 Models to any Entity, now if I have a Player, and I equip a new item, how should I handle it? Because, in theory, if I have 2 Models, which one will be replaced? Also, Item it's the child of Player, not child of Model, I need to retrieve data from it so I can make parts of the base model invisible, so the item should be attached to the Player or the Model? Also, Item should be a class of it's own, or just create “Model” for the Player to replace parts of the base model?
One idea that I came up with, is to create a new variable to the Entity base class, call m_baseModel, and I load directly from a new function, so even if new models are attached, only 1 will be the base, and I can hide from Item to the base.
Thanks!