2020-12-22 03:13:43 +00:00
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
2020-03-22 19:05:26 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using JsonKnownTypes;
|
|
|
|
|
|
using MessagePack;
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
// TODO: USE THIS EVERYWHERE
|
|
|
|
|
|
using Unity.Mathematics;
|
|
|
|
|
|
using static Unity.Mathematics.math;
|
|
|
|
|
|
|
|
|
|
|
|
public interface INamedEntry
|
|
|
|
|
|
{
|
|
|
|
|
|
string EntryName { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-09 07:48:45 +01:00
|
|
|
|
[InspectableField,
|
|
|
|
|
|
MessagePackObject,
|
|
|
|
|
|
Union(0, typeof(SimpleCommodityData)),
|
|
|
|
|
|
Union(1, typeof(CompoundCommodityData)),
|
|
|
|
|
|
Union(2, typeof(GearData)),
|
|
|
|
|
|
Union(3, typeof(HullData)),
|
2020-04-23 03:31:17 +01:00
|
|
|
|
Union(4, typeof(SimpleCommodity)),
|
|
|
|
|
|
Union(5, typeof(CompoundCommodity)),
|
2020-12-10 23:20:38 +00:00
|
|
|
|
Union(6, typeof(EquippableItem)),
|
2020-04-23 03:31:17 +01:00
|
|
|
|
Union(7, typeof(BlueprintData)),
|
|
|
|
|
|
Union(8, typeof(GalaxyMapLayerData)),
|
2021-03-15 11:40:46 +00:00
|
|
|
|
Union(9, typeof(NameFile)),
|
|
|
|
|
|
//Union(10, typeof(ZoneData)),
|
2020-06-11 02:55:11 +01:00
|
|
|
|
Union(11, typeof(PlayerData)),
|
2020-04-09 07:48:45 +01:00
|
|
|
|
Union(12, typeof(Corporation)),
|
2020-05-10 00:16:33 +01:00
|
|
|
|
Union(13, typeof(MegaCorporation)),
|
2020-06-01 03:11:04 +01:00
|
|
|
|
Union(14, typeof(OrbitalEntity)),
|
2020-04-09 07:48:45 +01:00
|
|
|
|
Union(15, typeof(OrbitData)),
|
2020-11-29 22:50:12 +00:00
|
|
|
|
Union(16, typeof(BodyData)),
|
2020-05-03 00:36:47 +01:00
|
|
|
|
Union(17, typeof(PersonalityAttribute)),
|
2020-05-07 03:53:54 +01:00
|
|
|
|
Union(18, typeof(AgentTask)),
|
2020-05-10 00:16:33 +01:00
|
|
|
|
Union(19, typeof(LoadoutData)),
|
2020-06-01 03:11:04 +01:00
|
|
|
|
Union(20, typeof(Ship)),
|
|
|
|
|
|
Union(21, typeof(Mining)),
|
|
|
|
|
|
Union(22, typeof(StationTowing)),
|
|
|
|
|
|
Union(23, typeof(Survey)),
|
2020-06-12 01:57:15 +01:00
|
|
|
|
Union(24, typeof(HaulingTask)),
|
2020-11-27 22:47:33 +00:00
|
|
|
|
Union(25, typeof(AsteroidBeltData)),
|
|
|
|
|
|
Union(26, typeof(GasGiantData)),
|
|
|
|
|
|
Union(27, typeof(SunData)),
|
2020-11-29 22:50:12 +00:00
|
|
|
|
Union(28, typeof(PlanetData)),
|
2020-12-18 13:48:03 +00:00
|
|
|
|
Union(29, typeof(CargoBayData)),
|
|
|
|
|
|
Union(30, typeof(DockingBayData)),
|
2020-04-09 07:48:45 +01:00
|
|
|
|
JsonObject(MemberSerialization.OptIn), JsonConverter(typeof(JsonKnownTypesConverter<DatabaseEntry>))]
|
2020-03-22 19:05:26 +00:00
|
|
|
|
//[Union(21, typeof(ContractData))]
|
|
|
|
|
|
//[Union(22, typeof(Station))]
|
|
|
|
|
|
public abstract class DatabaseEntry
|
|
|
|
|
|
{
|
2020-05-14 02:47:07 +01:00
|
|
|
|
[JsonProperty("id"), Key(0)]
|
|
|
|
|
|
public Guid ID = Guid.NewGuid();
|
2021-03-15 11:40:46 +00:00
|
|
|
|
|
|
|
|
|
|
[IgnoreMember]
|
|
|
|
|
|
public DatabaseCache Database;
|
2020-03-22 19:05:26 +00:00
|
|
|
|
}
|