18 #include "precompiled.h"
30 const std::set<CStr>& actorSelections,
uint32_t seed)
31 : m_Object(object), m_Model(object->m_Model->Clone()),
33 m_ObjectManager(objectManager), m_Seed(seed)
56 std::vector<std::set<CStr> > selectionsVec;
57 selectionsVec.push_back(actorSelections);
64 return new CUnit(obj, objectManager, actorSelections, seed);
82 CStr selection_lc = selection.LowerCase();
103 std::vector<std::set<CStr> > selections;
115 if (!remainingSelections.empty())
116 selections.push_back(remainingSelections);
120 if (newObject && newObject !=
m_Object)
virtual void SetPlayerID(player_id_t id)
void SetEntitySelection(const CStr &selection)
std::set< CStr > m_ActorSelections
CObjectBase * FindObjectBase(const CStrW &objname)
virtual void SetTransform(const CMatrix3D &transform)
virtual CModelAbstract * Clone() const =0
#define MODELFLAG_IGNORE_LOS
void SetEntityID(entity_id_t ent)
Change the entity ID associated with this animation (currently used for playing locational sound effe...
CUnit(CObjectEntry *object, CObjectManager &objectManager, const std::set< CStr > &actorSelections, uint32_t seed)
CObjectEntry * FindObjectVariation(const CStrW &objname, const std::vector< std::set< CStr > > &selections)
void Update(float time)
Advance the animation state.
CObjectManager & m_ObjectManager
void SetActorSelections(const std::set< CStr > &selections)
void ReloadUnit(CModel *model, const CObjectEntry *object)
Regenerate internal animation state from the models in the current unit.
#define SAFE_DELETE(p)
delete memory ensuing from new and set the pointer to zero (thus making double-frees safe / a no-op) ...
std::set< CStr > m_EntitySelections
static CUnit * Create(const CStrW &actorName, uint32_t seed, const std::set< CStr > &selections, CObjectManager &objectManager)
virtual player_id_t GetPlayerID() const
#define MODELFLAG_SILHOUETTE_DISPLAY
Abstract base class for graphical objects that are used by units, or as props attached to other CMode...
std::set< CStr > CalculateRandomVariation(uint32_t seed, const std::set< CStr > &initialSelections)
virtual CModel * ToCModel()
Dynamic cast.
const CMatrix3D & GetTransform() const
void SetID(entity_id_t id)
#define MODELFLAG_SILHOUETTE_OCCLUDER
const entity_id_t INVALID_ENTITY
Invalid entity ID.
CUnitAnimation * m_Animation
u32 entity_id_t
Entity ID type.
void UpdateModel(float frameTime)
Update the model's animation.
std::set< CStr > CalculateRandomRemainingSelections(uint32_t seed, const std::vector< std::set< CStr > > &initialSelections)
void CopyAnimationFrom(CModel *source)
friend class CUnitAnimation
void AddFlagsRec(int flags)