Added back attack and movement functions, missionData is now part of units

This commit is contained in:
Pax1601
2023-01-17 22:17:20 +01:00
parent 280799b27a
commit b77f271183
18 changed files with 388 additions and 225 deletions

View File

@@ -13,7 +13,8 @@ public:
Unit(json::value json, int ID);
~Unit();
void update(json::value json);
void updateExportData(json::value json);
void updateMissionData(json::value json);
json::value json();
void setPath(list<Coords> path);
@@ -65,7 +66,6 @@ protected:
double heading = NULL;
double speed = NULL;
json::value flags = json::value::null();
Coords oldPosition = Coords(0); // Used to approximate speed
int targetID = NULL;
bool holding = false;
bool looping = false;
@@ -77,9 +77,13 @@ protected:
vector<Unit*> wingmen;
double targetSpeed = 0;
double targetAltitude = 0;
double fuel = 0;
json::value ammo;
json::value targets;
list<Coords> activePath;
Coords activeDestination = Coords(0);
Coords oldPosition = Coords(0); // Used to approximate speed
virtual void AIloop();

View File

@@ -11,8 +11,8 @@ public:
~UnitsFactory();
Unit* getUnit(int ID);
void getMissionDB(lua_State* L);
void update(lua_State* L);
void updateExportData(lua_State* L);
void updateMissionData(json::value missionData);
void updateAnswer(json::value& answer);
private: