mirror of
https://github.com/glest/glest-source.git
synced 2025-08-17 13:50:43 +02:00
- inlined a few more functions
This commit is contained in:
@@ -91,7 +91,7 @@ public:
|
|||||||
class VisibleQuadContainerCache {
|
class VisibleQuadContainerCache {
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void CopyAll(const VisibleQuadContainerCache &obj) {
|
inline void CopyAll(const VisibleQuadContainerCache &obj) {
|
||||||
cacheFrame = obj.cacheFrame;
|
cacheFrame = obj.cacheFrame;
|
||||||
visibleObjectList = obj.visibleObjectList;
|
visibleObjectList = obj.visibleObjectList;
|
||||||
visibleUnitList = obj.visibleUnitList;
|
visibleUnitList = obj.visibleUnitList;
|
||||||
@@ -106,24 +106,24 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
VisibleQuadContainerCache() {
|
inline VisibleQuadContainerCache() {
|
||||||
cacheFrame = 0;
|
cacheFrame = 0;
|
||||||
clearFrustrumData();
|
clearFrustrumData();
|
||||||
clearCacheData();
|
clearCacheData();
|
||||||
}
|
}
|
||||||
VisibleQuadContainerCache(const VisibleQuadContainerCache &obj) {
|
inline VisibleQuadContainerCache(const VisibleQuadContainerCache &obj) {
|
||||||
CopyAll(obj);
|
CopyAll(obj);
|
||||||
}
|
}
|
||||||
VisibleQuadContainerCache & operator=(const VisibleQuadContainerCache &obj) {
|
inline VisibleQuadContainerCache & operator=(const VisibleQuadContainerCache &obj) {
|
||||||
CopyAll(obj);
|
CopyAll(obj);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearCacheData() {
|
inline void clearCacheData() {
|
||||||
clearVolatileCacheData();
|
clearVolatileCacheData();
|
||||||
clearNonVolatileCacheData();
|
clearNonVolatileCacheData();
|
||||||
}
|
}
|
||||||
void clearVolatileCacheData() {
|
inline void clearVolatileCacheData() {
|
||||||
visibleUnitList.clear();
|
visibleUnitList.clear();
|
||||||
visibleQuadUnitList.clear();
|
visibleQuadUnitList.clear();
|
||||||
//inVisibleUnitList.clear();
|
//inVisibleUnitList.clear();
|
||||||
@@ -131,14 +131,14 @@ public:
|
|||||||
visibleUnitList.reserve(500);
|
visibleUnitList.reserve(500);
|
||||||
visibleQuadUnitList.reserve(500);
|
visibleQuadUnitList.reserve(500);
|
||||||
}
|
}
|
||||||
void clearNonVolatileCacheData() {
|
inline void clearNonVolatileCacheData() {
|
||||||
visibleObjectList.clear();
|
visibleObjectList.clear();
|
||||||
visibleScaledCellList.clear();
|
visibleScaledCellList.clear();
|
||||||
|
|
||||||
visibleObjectList.reserve(500);
|
visibleObjectList.reserve(500);
|
||||||
visibleScaledCellList.reserve(500);
|
visibleScaledCellList.reserve(500);
|
||||||
}
|
}
|
||||||
void clearFrustrumData() {
|
inline void clearFrustrumData() {
|
||||||
frustumData = vector<vector<float> >(6,vector<float>(4,0));
|
frustumData = vector<vector<float> >(6,vector<float>(4,0));
|
||||||
proj = vector<float>(16,0);
|
proj = vector<float>(16,0);
|
||||||
modl = vector<float>(16,0);
|
modl = vector<float>(16,0);
|
||||||
@@ -313,7 +313,7 @@ private:
|
|||||||
|
|
||||||
class SurfaceData {
|
class SurfaceData {
|
||||||
public:
|
public:
|
||||||
SurfaceData() {
|
inline SurfaceData() {
|
||||||
uniqueId=0;
|
uniqueId=0;
|
||||||
bufferCount=0;
|
bufferCount=0;
|
||||||
textureHandle=0;
|
textureHandle=0;
|
||||||
@@ -335,8 +335,8 @@ private:
|
|||||||
|
|
||||||
class MapRenderer {
|
class MapRenderer {
|
||||||
public:
|
public:
|
||||||
MapRenderer(): map(NULL) {}
|
inline MapRenderer(): map(NULL) {}
|
||||||
~MapRenderer() { destroy(); }
|
inline ~MapRenderer() { destroy(); }
|
||||||
void render(const Map* map,float coordStep,VisibleQuadContainerCache &qCache);
|
void render(const Map* map,float coordStep,VisibleQuadContainerCache &qCache);
|
||||||
void renderVisibleLayers(const Map* map,float coordStep,VisibleQuadContainerCache &qCache);
|
void renderVisibleLayers(const Map* map,float coordStep,VisibleQuadContainerCache &qCache);
|
||||||
void destroy();
|
void destroy();
|
||||||
@@ -346,7 +346,7 @@ private:
|
|||||||
|
|
||||||
const Map* map;
|
const Map* map;
|
||||||
struct Layer {
|
struct Layer {
|
||||||
Layer(int th):
|
inline Layer(int th):
|
||||||
vbo_vertices(0), vbo_normals(0),
|
vbo_vertices(0), vbo_normals(0),
|
||||||
vbo_fowTexCoords(0), vbo_surfTexCoords(0),
|
vbo_fowTexCoords(0), vbo_surfTexCoords(0),
|
||||||
vbo_indices(0), indexCount(0),
|
vbo_indices(0), indexCount(0),
|
||||||
@@ -409,8 +409,8 @@ public:
|
|||||||
void endGame(bool isFinalEnd);
|
void endGame(bool isFinalEnd);
|
||||||
|
|
||||||
//get
|
//get
|
||||||
int getTriangleCount() const {return triangleCount;}
|
inline int getTriangleCount() const {return triangleCount;}
|
||||||
int getPointCount() const {return pointCount;}
|
inline int getPointCount() const {return pointCount;}
|
||||||
|
|
||||||
//misc
|
//misc
|
||||||
void reloadResources();
|
void reloadResources();
|
||||||
@@ -431,8 +431,8 @@ public:
|
|||||||
void endFont(Font *font, ResourceScope rs, bool mustExistInList=false);
|
void endFont(Font *font, ResourceScope rs, bool mustExistInList=false);
|
||||||
void resetFontManager(ResourceScope rs);
|
void resetFontManager(ResourceScope rs);
|
||||||
|
|
||||||
TextRenderer2D *getTextRenderer() const {return textRenderer;}
|
inline TextRenderer2D *getTextRenderer() const {return textRenderer;}
|
||||||
TextRenderer3D *getTextRenderer3D() const {return textRenderer3D;}
|
inline TextRenderer3D *getTextRenderer3D() const {return textRenderer3D;}
|
||||||
|
|
||||||
void manageParticleSystem(ParticleSystem *particleSystem, ResourceScope rs);
|
void manageParticleSystem(ParticleSystem *particleSystem, ResourceScope rs);
|
||||||
void cleanupParticleSystems(vector<ParticleSystem *> &particleSystems,ResourceScope rs);
|
void cleanupParticleSystems(vector<ParticleSystem *> &particleSystems,ResourceScope rs);
|
||||||
@@ -532,8 +532,8 @@ public:
|
|||||||
//misc
|
//misc
|
||||||
void loadConfig();
|
void loadConfig();
|
||||||
void saveScreen(const string &path,int w=0, int h=0);
|
void saveScreen(const string &path,int w=0, int h=0);
|
||||||
Quad2i getVisibleQuad() const {return visibleQuad;}
|
inline Quad2i getVisibleQuad() const {return visibleQuad;}
|
||||||
Quad2i getVisibleQuadFromCamera() const {return visibleQuadFromCamera;}
|
inline Quad2i getVisibleQuadFromCamera() const {return visibleQuadFromCamera;}
|
||||||
void renderTeamColorPlane();
|
void renderTeamColorPlane();
|
||||||
void renderTeamColorCircle();
|
void renderTeamColorCircle();
|
||||||
|
|
||||||
@@ -541,28 +541,28 @@ public:
|
|||||||
static Shadows strToShadows(const string &s);
|
static Shadows strToShadows(const string &s);
|
||||||
static string shadowsToStr(Shadows shadows);
|
static string shadowsToStr(Shadows shadows);
|
||||||
|
|
||||||
const Game * getGame() { return game; }
|
inline const Game * getGame() { return game; }
|
||||||
|
|
||||||
void setAllowRenderUnitTitles(bool value);
|
void setAllowRenderUnitTitles(bool value);
|
||||||
bool getAllowRenderUnitTitles() { return allowRenderUnitTitles; }
|
inline bool getAllowRenderUnitTitles() { return allowRenderUnitTitles; }
|
||||||
void renderUnitTitles(Font2D *font, Vec3f color);
|
void renderUnitTitles(Font2D *font, Vec3f color);
|
||||||
void renderUnitTitles3D(Font3D *font, Vec3f color);
|
void renderUnitTitles3D(Font3D *font, Vec3f color);
|
||||||
Vec3f computeScreenPosition(const Vec3f &worldPos);
|
Vec3f computeScreenPosition(const Vec3f &worldPos);
|
||||||
|
|
||||||
void setPhotoMode(bool value) { photoMode = value; }
|
void setPhotoMode(bool value) { photoMode = value; }
|
||||||
|
|
||||||
bool getNo2DMouseRendering() const { return no2DMouseRendering; }
|
inline bool getNo2DMouseRendering() const { return no2DMouseRendering; }
|
||||||
void setNo2DMouseRendering(bool value) { no2DMouseRendering = value; }
|
void setNo2DMouseRendering(bool value) { no2DMouseRendering = value; }
|
||||||
|
|
||||||
bool getShowDebugUI() const { return showDebugUI; }
|
inline bool getShowDebugUI() const { return showDebugUI; }
|
||||||
void setShowDebugUI(bool value) { showDebugUI = value; }
|
void setShowDebugUI(bool value) { showDebugUI = value; }
|
||||||
|
|
||||||
int getShowDebugUILevel() const { return showDebugUILevel; }
|
inline int getShowDebugUILevel() const { return showDebugUILevel; }
|
||||||
void setShowDebugUILevel(int value) { showDebugUILevel=value; }
|
void setShowDebugUILevel(int value) { showDebugUILevel=value; }
|
||||||
void cycleShowDebugUILevel();
|
void cycleShowDebugUILevel();
|
||||||
|
|
||||||
void setLastRenderFps(int value);
|
void setLastRenderFps(int value);
|
||||||
int getLastRenderFps() const { return lastRenderFps;}
|
inline int getLastRenderFps() const { return lastRenderFps;}
|
||||||
|
|
||||||
VisibleQuadContainerCache & getQuadCache(bool updateOnDirtyFrame=true,bool forceNew=false);
|
VisibleQuadContainerCache & getQuadCache(bool updateOnDirtyFrame=true,bool forceNew=false);
|
||||||
void removeObjectFromQuadCache(const Object *o);
|
void removeObjectFromQuadCache(const Object *o);
|
||||||
@@ -577,10 +577,10 @@ public:
|
|||||||
|
|
||||||
static Texture2D * findFactionLogoTexture(string logoFilename);
|
static Texture2D * findFactionLogoTexture(string logoFilename);
|
||||||
static Texture2D * preloadTexture(string logoFilename);
|
static Texture2D * preloadTexture(string logoFilename);
|
||||||
int getCachedSurfaceDataSize() const { return mapSurfaceData.size(); }
|
inline int getCachedSurfaceDataSize() const { return mapSurfaceData.size(); }
|
||||||
|
|
||||||
void setCustom3dMenuList(GLuint *customlist3dMenu) { this->customlist3dMenu = customlist3dMenu; }
|
void setCustom3dMenuList(GLuint *customlist3dMenu) { this->customlist3dMenu = customlist3dMenu; }
|
||||||
GLuint * getCustom3dMenuList() const { return this->customlist3dMenu; }
|
inline GLuint * getCustom3dMenuList() const { return this->customlist3dMenu; }
|
||||||
|
|
||||||
void init3dListMenu(const MainMenu *mm);
|
void init3dListMenu(const MainMenu *mm);
|
||||||
|
|
||||||
|
@@ -151,12 +151,12 @@ public:
|
|||||||
Faction();
|
Faction();
|
||||||
~Faction();
|
~Faction();
|
||||||
|
|
||||||
void addLivingUnits(int id) { livingUnits.insert(id); }
|
inline void addLivingUnits(int id) { livingUnits.insert(id); }
|
||||||
void addLivingUnitsp(Unit *unit) { livingUnitsp.insert(unit); }
|
inline void addLivingUnitsp(Unit *unit) { livingUnitsp.insert(unit); }
|
||||||
|
|
||||||
bool isUnitInLivingUnitsp(Unit *unit) { return (livingUnitsp.find(unit) != livingUnitsp.end()); }
|
inline bool isUnitInLivingUnitsp(Unit *unit) { return (livingUnitsp.find(unit) != livingUnitsp.end()); }
|
||||||
void deleteLivingUnits(int id) { livingUnits.erase(id); }
|
inline void deleteLivingUnits(int id) { livingUnits.erase(id); }
|
||||||
void deleteLivingUnitsp(Unit *unit) { livingUnitsp.erase(unit); }
|
inline void deleteLivingUnitsp(Unit *unit) { livingUnitsp.erase(unit); }
|
||||||
|
|
||||||
//std::map<int,int> unitsMovingList;
|
//std::map<int,int> unitsMovingList;
|
||||||
void addUnitToMovingList(int unitId);
|
void addUnitToMovingList(int unitId);
|
||||||
@@ -175,32 +175,32 @@ public:
|
|||||||
bool giveResources, const XmlNode *loadWorldNode=NULL);
|
bool giveResources, const XmlNode *loadWorldNode=NULL);
|
||||||
void end();
|
void end();
|
||||||
|
|
||||||
bool getFactionDisconnectHandled() const { return factionDisconnectHandled;}
|
inline bool getFactionDisconnectHandled() const { return factionDisconnectHandled;}
|
||||||
void setFactionDisconnectHandled(bool value) { factionDisconnectHandled=value;}
|
void setFactionDisconnectHandled(bool value) { factionDisconnectHandled=value;}
|
||||||
|
|
||||||
//get
|
//get
|
||||||
const Resource *getResource(const ResourceType *rt) const;
|
const Resource *getResource(const ResourceType *rt) const;
|
||||||
const Resource *getResource(int i) const {return &resources[i];}
|
inline const Resource *getResource(int i) const {return &resources[i];}
|
||||||
int getStoreAmount(const ResourceType *rt) const;
|
int getStoreAmount(const ResourceType *rt) const;
|
||||||
const FactionType *getType() const {return factionType;}
|
inline const FactionType *getType() const {return factionType;}
|
||||||
int getIndex() const {return index;}
|
inline int getIndex() const {return index;}
|
||||||
|
|
||||||
int getTeam() const {return teamIndex;}
|
inline int getTeam() const {return teamIndex;}
|
||||||
void setTeam(int team) {teamIndex=team;}
|
void setTeam(int team) {teamIndex=team;}
|
||||||
|
|
||||||
TechTree * getTechTree() const { return techTree; }
|
inline TechTree * getTechTree() const { return techTree; }
|
||||||
const SwitchTeamVote * getFirstSwitchTeamVote() const;
|
const SwitchTeamVote * getFirstSwitchTeamVote() const;
|
||||||
SwitchTeamVote * getSwitchTeamVote(int factionIndex);
|
SwitchTeamVote * getSwitchTeamVote(int factionIndex);
|
||||||
void setSwitchTeamVote(SwitchTeamVote &vote);
|
void setSwitchTeamVote(SwitchTeamVote &vote);
|
||||||
int getCurrentSwitchTeamVoteFactionIndex() const { return currentSwitchTeamVoteFactionIndex; }
|
inline int getCurrentSwitchTeamVoteFactionIndex() const { return currentSwitchTeamVoteFactionIndex; }
|
||||||
void setCurrentSwitchTeamVoteFactionIndex(int index) { currentSwitchTeamVoteFactionIndex = index; }
|
void setCurrentSwitchTeamVoteFactionIndex(int index) { currentSwitchTeamVoteFactionIndex = index; }
|
||||||
|
|
||||||
bool getCpuControl(bool enableServerControlledAI, bool isNetworkGame, NetworkRole role) const;
|
bool getCpuControl(bool enableServerControlledAI, bool isNetworkGame, NetworkRole role) const;
|
||||||
bool getCpuControl() const;
|
bool getCpuControl() const;
|
||||||
bool getCpuEasyControl() const {return control==ctCpuEasy;}
|
inline bool getCpuEasyControl() const {return control==ctCpuEasy;}
|
||||||
bool getCpuUltraControl() const {return control==ctCpuUltra;}
|
inline bool getCpuUltraControl() const {return control==ctCpuUltra;}
|
||||||
bool getCpuMegaControl() const {return control==ctCpuMega;}
|
inline bool getCpuMegaControl() const {return control==ctCpuMega;}
|
||||||
ControlType getControlType() const {return control;}
|
inline ControlType getControlType() const {return control;}
|
||||||
|
|
||||||
FactionPersonalityType getPersonalityType() const;
|
FactionPersonalityType getPersonalityType() const;
|
||||||
void setPersonalityType(FactionPersonalityType pType) { overridePersonalityType=pType; }
|
void setPersonalityType(FactionPersonalityType pType) { overridePersonalityType=pType; }
|
||||||
@@ -210,10 +210,10 @@ public:
|
|||||||
int getUnitCount() const;
|
int getUnitCount() const;
|
||||||
Mutex * getUnitMutex() {return unitsMutex;}
|
Mutex * getUnitMutex() {return unitsMutex;}
|
||||||
|
|
||||||
const UpgradeManager *getUpgradeManager() const {return &upgradeManager;}
|
inline const UpgradeManager *getUpgradeManager() const {return &upgradeManager;}
|
||||||
const Texture2D *getTexture() const {return texture;}
|
inline const Texture2D *getTexture() const {return texture;}
|
||||||
int getStartLocationIndex() const {return startLocationIndex;}
|
inline int getStartLocationIndex() const {return startLocationIndex;}
|
||||||
bool getThisFaction() const {return thisFaction;}
|
inline bool getThisFaction() const {return thisFaction;}
|
||||||
|
|
||||||
//upgrades
|
//upgrades
|
||||||
void startUpgrade(const UpgradeType *ut);
|
void startUpgrade(const UpgradeType *ut);
|
||||||
@@ -259,7 +259,7 @@ public:
|
|||||||
Vec2i getClosestResourceTypeTargetFromCache(Unit *unit, const ResourceType *type);
|
Vec2i getClosestResourceTypeTargetFromCache(Unit *unit, const ResourceType *type);
|
||||||
Vec2i getClosestResourceTypeTargetFromCache(const Vec2i &pos, const ResourceType *type);
|
Vec2i getClosestResourceTypeTargetFromCache(const Vec2i &pos, const ResourceType *type);
|
||||||
void cleanupResourceTypeTargetCache(std::vector<Vec2i> *deleteListPtr);
|
void cleanupResourceTypeTargetCache(std::vector<Vec2i> *deleteListPtr);
|
||||||
int getCacheResourceTargetListSize() const { return cacheResourceTargetList.size(); }
|
inline int getCacheResourceTargetListSize() const { return cacheResourceTargetList.size(); }
|
||||||
|
|
||||||
Unit * findClosestUnitWithSkillClass(const Vec2i &pos,const CommandClass &cmdClass,
|
Unit * findClosestUnitWithSkillClass(const Vec2i &pos,const CommandClass &cmdClass,
|
||||||
const std::vector<SkillClass> &skillClassList,
|
const std::vector<SkillClass> &skillClassList,
|
||||||
@@ -267,7 +267,7 @@ public:
|
|||||||
|
|
||||||
void deletePixels();
|
void deletePixels();
|
||||||
|
|
||||||
World * getWorld() { return world; }
|
inline World * getWorld() { return world; }
|
||||||
int getFrameCount();
|
int getFrameCount();
|
||||||
void signalWorkerThread(int frameIndex);
|
void signalWorkerThread(int frameIndex);
|
||||||
bool isWorkerThreadSignalCompleted(int frameIndex);
|
bool isWorkerThreadSignalCompleted(int frameIndex);
|
||||||
|
@@ -445,67 +445,67 @@ public:
|
|||||||
//queries
|
//queries
|
||||||
Command *getCurrrentCommandThreadSafe();
|
Command *getCurrrentCommandThreadSafe();
|
||||||
void setIgnoreCheckCommand(bool value) { ignoreCheckCommand=value;}
|
void setIgnoreCheckCommand(bool value) { ignoreCheckCommand=value;}
|
||||||
bool getIgnoreCheckCommand() const {return ignoreCheckCommand;}
|
inline bool getIgnoreCheckCommand() const {return ignoreCheckCommand;}
|
||||||
int getId() const {return id;}
|
inline int getId() const {return id;}
|
||||||
Field getCurrField() const {return currField;}
|
inline Field getCurrField() const {return currField;}
|
||||||
int getLoadCount() const {return loadCount;}
|
inline int getLoadCount() const {return loadCount;}
|
||||||
float getLastAnimProgress() const {return lastAnimProgress;}
|
inline float getLastAnimProgress() const {return lastAnimProgress;}
|
||||||
//float getProgress() const {return progress;}
|
//float getProgress() const {return progress;}
|
||||||
float getAnimProgress() const {return animProgress;}
|
inline float getAnimProgress() const {return animProgress;}
|
||||||
float getHightlight() const {return highlight;}
|
inline float getHightlight() const {return highlight;}
|
||||||
int getProgress2() const {return progress2;}
|
inline int getProgress2() const {return progress2;}
|
||||||
int getFactionIndex() const;
|
int getFactionIndex() const;
|
||||||
int getTeam() const;
|
int getTeam() const;
|
||||||
int getHp() const {return hp;}
|
inline int getHp() const {return hp;}
|
||||||
int getEp() const {return ep;}
|
inline int getEp() const {return ep;}
|
||||||
int getProductionPercent() const;
|
int getProductionPercent() const;
|
||||||
float getProgressRatio() const;
|
float getProgressRatio() const;
|
||||||
float getHpRatio() const;
|
float getHpRatio() const;
|
||||||
float getEpRatio() const;
|
float getEpRatio() const;
|
||||||
bool getToBeUndertaken() const {return toBeUndertaken;}
|
inline bool getToBeUndertaken() const {return toBeUndertaken;}
|
||||||
Vec2i getTargetPos() const {return targetPos;}
|
inline Vec2i getTargetPos() const {return targetPos;}
|
||||||
Vec3f getTargetVec() const {return targetVec;}
|
inline Vec3f getTargetVec() const {return targetVec;}
|
||||||
Field getTargetField() const {return targetField;}
|
inline Field getTargetField() const {return targetField;}
|
||||||
Vec2i getMeetingPos() const {return meetingPos;}
|
inline Vec2i getMeetingPos() const {return meetingPos;}
|
||||||
Faction *getFaction() const {return faction;}
|
inline Faction *getFaction() const {return faction;}
|
||||||
const ResourceType *getLoadType() const {return loadType;}
|
inline const ResourceType *getLoadType() const {return loadType;}
|
||||||
const UnitType *getType() const {return type;}
|
inline const UnitType *getType() const {return type;}
|
||||||
const SkillType *getCurrSkill() const {return currSkill;}
|
inline const SkillType *getCurrSkill() const {return currSkill;}
|
||||||
const TotalUpgrade *getTotalUpgrade() const {return &totalUpgrade;}
|
inline const TotalUpgrade *getTotalUpgrade() const {return &totalUpgrade;}
|
||||||
float getRotation() const {return rotation;}
|
inline float getRotation() const {return rotation;}
|
||||||
float getRotationX() const;
|
float getRotationX() const;
|
||||||
float getRotationZ() const;
|
float getRotationZ() const;
|
||||||
ParticleSystem *getFire() const {return fire;}
|
inline ParticleSystem *getFire() const {return fire;}
|
||||||
int getKills() const {return kills;}
|
inline int getKills() const {return kills;}
|
||||||
int getEnemyKills() const {return enemyKills;}
|
inline int getEnemyKills() const {return enemyKills;}
|
||||||
const Level *getLevel() const {return level;}
|
inline const Level *getLevel() const {return level;}
|
||||||
const Level *getNextLevel() const;
|
const Level *getNextLevel() const;
|
||||||
string getFullName() const;
|
string getFullName() const;
|
||||||
const UnitPathInterface *getPath() const {return unitPath;}
|
inline const UnitPathInterface *getPath() const {return unitPath;}
|
||||||
UnitPathInterface *getPath() {return unitPath;}
|
inline UnitPathInterface *getPath() {return unitPath;}
|
||||||
WaypointPath *getWaypointPath() {return &waypointPath;}
|
inline WaypointPath *getWaypointPath() {return &waypointPath;}
|
||||||
|
|
||||||
int getLastAttackerUnitId() const { return lastAttackerUnitId; }
|
inline int getLastAttackerUnitId() const { return lastAttackerUnitId; }
|
||||||
void setLastAttackerUnitId(int unitId) { lastAttackerUnitId = unitId; }
|
inline void setLastAttackerUnitId(int unitId) { lastAttackerUnitId = unitId; }
|
||||||
|
|
||||||
int getLastAttackedUnitId() const { return lastAttackedUnitId; }
|
inline int getLastAttackedUnitId() const { return lastAttackedUnitId; }
|
||||||
void setLastAttackedUnitId(int unitId) { lastAttackedUnitId = unitId; }
|
inline void setLastAttackedUnitId(int unitId) { lastAttackedUnitId = unitId; }
|
||||||
|
|
||||||
CauseOfDeathType getCauseOfDeath() const { return causeOfDeath; }
|
inline CauseOfDeathType getCauseOfDeath() const { return causeOfDeath; }
|
||||||
void setCauseOfDeath(CauseOfDeathType cause) { causeOfDeath = cause; }
|
inline void setCauseOfDeath(CauseOfDeathType cause) { causeOfDeath = cause; }
|
||||||
|
|
||||||
//pos
|
//pos
|
||||||
Vec2i getPos() const {return pos;}
|
inline Vec2i getPos() const {return pos;}
|
||||||
Vec2i getPosWithCellMapSet() const;
|
Vec2i getPosWithCellMapSet() const;
|
||||||
Vec2i getLastPos() const {return lastPos;}
|
inline Vec2i getLastPos() const {return lastPos;}
|
||||||
Vec2i getCenteredPos() const;
|
Vec2i getCenteredPos() const;
|
||||||
Vec2f getFloatCenteredPos() const;
|
Vec2f getFloatCenteredPos() const;
|
||||||
Vec2i getCellPos() const;
|
Vec2i getCellPos() const;
|
||||||
|
|
||||||
//is
|
//is
|
||||||
bool isHighlighted() const {return highlight>0.f;}
|
inline bool isHighlighted() const {return highlight>0.f;}
|
||||||
bool isDead() const {return !alive;}
|
inline bool isDead() const {return !alive;}
|
||||||
bool isAlive() const {return alive;}
|
inline bool isAlive() const {return alive;}
|
||||||
bool isOperative() const;
|
bool isOperative() const;
|
||||||
bool isBeingBuilt() const;
|
bool isBeingBuilt() const;
|
||||||
bool isBuilt() const;
|
bool isBuilt() const;
|
||||||
@@ -516,19 +516,19 @@ public:
|
|||||||
bool isInteresting(InterestingUnitType iut) const;
|
bool isInteresting(InterestingUnitType iut) const;
|
||||||
|
|
||||||
//set
|
//set
|
||||||
void setCurrField(Field currField) {this->currField= currField;}
|
inline void setCurrField(Field currField) {this->currField= currField;}
|
||||||
void setCurrSkill(const SkillType *currSkill);
|
void setCurrSkill(const SkillType *currSkill);
|
||||||
void setCurrSkill(SkillClass sc);
|
void setCurrSkill(SkillClass sc);
|
||||||
void setLoadCount(int loadCount) {this->loadCount= loadCount;}
|
inline void setLoadCount(int loadCount) {this->loadCount= loadCount;}
|
||||||
void setLoadType(const ResourceType *loadType) {this->loadType= loadType;}
|
inline void setLoadType(const ResourceType *loadType) {this->loadType= loadType;}
|
||||||
void setProgress2(int progress2) {this->progress2= progress2;}
|
inline void setProgress2(int progress2) {this->progress2= progress2;}
|
||||||
void setPos(const Vec2i &pos,bool clearPathFinder=false);
|
void setPos(const Vec2i &pos,bool clearPathFinder=false);
|
||||||
void setTargetPos(const Vec2i &targetPos);
|
void setTargetPos(const Vec2i &targetPos);
|
||||||
void setTarget(const Unit *unit);
|
void setTarget(const Unit *unit);
|
||||||
void setTargetVec(const Vec3f &targetVec);
|
void setTargetVec(const Vec3f &targetVec);
|
||||||
void setMeetingPos(const Vec2i &meetingPos);
|
void setMeetingPos(const Vec2i &meetingPos);
|
||||||
void setVisible(const bool visible);
|
void setVisible(const bool visible);
|
||||||
bool getVisible() const { return visible; }
|
inline bool getVisible() const { return visible; }
|
||||||
|
|
||||||
//render related
|
//render related
|
||||||
const Model *getCurrentModel();
|
const Model *getCurrentModel();
|
||||||
@@ -582,26 +582,26 @@ public:
|
|||||||
void applyCommand(Command *command);
|
void applyCommand(Command *command);
|
||||||
|
|
||||||
void setModelFacing(CardinalDir value);
|
void setModelFacing(CardinalDir value);
|
||||||
CardinalDir getModelFacing() const { return modelFacing; }
|
inline CardinalDir getModelFacing() const { return modelFacing; }
|
||||||
|
|
||||||
bool isMeetingPointSettable() const;
|
bool isMeetingPointSettable() const;
|
||||||
|
|
||||||
int getLastRenderFrame() const { return lastRenderFrame; }
|
inline int getLastRenderFrame() const { return lastRenderFrame; }
|
||||||
void setLastRenderFrame(int value) { lastRenderFrame = value; }
|
inline void setLastRenderFrame(int value) { lastRenderFrame = value; }
|
||||||
|
|
||||||
int getRetryCurrCommandCount() const { return retryCurrCommandCount; }
|
inline int getRetryCurrCommandCount() const { return retryCurrCommandCount; }
|
||||||
void setRetryCurrCommandCount(int value) { retryCurrCommandCount = value; }
|
inline void setRetryCurrCommandCount(int value) { retryCurrCommandCount = value; }
|
||||||
|
|
||||||
Vec3f getScreenPos() const { return screenPos; }
|
inline Vec3f getScreenPos() const { return screenPos; }
|
||||||
void setScreenPos(Vec3f value) { screenPos = value; }
|
void setScreenPos(Vec3f value) { screenPos = value; }
|
||||||
|
|
||||||
string getCurrentUnitTitle() const {return currentUnitTitle;}
|
inline string getCurrentUnitTitle() const {return currentUnitTitle;}
|
||||||
void setCurrentUnitTitle(string value) { currentUnitTitle = value;}
|
void setCurrentUnitTitle(string value) { currentUnitTitle = value;}
|
||||||
|
|
||||||
void exploreCells();
|
void exploreCells();
|
||||||
|
|
||||||
bool getInBailOutAttempt() const { return inBailOutAttempt; }
|
inline bool getInBailOutAttempt() const { return inBailOutAttempt; }
|
||||||
void setInBailOutAttempt(bool value) { inBailOutAttempt = value; }
|
inline void setInBailOutAttempt(bool value) { inBailOutAttempt = value; }
|
||||||
|
|
||||||
//std::vector<std::pair<Vec2i,Chrono> > getBadHarvestPosList() const { return badHarvestPosList; }
|
//std::vector<std::pair<Vec2i,Chrono> > getBadHarvestPosList() const { return badHarvestPosList; }
|
||||||
//void setBadHarvestPosList(std::vector<std::pair<Vec2i,Chrono> > value) { badHarvestPosList = value; }
|
//void setBadHarvestPosList(std::vector<std::pair<Vec2i,Chrono> > value) { badHarvestPosList = value; }
|
||||||
@@ -611,7 +611,7 @@ public:
|
|||||||
void cleanupOldBadHarvestPos();
|
void cleanupOldBadHarvestPos();
|
||||||
|
|
||||||
void setLastHarvestResourceTarget(const Vec2i *pos);
|
void setLastHarvestResourceTarget(const Vec2i *pos);
|
||||||
std::pair<Vec2i,int> getLastHarvestResourceTarget() const { return lastHarvestResourceTarget;}
|
inline std::pair<Vec2i,int> getLastHarvestResourceTarget() const { return lastHarvestResourceTarget;}
|
||||||
|
|
||||||
//std::pair<Vec2i,std::vector<Vec2i> > getCurrentTargetPathTaken() const { return currentTargetPathTaken; }
|
//std::pair<Vec2i,std::vector<Vec2i> > getCurrentTargetPathTaken() const { return currentTargetPathTaken; }
|
||||||
//void addCurrentTargetPathTakenCell(const Vec2i &target,const Vec2i &cell);
|
//void addCurrentTargetPathTakenCell(const Vec2i &target,const Vec2i &cell);
|
||||||
@@ -621,23 +621,23 @@ public:
|
|||||||
bool needToUpdate();
|
bool needToUpdate();
|
||||||
|
|
||||||
bool isLastStuckFrameWithinCurrentFrameTolerance() const;
|
bool isLastStuckFrameWithinCurrentFrameTolerance() const;
|
||||||
uint32 getLastStuckFrame() const { return lastStuckFrame; }
|
inline uint32 getLastStuckFrame() const { return lastStuckFrame; }
|
||||||
void setLastStuckFrame(uint32 value) { lastStuckFrame = value; }
|
inline void setLastStuckFrame(uint32 value) { lastStuckFrame = value; }
|
||||||
void setLastStuckFrameToCurrentFrame();
|
void setLastStuckFrameToCurrentFrame();
|
||||||
|
|
||||||
Vec2i getLastStuckPos() const { return lastStuckPos; }
|
inline Vec2i getLastStuckPos() const { return lastStuckPos; }
|
||||||
void setLastStuckPos(Vec2i pos) { lastStuckPos = pos; }
|
inline void setLastStuckPos(Vec2i pos) { lastStuckPos = pos; }
|
||||||
|
|
||||||
bool isLastPathfindFailedFrameWithinCurrentFrameTolerance() const;
|
bool isLastPathfindFailedFrameWithinCurrentFrameTolerance() const;
|
||||||
uint32 getLastPathfindFailedFrame() const { return lastPathfindFailedFrame; }
|
inline uint32 getLastPathfindFailedFrame() const { return lastPathfindFailedFrame; }
|
||||||
void setLastPathfindFailedFrame(uint32 value) { lastPathfindFailedFrame = value; }
|
inline void setLastPathfindFailedFrame(uint32 value) { lastPathfindFailedFrame = value; }
|
||||||
void setLastPathfindFailedFrameToCurrentFrame();
|
void setLastPathfindFailedFrameToCurrentFrame();
|
||||||
|
|
||||||
Vec2i getLastPathfindFailedPos() const { return lastPathfindFailedPos; }
|
inline Vec2i getLastPathfindFailedPos() const { return lastPathfindFailedPos; }
|
||||||
void setLastPathfindFailedPos(Vec2i pos) { lastPathfindFailedPos = pos; }
|
inline void setLastPathfindFailedPos(Vec2i pos) { lastPathfindFailedPos = pos; }
|
||||||
|
|
||||||
bool getUsePathfinderExtendedMaxNodes() const { return usePathfinderExtendedMaxNodes; }
|
inline bool getUsePathfinderExtendedMaxNodes() const { return usePathfinderExtendedMaxNodes; }
|
||||||
void setUsePathfinderExtendedMaxNodes(bool value) { usePathfinderExtendedMaxNodes = value; }
|
inline void setUsePathfinderExtendedMaxNodes(bool value) { usePathfinderExtendedMaxNodes = value; }
|
||||||
|
|
||||||
void updateTimedParticles();
|
void updateTimedParticles();
|
||||||
|
|
||||||
|
@@ -153,46 +153,46 @@ public:
|
|||||||
Checksum* techtreeChecksum, std::map<string,vector<pair<string, string> > > &loadedFileList);
|
Checksum* techtreeChecksum, std::map<string,vector<pair<string, string> > > &loadedFileList);
|
||||||
|
|
||||||
//get
|
//get
|
||||||
int getId() const {return id;}
|
inline int getId() const {return id;}
|
||||||
int getMaxHp() const {return maxHp;}
|
inline int getMaxHp() const {return maxHp;}
|
||||||
int getHpRegeneration() const {return hpRegeneration;}
|
inline int getHpRegeneration() const {return hpRegeneration;}
|
||||||
int getMaxEp() const {return maxEp;}
|
inline int getMaxEp() const {return maxEp;}
|
||||||
int getEpRegeneration() const {return epRegeneration;}
|
inline int getEpRegeneration() const {return epRegeneration;}
|
||||||
int getMaxUnitCount() const {return maxUnitCount;}
|
inline int getMaxUnitCount() const {return maxUnitCount;}
|
||||||
bool getField(Field field) const {return fields[field];}
|
inline bool getField(Field field) const {return fields[field];}
|
||||||
Field getField() const {return field;}
|
inline Field getField() const {return field;}
|
||||||
bool getProperty(Property property) const {return properties[property];}
|
inline bool getProperty(Property property) const {return properties[property];}
|
||||||
int getArmor() const {return armor;}
|
inline int getArmor() const {return armor;}
|
||||||
const ArmorType *getArmorType() const {return armorType;}
|
inline const ArmorType *getArmorType() const {return armorType;}
|
||||||
const SkillType *getSkillType(int i) const {return skillTypes[i];}
|
inline const SkillType *getSkillType(int i) const {return skillTypes[i];}
|
||||||
const CommandType *getCommandType(int i) const;
|
const CommandType *getCommandType(int i) const;
|
||||||
const Level *getLevel(int i) const {return &levels[i];}
|
inline const Level *getLevel(int i) const {return &levels[i];}
|
||||||
const Level *getLevel(string name) const;
|
const Level *getLevel(string name) const;
|
||||||
int getSkillTypeCount() const {return skillTypes.size();}
|
inline int getSkillTypeCount() const {return skillTypes.size();}
|
||||||
int getCommandTypeCount() const {return commandTypes.size();}
|
inline int getCommandTypeCount() const {return commandTypes.size();}
|
||||||
int getLevelCount() const {return levels.size();}
|
inline int getLevelCount() const {return levels.size();}
|
||||||
bool getLight() const {return light;}
|
inline bool getLight() const {return light;}
|
||||||
bool getRotationAllowed() const {return rotationAllowed;}
|
inline bool getRotationAllowed() const {return rotationAllowed;}
|
||||||
Vec3f getLightColor() const {return lightColor;}
|
inline Vec3f getLightColor() const {return lightColor;}
|
||||||
bool getMultiSelect() const {return multiSelect;}
|
inline bool getMultiSelect() const {return multiSelect;}
|
||||||
int getSight() const {return sight;}
|
inline int getSight() const {return sight;}
|
||||||
int getSize() const {return size;}
|
inline int getSize() const {return size;}
|
||||||
int getHeight() const {return height;}
|
int getHeight() const {return height;}
|
||||||
int getStoredResourceCount() const {return storedResources.size();}
|
int getStoredResourceCount() const {return storedResources.size();}
|
||||||
const Resource *getStoredResource(int i) const {return &storedResources[i];}
|
inline const Resource *getStoredResource(int i) const {return &storedResources[i];}
|
||||||
bool getCellMapCell(int x, int y, CardinalDir facing) const;
|
bool getCellMapCell(int x, int y, CardinalDir facing) const;
|
||||||
bool getMeetingPoint() const {return meetingPoint;}
|
inline bool getMeetingPoint() const {return meetingPoint;}
|
||||||
bool getCountUnitDeathInStats() const {return countUnitDeathInStats;}
|
inline bool getCountUnitDeathInStats() const {return countUnitDeathInStats;}
|
||||||
bool getCountUnitProductionInStats() const {return countUnitProductionInStats;}
|
inline bool getCountUnitProductionInStats() const {return countUnitProductionInStats;}
|
||||||
bool getCountUnitKillInStats() const {return countUnitKillInStats;}
|
inline bool getCountUnitKillInStats() const {return countUnitKillInStats;}
|
||||||
bool getCountKillForUnitUpgrade() const {return countKillForUnitUpgrade;}
|
inline bool getCountKillForUnitUpgrade() const {return countKillForUnitUpgrade;}
|
||||||
bool isMobile() const {return (firstSkillTypeOfClass[scMove] != NULL);}
|
inline bool isMobile() const {return (firstSkillTypeOfClass[scMove] != NULL);}
|
||||||
Texture2D *getMeetingPointImage() const {return meetingPointImage;}
|
inline Texture2D *getMeetingPointImage() const {return meetingPointImage;}
|
||||||
StaticSound *getSelectionSound() const {return selectionSounds.getRandSound();}
|
inline StaticSound *getSelectionSound() const {return selectionSounds.getRandSound();}
|
||||||
StaticSound *getCommandSound() const {return commandSounds.getRandSound();}
|
inline StaticSound *getCommandSound() const {return commandSounds.getRandSound();}
|
||||||
|
|
||||||
const SoundContainer & getSelectionSounds() const { return selectionSounds; }
|
inline const SoundContainer & getSelectionSounds() const { return selectionSounds; }
|
||||||
const SoundContainer & getCommandSounds() const { return commandSounds; }
|
inline const SoundContainer & getCommandSounds() const { return commandSounds; }
|
||||||
|
|
||||||
int getStore(const ResourceType *rt) const;
|
int getStore(const ResourceType *rt) const;
|
||||||
const SkillType *getSkillType(const string &skillName, SkillClass skillClass) const;
|
const SkillType *getSkillType(const string &skillName, SkillClass skillClass) const;
|
||||||
@@ -216,8 +216,8 @@ public:
|
|||||||
bool hasCommandClass(CommandClass commandClass) const;
|
bool hasCommandClass(CommandClass commandClass) const;
|
||||||
bool hasSkillType(const SkillType *skillType) const;
|
bool hasSkillType(const SkillType *skillType) const;
|
||||||
bool hasSkillClass(SkillClass skillClass) const;
|
bool hasSkillClass(SkillClass skillClass) const;
|
||||||
bool hasCellMap() const {return cellMap!=NULL;}
|
inline bool hasCellMap() const {return cellMap!=NULL;}
|
||||||
bool getAllowEmptyCellMap() const {return allowEmptyCellMap;}
|
inline bool getAllowEmptyCellMap() const {return allowEmptyCellMap;}
|
||||||
bool hasEmptyCellMap() const;
|
bool hasEmptyCellMap() const;
|
||||||
Vec2i getFirstOccupiedCellInCellMap(Vec2i currentPos) const;
|
Vec2i getFirstOccupiedCellInCellMap(Vec2i currentPos) const;
|
||||||
|
|
||||||
@@ -228,8 +228,8 @@ public:
|
|||||||
const CommandType* findCommandTypeById(int id) const;
|
const CommandType* findCommandTypeById(int id) const;
|
||||||
string getCommandTypeListDesc() const;
|
string getCommandTypeListDesc() const;
|
||||||
|
|
||||||
float getRotatedBuildPos() { return rotatedBuildPos; }
|
inline float getRotatedBuildPos() { return rotatedBuildPos; }
|
||||||
void setRotatedBuildPos(float value) { rotatedBuildPos = value; }
|
inline void setRotatedBuildPos(float value) { rotatedBuildPos = value; }
|
||||||
|
|
||||||
//other
|
//other
|
||||||
virtual string getReqDesc() const;
|
virtual string getReqDesc() const;
|
||||||
|
@@ -64,9 +64,9 @@ public:
|
|||||||
inline Unit *getUnitWithEmptyCellMap(int field) const { if(field >= fieldCount) { throw megaglest_runtime_error("Invalid field value" + intToStr(field));} return unitsWithEmptyCellMap[field];}
|
inline Unit *getUnitWithEmptyCellMap(int field) const { if(field >= fieldCount) { throw megaglest_runtime_error("Invalid field value" + intToStr(field));} return unitsWithEmptyCellMap[field];}
|
||||||
inline float getHeight() const {return height;}
|
inline float getHeight() const {return height;}
|
||||||
|
|
||||||
void setUnit(int field, Unit *unit) { if(field >= fieldCount) { throw megaglest_runtime_error("Invalid field value" + intToStr(field));} units[field]= unit;}
|
inline void setUnit(int field, Unit *unit) { if(field >= fieldCount) { throw megaglest_runtime_error("Invalid field value" + intToStr(field));} units[field]= unit;}
|
||||||
void setUnitWithEmptyCellMap(int field, Unit *unit) { if(field >= fieldCount) { throw megaglest_runtime_error("Invalid field value" + intToStr(field));} unitsWithEmptyCellMap[field]= unit;}
|
inline void setUnitWithEmptyCellMap(int field, Unit *unit) { if(field >= fieldCount) { throw megaglest_runtime_error("Invalid field value" + intToStr(field));} unitsWithEmptyCellMap[field]= unit;}
|
||||||
void setHeight(float height) {this->height= height;}
|
inline void setHeight(float height) {this->height= height;}
|
||||||
|
|
||||||
inline bool isFree(Field field) const {
|
inline bool isFree(Field field) const {
|
||||||
bool result = getUnit(field) == NULL || getUnit(field)->isPutrefacting();
|
bool result = getUnit(field) == NULL || getUnit(field)->isPutrefacting();
|
||||||
@@ -134,34 +134,34 @@ public:
|
|||||||
|
|
||||||
void end(); //to kill particles
|
void end(); //to kill particles
|
||||||
//get
|
//get
|
||||||
const Vec3f &getVertex() const {return vertex;}
|
inline const Vec3f &getVertex() const {return vertex;}
|
||||||
float getHeight() const {return vertex.y;}
|
inline float getHeight() const {return vertex.y;}
|
||||||
const Vec3f &getColor() const {return color;}
|
inline const Vec3f &getColor() const {return color;}
|
||||||
const Vec3f &getNormal() const {return normal;}
|
inline const Vec3f &getNormal() const {return normal;}
|
||||||
int getSurfaceType() const {return surfaceType;}
|
inline int getSurfaceType() const {return surfaceType;}
|
||||||
const Texture2D *getSurfaceTexture() const {return surfaceTexture;}
|
inline const Texture2D *getSurfaceTexture() const {return surfaceTexture;}
|
||||||
Object *getObject() const {return object;}
|
inline Object *getObject() const {return object;}
|
||||||
Resource *getResource() const {return object==NULL? NULL: object->getResource();}
|
inline Resource *getResource() const {return object==NULL? NULL: object->getResource();}
|
||||||
const Vec2f &getFowTexCoord() const {return fowTexCoord;}
|
inline const Vec2f &getFowTexCoord() const {return fowTexCoord;}
|
||||||
const Vec2f &getSurfTexCoord() const {return surfTexCoord;}
|
inline const Vec2f &getSurfTexCoord() const {return surfTexCoord;}
|
||||||
bool getNearSubmerged() const {return nearSubmerged;}
|
inline bool getNearSubmerged() const {return nearSubmerged;}
|
||||||
|
|
||||||
inline bool isVisible(int teamIndex) const {return visible[teamIndex];}
|
inline bool isVisible(int teamIndex) const {return visible[teamIndex];}
|
||||||
inline bool isExplored(int teamIndex) const {return explored[teamIndex];}
|
inline bool isExplored(int teamIndex) const {return explored[teamIndex];}
|
||||||
|
|
||||||
//set
|
//set
|
||||||
void setVertex(const Vec3f &vertex) {this->vertex= vertex;}
|
inline void setVertex(const Vec3f &vertex) {this->vertex= vertex;}
|
||||||
void setHeight(float height, bool cellChangedFromOriginalMapLoadValue=false);
|
inline void setHeight(float height, bool cellChangedFromOriginalMapLoadValue=false);
|
||||||
void setNormal(const Vec3f &normal) {this->normal= normal;}
|
inline void setNormal(const Vec3f &normal) {this->normal= normal;}
|
||||||
void setColor(const Vec3f &color) {this->color= color;}
|
inline void setColor(const Vec3f &color) {this->color= color;}
|
||||||
void setSurfaceType(int surfaceType) {this->surfaceType= surfaceType;}
|
inline void setSurfaceType(int surfaceType) {this->surfaceType= surfaceType;}
|
||||||
void setSurfaceTexture(const Texture2D *st) {this->surfaceTexture= st;}
|
inline void setSurfaceTexture(const Texture2D *st) {this->surfaceTexture= st;}
|
||||||
void setObject(Object *object) {this->object= object;}
|
inline void setObject(Object *object) {this->object= object;}
|
||||||
void setFowTexCoord(const Vec2f &ftc) {this->fowTexCoord= ftc;}
|
inline void setFowTexCoord(const Vec2f &ftc) {this->fowTexCoord= ftc;}
|
||||||
void setSurfTexCoord(const Vec2f &stc) {this->surfTexCoord= stc;}
|
inline void setSurfTexCoord(const Vec2f &stc) {this->surfTexCoord= stc;}
|
||||||
void setExplored(int teamIndex, bool explored);
|
void setExplored(int teamIndex, bool explored);
|
||||||
void setVisible(int teamIndex, bool visible);
|
void setVisible(int teamIndex, bool visible);
|
||||||
void setNearSubmerged(bool nearSubmerged) {this->nearSubmerged= nearSubmerged;}
|
inline void setNearSubmerged(bool nearSubmerged) {this->nearSubmerged= nearSubmerged;}
|
||||||
|
|
||||||
//misc
|
//misc
|
||||||
void deleteResource();
|
void deleteResource();
|
||||||
|
@@ -46,16 +46,16 @@ public:
|
|||||||
SurfaceInfo(const Pixmap2D *lu, const Pixmap2D *ru, const Pixmap2D *ld, const Pixmap2D *rd);
|
SurfaceInfo(const Pixmap2D *lu, const Pixmap2D *ru, const Pixmap2D *ld, const Pixmap2D *rd);
|
||||||
bool operator==(const SurfaceInfo &si) const;
|
bool operator==(const SurfaceInfo &si) const;
|
||||||
|
|
||||||
const Pixmap2D *getCenter() const {return center;}
|
inline const Pixmap2D *getCenter() const {return center;}
|
||||||
const Pixmap2D *getLeftUp() const {return leftUp;}
|
inline const Pixmap2D *getLeftUp() const {return leftUp;}
|
||||||
const Pixmap2D *getRightUp() const {return rightUp;}
|
inline const Pixmap2D *getRightUp() const {return rightUp;}
|
||||||
const Pixmap2D *getLeftDown() const {return leftDown;}
|
inline const Pixmap2D *getLeftDown() const {return leftDown;}
|
||||||
const Pixmap2D *getRightDown() const {return rightDown;}
|
inline const Pixmap2D *getRightDown() const {return rightDown;}
|
||||||
const Vec2f &getCoord() const {return coord;}
|
inline const Vec2f &getCoord() const {return coord;}
|
||||||
const Texture2D *getTexture() const {return texture;}
|
inline const Texture2D *getTexture() const {return texture;}
|
||||||
|
|
||||||
void setCoord(const Vec2f &coord) {this->coord= coord;}
|
inline void setCoord(const Vec2f &coord) {this->coord= coord;}
|
||||||
void setTexture(const Texture2D *texture) {this->texture= texture;}
|
inline void setTexture(const Texture2D *texture) {this->texture= texture;}
|
||||||
};
|
};
|
||||||
|
|
||||||
// =====================================================
|
// =====================================================
|
||||||
|
@@ -51,11 +51,11 @@ public:
|
|||||||
}
|
}
|
||||||
void init(Tileset *tileset);
|
void init(Tileset *tileset);
|
||||||
|
|
||||||
float getTime() const {return time;}
|
inline float getTime() const {return time;}
|
||||||
bool isDay() const {return time>dawn && time<dusk;}
|
inline bool isDay() const {return time>dawn && time<dusk;}
|
||||||
bool isNight() const {return !isDay();}
|
inline bool isNight() const {return !isDay();}
|
||||||
bool isTotalNight() const {return time<dawn+1.f || time>dusk-1.f;}
|
inline bool isTotalNight() const {return time<dawn+1.f || time>dusk-1.f;}
|
||||||
float getTimeInc() const {return timeInc;}
|
inline float getTimeInc() const {return timeInc;}
|
||||||
|
|
||||||
Vec3f computeLightColor() const;
|
Vec3f computeLightColor() const;
|
||||||
void update();
|
void update();
|
||||||
|
@@ -117,7 +117,7 @@ public:
|
|||||||
void clearUnitPrecache(Unit *unit);
|
void clearUnitPrecache(Unit *unit);
|
||||||
void removeUnitPrecache(Unit *unit);
|
void removeUnitPrecache(Unit *unit);
|
||||||
|
|
||||||
unsigned int getAttackWarningCount() const { return attackWarnings.size(); }
|
inline unsigned int getAttackWarningCount() const { return attackWarnings.size(); }
|
||||||
std::pair<bool,Unit *> unitBeingAttacked(const Unit *unit);
|
std::pair<bool,Unit *> unitBeingAttacked(const Unit *unit);
|
||||||
void unitBeingAttacked(std::pair<bool,Unit *> &result, const Unit *unit, const AttackSkillType *ast,float *currentDistToUnit=NULL);
|
void unitBeingAttacked(std::pair<bool,Unit *> &result, const Unit *unit, const AttackSkillType *ast,float *currentDistToUnit=NULL);
|
||||||
vector<Unit*> enemyUnitsOnRange(const Unit *unit,const AttackSkillType *ast);
|
vector<Unit*> enemyUnitsOnRange(const Unit *unit,const AttackSkillType *ast);
|
||||||
|
@@ -156,38 +156,38 @@ public:
|
|||||||
void endScenario(); //to die before selection does
|
void endScenario(); //to die before selection does
|
||||||
|
|
||||||
//get
|
//get
|
||||||
int getMaxPlayers() const {return map.getMaxPlayers();}
|
inline int getMaxPlayers() const {return map.getMaxPlayers();}
|
||||||
int getThisFactionIndex() const {return thisFactionIndex;}
|
inline int getThisFactionIndex() const {return thisFactionIndex;}
|
||||||
|
|
||||||
int getThisTeamIndex() const {return thisTeamIndex;}
|
inline int getThisTeamIndex() const {return thisTeamIndex;}
|
||||||
void setThisTeamIndex(int team) { thisTeamIndex=team;}
|
inline void setThisTeamIndex(int team) { thisTeamIndex=team;}
|
||||||
|
|
||||||
const Faction *getThisFaction() const {return factions[thisFactionIndex];}
|
inline const Faction *getThisFaction() const {return factions[thisFactionIndex];}
|
||||||
Faction *getThisFactionPtr() {return factions[thisFactionIndex];}
|
inline Faction *getThisFactionPtr() {return factions[thisFactionIndex];}
|
||||||
|
|
||||||
int getFactionCount() const {return factions.size();}
|
inline int getFactionCount() const {return factions.size();}
|
||||||
const Map *getMap() const {return ↦}
|
inline const Map *getMap() const {return ↦}
|
||||||
Map *getMapPtr() {return ↦}
|
inline Map *getMapPtr() {return ↦}
|
||||||
|
|
||||||
const Tileset *getTileset() const {return &tileset;}
|
inline const Tileset *getTileset() const {return &tileset;}
|
||||||
const TechTree *getTechTree() const {return techTree;}
|
inline const TechTree *getTechTree() const {return techTree;}
|
||||||
const Scenario *getScenario() const {return &scenario;}
|
inline const Scenario *getScenario() const {return &scenario;}
|
||||||
const TimeFlow *getTimeFlow() const {return &timeFlow;}
|
inline const TimeFlow *getTimeFlow() const {return &timeFlow;}
|
||||||
Tileset *getTileset() {return &tileset;}
|
inline Tileset *getTileset() {return &tileset;}
|
||||||
Map *getMap() {return ↦}
|
inline Map *getMap() {return ↦}
|
||||||
Cartographer* getCartographer() {return cartographer;}
|
Cartographer* getCartographer() {return cartographer;}
|
||||||
RoutePlanner* getRoutePlanner() {return routePlanner;}
|
RoutePlanner* getRoutePlanner() {return routePlanner;}
|
||||||
const Faction *getFaction(int i) const {return factions[i];}
|
inline const Faction *getFaction(int i) const {return factions[i];}
|
||||||
Faction *getFaction(int i) {return factions[i];}
|
inline Faction *getFaction(int i) {return factions[i];}
|
||||||
const Minimap *getMinimap() const {return &minimap;}
|
inline const Minimap *getMinimap() const {return &minimap;}
|
||||||
Minimap *getMiniMapObject() {return &minimap;}
|
inline Minimap *getMiniMapObject() {return &minimap;}
|
||||||
const Stats *getStats() const {return &stats;};
|
inline const Stats *getStats() const {return &stats;};
|
||||||
Stats *getStats() {return &stats;};
|
inline Stats *getStats() {return &stats;};
|
||||||
const WaterEffects *getWaterEffects() const {return &waterEffects;}
|
inline const WaterEffects *getWaterEffects() const {return &waterEffects;}
|
||||||
const WaterEffects *getAttackEffects() const {return &attackEffects;}
|
inline const WaterEffects *getAttackEffects() const {return &attackEffects;}
|
||||||
int getNextUnitId(Faction *faction);
|
int getNextUnitId(Faction *faction);
|
||||||
int getNextCommandGroupId();
|
int getNextCommandGroupId();
|
||||||
int getFrameCount() const {return frameCount;}
|
inline int getFrameCount() const {return frameCount;}
|
||||||
|
|
||||||
//init & load
|
//init & load
|
||||||
void init(Game *game, bool createUnits, bool initFactions=true);
|
void init(Game *game, bool createUnits, bool initFactions=true);
|
||||||
@@ -201,8 +201,8 @@ public:
|
|||||||
Checksum loadMap(const string &path, Checksum* checksum);
|
Checksum loadMap(const string &path, Checksum* checksum);
|
||||||
Checksum loadScenario(const string &path, Checksum* checksum,bool resetCurrentScenario=false,const XmlNode *rootNode=NULL);
|
Checksum loadScenario(const string &path, Checksum* checksum,bool resetCurrentScenario=false,const XmlNode *rootNode=NULL);
|
||||||
void setQueuedScenario(string scenarioName,bool keepFactions);
|
void setQueuedScenario(string scenarioName,bool keepFactions);
|
||||||
string getQueuedScenario() const { return queuedScenarioName; }
|
inline string getQueuedScenario() const { return queuedScenarioName; }
|
||||||
bool getQueuedScenarioKeepFactions() const { return queuedScenarioKeepFactions; }
|
inline bool getQueuedScenarioKeepFactions() const { return queuedScenarioKeepFactions; }
|
||||||
void initUnitsForScenario();
|
void initUnitsForScenario();
|
||||||
|
|
||||||
//misc
|
//misc
|
||||||
@@ -249,7 +249,7 @@ public:
|
|||||||
const string getSystemMacroValue(const string key);
|
const string getSystemMacroValue(const string key);
|
||||||
const string getPlayerName(int factionIndex);
|
const string getPlayerName(int factionIndex);
|
||||||
|
|
||||||
Game * getGame() { return game; }
|
inline Game * getGame() { return game; }
|
||||||
const GameSettings * getGameSettings() const;
|
const GameSettings * getGameSettings() const;
|
||||||
|
|
||||||
GameSettings * getGameSettingsPtr();
|
GameSettings * getGameSettingsPtr();
|
||||||
@@ -266,7 +266,7 @@ public:
|
|||||||
void exploreCells(const Vec2i &newPos, int sightRange, int teamIndex);
|
void exploreCells(const Vec2i &newPos, int sightRange, int teamIndex);
|
||||||
bool showWorldForPlayer(int factionIndex) const;
|
bool showWorldForPlayer(int factionIndex) const;
|
||||||
|
|
||||||
UnitUpdater * getUnitUpdater() { return &unitUpdater; }
|
inline UnitUpdater * getUnitUpdater() { return &unitUpdater; }
|
||||||
|
|
||||||
void removeResourceTargetFromCache(const Vec2i &pos);
|
void removeResourceTargetFromCache(const Vec2i &pos);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user