diff options
author | Aki <please@ignore.pl> | 2022-05-20 23:41:54 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-05-20 23:41:54 +0200 |
commit | 0e0358af887336d3466ac408e0404fbc806611f0 (patch) | |
tree | 8dc457d80099c9ca7e53bf7e695f5df6592cef40 | |
parent | f233014e960a412d3c5d4ba0015f09aa620fe567 (diff) | |
download | derelict-0e0358af887336d3466ac408e0404fbc806611f0.zip derelict-0e0358af887336d3466ac408e0404fbc806611f0.tar.gz derelict-0e0358af887336d3466ac408e0404fbc806611f0.tar.bz2 |
Flattened Killmail representation a bit
-rw-r--r-- | DumpSource.cpp | 6 | ||||
-rw-r--r-- | Killmail.h | 8 | ||||
-rw-r--r-- | Location.h | 9 | ||||
-rw-r--r-- | Owner.h | 8 | ||||
-rw-r--r-- | Ship.h | 8 |
5 files changed, 13 insertions, 26 deletions
diff --git a/DumpSource.cpp b/DumpSource.cpp index f20ce0f..b80be2f 100644 --- a/DumpSource.cpp +++ b/DumpSource.cpp @@ -53,6 +53,12 @@ from_json(const json& j, tm& d) void from_json(const json& j, Killmail& km) { + j.at("solar_system_id").get_to(km.location); + j.at("victim").at("ship_type_id").get_to(km.ship); j.at("victim").at("position").get_to(km.position); + j.at("victim").at("character_id").get_to(km.owner.character); + j.at("victim").at("corporation_id").get_to(km.owner.corporation); + j.at("victim").at("alliance_id").get_to(km.owner.alliance); + j.at("victim").at("faction_id").get_to(km.owner.faction); j.at("killmail_time").get_to(km.time); } @@ -2,17 +2,15 @@ #include <ctime> -#include "Location.h" #include "LongVector3.h" #include "Owner.h" -#include "Ship.h" struct Killmail { - Location location; - Owner owner; - Ship ship; + long int location; + long int ship; LongVector3 position; + Owner owner; std::tm time; }; diff --git a/Location.h b/Location.h deleted file mode 100644 index dbbb27b..0000000 --- a/Location.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - - -struct Location -{ - const char* system; - const char* constellation; - const char* region; -}; @@ -3,8 +3,8 @@ struct Owner { - const char* character; - const char* corporation; - const char* alliance; - const char* faction; + long int character; + long int corporation; + long int alliance; + long int faction; }; @@ -1,8 +0,0 @@ -#pragma once - - -struct Ship -{ - const char* name; - const char* icon; -}; |