mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added advanced effects
This commit is contained in:
@@ -410,10 +410,11 @@ private:
|
||||
class Explosion : public Command
|
||||
{
|
||||
public:
|
||||
Explosion(unsigned int intensity, Coords location, function<void(void)> callback = [](){}) :
|
||||
Explosion(unsigned int intensity, string explosionType, Coords location, function<void(void)> callback = [](){}) :
|
||||
Command(callback),
|
||||
location(location),
|
||||
intensity(intensity)
|
||||
intensity(intensity),
|
||||
explosionType(explosionType)
|
||||
{
|
||||
priority = CommandPriority::MEDIUM;
|
||||
};
|
||||
@@ -423,4 +424,5 @@ public:
|
||||
private:
|
||||
const Coords location;
|
||||
const unsigned int intensity;
|
||||
const string explosionType;
|
||||
};
|
||||
|
||||
@@ -244,6 +244,7 @@ string Explosion::getString()
|
||||
commandSS.precision(10);
|
||||
commandSS << "Olympus.explosion, "
|
||||
<< intensity << ", "
|
||||
<< "\"" << explosionType << "\"" << ", "
|
||||
<< location.lat << ", "
|
||||
<< location.lng;
|
||||
return commandSS.str();
|
||||
|
||||
@@ -498,11 +498,12 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
|
||||
else if (key.compare("explosion") == 0)
|
||||
{
|
||||
unsigned int intensity = value[L"intensity"].as_integer();
|
||||
string explosionType = to_string(value[L"explosionType"]);
|
||||
double lat = value[L"location"][L"lat"].as_double();
|
||||
double lng = value[L"location"][L"lng"].as_double();
|
||||
log("Adding " + to_string(intensity) + " explosion at (" + to_string(lat) + ", " + to_string(lng) + ")");
|
||||
log("Adding explosion of type " + explosionType + " at (" + to_string(lat) + ", " + to_string(lng) + ")");
|
||||
Coords loc; loc.lat = lat; loc.lng = lng;
|
||||
command = dynamic_cast<Command*>(new Explosion(intensity, loc));
|
||||
command = dynamic_cast<Command*>(new Explosion(intensity, explosionType, loc));
|
||||
}
|
||||
/************************/
|
||||
else if (key.compare("bombPoint") == 0)
|
||||
|
||||
Reference in New Issue
Block a user