From 0e0358af887336d3466ac408e0404fbc806611f0 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 20 May 2022 23:41:54 +0200 Subject: Flattened Killmail representation a bit --- DumpSource.cpp | 6 ++++++ Killmail.h | 8 +++----- Location.h | 9 --------- Owner.h | 8 ++++---- Ship.h | 8 -------- 5 files changed, 13 insertions(+), 26 deletions(-) delete mode 100644 Location.h delete mode 100644 Ship.h 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); } diff --git a/Killmail.h b/Killmail.h index 23db3c6..047eb68 100644 --- a/Killmail.h +++ b/Killmail.h @@ -2,17 +2,15 @@ #include -#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; -}; diff --git a/Owner.h b/Owner.h index b311f80..ac615f7 100644 --- a/Owner.h +++ b/Owner.h @@ -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; }; diff --git a/Ship.h b/Ship.h deleted file mode 100644 index 2ca6883..0000000 --- a/Ship.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - - -struct Ship -{ - const char* name; - const char* icon; -}; -- cgit v1.1