Added backend for advanced commands

This commit is contained in:
Pax1601
2023-06-06 17:27:11 +02:00
parent ab3a017b55
commit fd00cffa15
10 changed files with 217 additions and 9 deletions

View File

@@ -305,7 +305,7 @@ private:
const bool isBoolean;
};
/* Set on ooff */
/* Set on off */
class SetOnOff : public Command
{
public:
@@ -322,3 +322,21 @@ private:
const int ID;
const bool onOff;
};
/* Make a ground explosion */
class Explosion : public Command
{
public:
Explosion(int intensity, Coords location) :
location(location),
intensity(intensity)
{
priority = CommandPriority::MEDIUM;
};
virtual wstring getString(lua_State* L);
virtual int getLoad() { return 10; }
private:
const Coords location;
const int intensity;
};

View File

@@ -18,7 +18,11 @@ namespace State
LAND,
REFUEL,
AWACS,
TANKER
TANKER,
BOMB_POINT,
CARPET_BOMB,
BOMB_BUILDING,
FIRE_AT_AREA
};
};
@@ -124,6 +128,7 @@ public:
void setActiveDestination(Coords newActiveDestination) { activeDestination = newActiveDestination; addMeasure(L"activeDestination", json::value("")); } // TODO fix
void setActivePath(list<Coords> newActivePath);
void setTargetID(int newTargetID) { targetID = newTargetID; addMeasure(L"targetID", json::value(newTargetID));}
void setTargetLocation(Coords newTargetLocation);
void setIsTanker(bool newIsTanker);
void setIsAWACS(bool newIsAWACS);
virtual void setOnOff(bool newOnOff) { onOff = newOnOff; addMeasure(L"onOff", json::value(newOnOff));};
@@ -137,6 +142,7 @@ public:
Coords getActiveDestination() { return activeDestination; }
list<Coords> getActivePath() { return activePath; }
int getTargetID() { return targetID; }
Coords getTargetLocation() { return targetLocation; }
bool getIsTanker() { return isTanker; }
bool getIsAWACS() { return isAWACS; }
bool getOnOff() { return onOff; };
@@ -212,8 +218,9 @@ protected:
wstring targetSpeedType = L"GS";
wstring targetAltitudeType = L"AGL";
list<Coords> activePath;
Coords activeDestination = Coords(0);
Coords activeDestination = Coords(NULL);
int targetID = NULL;
Coords targetLocation = Coords(NULL);
bool isTanker = false;
bool isAWACS = false;
bool onOff = true;