CvDLLEntity.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. #ifndef CvDLLEntity_h
  3. #define CvDLLEntity_h
  4. //
  5. // Class which represents an entity object in the DLL.
  6. // Implements common entity functions by making calls to CvDLLEntityIFaceBase
  7. //
  8. // To expose new entity functions:
  9. // 1. Add the pure virtual function prototype to CvDLLEntityIFaceBase.h
  10. // 2. Add the function prototype and implementation to CvDLLEntityIFace.[cpp,h]
  11. // 3. Add a wrapper function (for convenience) to this file and implement it in the corresponding cpp
  12. //
  13. //#include "CvEnums.h"
  14. class CvCityEntity;
  15. class CvEntity;
  16. class CvUnitEntity;
  17. class CvCity;
  18. class CvUnit;
  19. class CvPlot;
  20. class DllExport CvDLLEntity
  21. {
  22. public:
  23. CvDLLEntity();
  24. virtual ~CvDLLEntity();
  25. CvEntity* getEntity() { return m_pEntity; }
  26. const CvEntity* getEntity() const { return m_pEntity; }
  27. CvUnitEntity* getUnitEntity() { return (CvUnitEntity*)m_pEntity; }
  28. CvCityEntity* getCityEntity() { return (CvCityEntity*)m_pEntity; }
  29. const CvUnitEntity* getUnitEntity() const { return (CvUnitEntity*)m_pEntity; }
  30. const CvCityEntity* getCityEntity() const { return (CvCityEntity*)m_pEntity; }
  31. void setEntity(CvEntity* pG) { m_pEntity = pG; }
  32. void removeEntity();
  33. virtual void setup();
  34. void setVisible(bool);
  35. void createCityEntity(CvCity*);
  36. void createUnitEntity(CvUnit*);
  37. void destroyEntity();
  38. bool IsSelected() const;
  39. void PlayAnimation(AnimationTypes eAnim, float fSpeed = 1.0f, bool bQueue = false, int iLayer = 0,
  40. float fStartPct = 0.0f, float fEndPct = 1.0f);
  41. void StopAnimation(AnimationTypes eAnim);
  42. void MoveTo( const CvPlot * pkPlot );
  43. void QueueMove( const CvPlot * pkPlot );
  44. void ExecuteMove( float fTimeToExecute, bool bCombat );
  45. void SetPosition( const CvPlot * pkPlot );
  46. void NotifyEntity( MissionTypes eMission );
  47. void SetSiegeTower(bool show);
  48. bool GetSiegeTower();
  49. protected:
  50. CvEntity* m_pEntity;
  51. };
  52. #endif // CvDLLEntity_h