Implemented LightFX game model

This commit is contained in:
SpoinkyNL committed 2016-12-22 17:53:07 +01:00
1 parent f0b0df28b3
commit a043068033
6 files changed
+69 -16

No files matched your search

+3 -6
View File
@@ -20,14 +20,11 @@ LightFxState::~LightFxState()
json LightFxState::GetJson()
{
json root;
json j;
root["lightFxState"] = { j };
j["game"] = Game;
j["mask"] = {
{ "location", LocationMask },
{ "light", LocationMaskLight->GetJson() }
{"location", LocationMask},
{"light", LocationMaskLight->GetJson()}
};
j["devices"] = {};
for (LightFxDevice* device : Devices)
@@ -35,5 +32,5 @@ json LightFxState::GetJson()
j["devices"].push_back(device->GetJson());
}
return j;
return json{{"lightFxState", j}};
}
+2 -2
View File
@@ -80,8 +80,8 @@ FN_DECLSPEC LFX_RESULT STDCALL LFX_Update()
Transmit(j.dump().c_str());
// Only bother dumping it indented if actually debugging
if (FILELog::ReportingLevel() == logDEBUG1)
FILE_LOG(logDEBUG1) << "JSON: " << j.dump(4);
if (FILELog::ReportingLevel() == logDEBUG1)
FILE_LOG(logDEBUG1) << "JSON: " << j.dump(4);
return LFX_SUCCESS;
}