mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Completed advanced controls also for units
This commit is contained in:
@@ -97,14 +97,15 @@ protected:
|
||||
class Move : public Command
|
||||
{
|
||||
public:
|
||||
Move(int ID, Coords destination, double speed, wstring speedType, double altitude, wstring altitudeType, wstring taskOptions):
|
||||
ID(ID),
|
||||
Move(wstring groupName, Coords destination, double speed, wstring speedType, double altitude, wstring altitudeType, wstring taskOptions, wstring category):
|
||||
groupName(groupName),
|
||||
destination(destination),
|
||||
speed(speed),
|
||||
speedType(speedType),
|
||||
altitude(altitude),
|
||||
altitudeType(altitudeType),
|
||||
taskOptions(taskOptions)
|
||||
taskOptions(taskOptions),
|
||||
category(category)
|
||||
{
|
||||
priority = CommandPriority::HIGH;
|
||||
};
|
||||
@@ -112,13 +113,14 @@ public:
|
||||
virtual int getLoad() { return 5; }
|
||||
|
||||
private:
|
||||
const int ID;
|
||||
const wstring groupName;
|
||||
const Coords destination;
|
||||
const double speed;
|
||||
const wstring speedType;
|
||||
const double altitude;
|
||||
const wstring altitudeType;
|
||||
const wstring taskOptions;
|
||||
const wstring category;
|
||||
};
|
||||
|
||||
/* Smoke command */
|
||||
@@ -223,8 +225,8 @@ private:
|
||||
class SetTask : public Command
|
||||
{
|
||||
public:
|
||||
SetTask(int ID, wstring task) :
|
||||
ID(ID),
|
||||
SetTask(wstring groupName, wstring task) :
|
||||
groupName(groupName),
|
||||
task(task)
|
||||
{
|
||||
priority = CommandPriority::MEDIUM;
|
||||
@@ -233,7 +235,7 @@ public:
|
||||
virtual int getLoad() { return 10; }
|
||||
|
||||
private:
|
||||
const int ID;
|
||||
const wstring groupName;
|
||||
const wstring task;
|
||||
};
|
||||
|
||||
@@ -241,8 +243,8 @@ private:
|
||||
class ResetTask : public Command
|
||||
{
|
||||
public:
|
||||
ResetTask(int ID) :
|
||||
ID(ID)
|
||||
ResetTask(wstring groupName) :
|
||||
groupName(groupName)
|
||||
{
|
||||
priority = CommandPriority::HIGH;
|
||||
};
|
||||
@@ -250,15 +252,15 @@ public:
|
||||
virtual int getLoad() { return 10; }
|
||||
|
||||
private:
|
||||
const int ID;
|
||||
const wstring groupName;
|
||||
};
|
||||
|
||||
/* Set command */
|
||||
class SetCommand : public Command
|
||||
{
|
||||
public:
|
||||
SetCommand(int ID, wstring command) :
|
||||
ID(ID),
|
||||
SetCommand(wstring groupName, wstring command) :
|
||||
groupName(groupName),
|
||||
command(command)
|
||||
{
|
||||
priority = CommandPriority::HIGH;
|
||||
@@ -267,7 +269,7 @@ public:
|
||||
virtual int getLoad() { return 10; }
|
||||
|
||||
private:
|
||||
const int ID;
|
||||
const wstring groupName;
|
||||
const wstring command;
|
||||
};
|
||||
|
||||
@@ -275,8 +277,8 @@ private:
|
||||
class SetOption : public Command
|
||||
{
|
||||
public:
|
||||
SetOption(int ID, int optionID, int optionValue) :
|
||||
ID(ID),
|
||||
SetOption(wstring groupName, int optionID, int optionValue) :
|
||||
groupName(groupName),
|
||||
optionID(optionID),
|
||||
optionValue(optionValue),
|
||||
optionBool(false),
|
||||
@@ -285,8 +287,8 @@ public:
|
||||
priority = CommandPriority::HIGH;
|
||||
};
|
||||
|
||||
SetOption(int ID, int optionID, bool optionBool) :
|
||||
ID(ID),
|
||||
SetOption(wstring groupName, int optionID, bool optionBool) :
|
||||
groupName(groupName),
|
||||
optionID(optionID),
|
||||
optionValue(0),
|
||||
optionBool(optionBool),
|
||||
@@ -298,7 +300,7 @@ public:
|
||||
virtual int getLoad() { return 10; }
|
||||
|
||||
private:
|
||||
const int ID;
|
||||
const wstring groupName;
|
||||
const int optionID;
|
||||
const int optionValue;
|
||||
const bool optionBool;
|
||||
@@ -309,8 +311,8 @@ private:
|
||||
class SetOnOff : public Command
|
||||
{
|
||||
public:
|
||||
SetOnOff(int ID, bool onOff) :
|
||||
ID(ID),
|
||||
SetOnOff(wstring groupName, bool onOff) :
|
||||
groupName(groupName),
|
||||
onOff(onOff)
|
||||
{
|
||||
priority = CommandPriority::HIGH;
|
||||
@@ -319,7 +321,7 @@ public:
|
||||
virtual int getLoad() { return 10; }
|
||||
|
||||
private:
|
||||
const int ID;
|
||||
const wstring groupName;
|
||||
const bool onOff;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "measure.h"
|
||||
#include "logger.h"
|
||||
|
||||
#define TASK_CHECK_INIT_VALUE 10
|
||||
|
||||
namespace State
|
||||
{
|
||||
enum States
|
||||
@@ -63,7 +65,7 @@ public:
|
||||
int getID() { return ID; }
|
||||
void updateExportData(json::value json);
|
||||
void updateMissionData(json::value json);
|
||||
json::value getData(long long time);
|
||||
json::value getData(long long time, bool getAll = false);
|
||||
virtual wstring getCategory() { return L"No category"; };
|
||||
|
||||
/********** Base data **********/
|
||||
@@ -100,7 +102,7 @@ public:
|
||||
void setFuel(double newFuel) { fuel = newFuel; addMeasure(L"fuel", json::value(newFuel));}
|
||||
void setAmmo(json::value newAmmo) { ammo = newAmmo; addMeasure(L"ammo", json::value(newAmmo));}
|
||||
void setTargets(json::value newTargets) {targets = newTargets; addMeasure(L"targets", json::value(newTargets));}
|
||||
void setHasTask(bool newHasTask) { hasTask = newHasTask; addMeasure(L"hasTask", json::value(newHasTask)); }
|
||||
void setHasTask(bool newHasTask);
|
||||
void setCoalitionID(int newCoalitionID);
|
||||
void setFlags(json::value newFlags) { flags = newFlags; addMeasure(L"flags", json::value(newFlags));}
|
||||
|
||||
@@ -181,6 +183,7 @@ protected:
|
||||
int ID;
|
||||
|
||||
map<wstring, Measure*> measures;
|
||||
int taskCheckCounter = 0;
|
||||
|
||||
/********** Base data **********/
|
||||
bool AI = false;
|
||||
@@ -252,4 +255,6 @@ protected:
|
||||
bool setActiveDestination();
|
||||
bool updateActivePath(bool looping);
|
||||
void goToDestination(wstring enrouteTask = L"nil");
|
||||
bool checkTaskFailed();
|
||||
void resetTaskFailedCounter();
|
||||
};
|
||||
|
||||
@@ -11,6 +11,11 @@ public:
|
||||
~UnitsManager();
|
||||
|
||||
Unit* getUnit(int ID);
|
||||
bool isUnitInGroup(Unit* unit);
|
||||
bool isUnitGroupLeader(Unit* unit);
|
||||
Unit* getGroupLeader(int ID);
|
||||
Unit* getGroupLeader(Unit* unit);
|
||||
vector<Unit*> getGroupMembers(wstring groupName);
|
||||
void updateExportData(lua_State* L);
|
||||
void updateMissionData(json::value missionData);
|
||||
void getData(json::value& answer, long long time);
|
||||
|
||||
Reference in New Issue
Block a user