summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-05-20 23:41:54 +0200
committerAki <please@ignore.pl>2022-05-20 23:41:54 +0200
commit0e0358af887336d3466ac408e0404fbc806611f0 (patch)
tree8dc457d80099c9ca7e53bf7e695f5df6592cef40
parentf233014e960a412d3c5d4ba0015f09aa620fe567 (diff)
downloadderelict-0e0358af887336d3466ac408e0404fbc806611f0.zip
derelict-0e0358af887336d3466ac408e0404fbc806611f0.tar.gz
derelict-0e0358af887336d3466ac408e0404fbc806611f0.tar.bz2
Flattened Killmail representation a bit
-rw-r--r--DumpSource.cpp6
-rw-r--r--Killmail.h8
-rw-r--r--Location.h9
-rw-r--r--Owner.h8
-rw-r--r--Ship.h8
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);
}
diff --git a/Killmail.h b/Killmail.h
index 23db3c6..047eb68 100644
--- a/Killmail.h
+++ b/Killmail.h
@@ -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;
-};
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;
-};