Purge Newtonsoft state annotations
This commit is contained in:
parent
639e701d63
commit
b0d2aa1156
92 changed files with 891 additions and 1684 deletions
|
|
@ -1,31 +1,27 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* 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;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using JsonKnownTypes;
|
||||
using MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
[MessagePackObject,
|
||||
[MessagePackObject,
|
||||
Union(0, typeof(StationTowing)),
|
||||
Union(1, typeof(Mining)),
|
||||
Union(2, typeof(Survey)),
|
||||
Union(3, typeof(HaulingTask)),
|
||||
JsonObject(MemberSerialization.OptIn), JsonConverter(typeof(JsonKnownTypesConverter<DatabaseEntry>))]
|
||||
Union(3, typeof(HaulingTask))]
|
||||
public abstract class AgentTask : DatabaseEntry
|
||||
{
|
||||
[JsonProperty("priority"), Key(1)]
|
||||
[Key(1)]
|
||||
public int Priority;
|
||||
|
||||
[JsonProperty("zone"), Key(2)]
|
||||
|
||||
[Key(2)]
|
||||
public Guid Zone;
|
||||
|
||||
[JsonProperty("reserved"), Key(3)]
|
||||
|
||||
[Key(3)]
|
||||
public bool Reserved;
|
||||
|
||||
|
||||
[IgnoreMember] public abstract TaskType Type { get; }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* 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/. */
|
||||
|
||||
|
|
@ -6,21 +6,19 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class HaulingTask : AgentTask
|
||||
{
|
||||
public override TaskType Type => TaskType.Haul;
|
||||
|
||||
[JsonProperty("origin"), Key(4)]
|
||||
|
||||
[Key(4)]
|
||||
public Entity Origin;
|
||||
|
||||
[JsonProperty("target"), Key(5)]
|
||||
|
||||
[Key(5)]
|
||||
public Entity Target;
|
||||
|
||||
[JsonProperty("itemType"), Key(6)]
|
||||
|
||||
[Key(6)]
|
||||
public Guid ItemType;
|
||||
|
||||
[JsonProperty("quantity"), Key(7)]
|
||||
|
||||
[Key(7)]
|
||||
public int Quantity;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,16 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* 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;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using JsonKnownTypes;
|
||||
using MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
[MessagePackObject,
|
||||
JsonObject(MemberSerialization.OptIn), JsonConverter(typeof(JsonKnownTypesConverter<DatabaseEntry>))]
|
||||
[MessagePackObject]
|
||||
public class Mining : AgentTask
|
||||
{
|
||||
[IgnoreMember] public override TaskType Type => TaskType.Mine;
|
||||
|
||||
[JsonProperty("asteroids"), Key(4)]
|
||||
|
||||
[Key(4)]
|
||||
public Guid Asteroids;
|
||||
}
|
||||
|
|
@ -1,26 +1,22 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* 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;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using JsonKnownTypes;
|
||||
using MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
[MessagePackObject,
|
||||
JsonObject(MemberSerialization.OptIn), JsonConverter(typeof(JsonKnownTypesConverter<DatabaseEntry>))]
|
||||
[MessagePackObject]
|
||||
public class StationTowing : AgentTask
|
||||
{
|
||||
[IgnoreMember] public override TaskType Type => TaskType.Tow;
|
||||
|
||||
[JsonProperty("station"), Key(4)]
|
||||
|
||||
[Key(4)]
|
||||
public OrbitalEntity Station;
|
||||
|
||||
[JsonProperty("orbitParent"), Key(5)]
|
||||
|
||||
[Key(5)]
|
||||
public Guid OrbitParent;
|
||||
|
||||
[JsonProperty("orbitDistance"), Key(6)]
|
||||
|
||||
[Key(6)]
|
||||
public float OrbitDistance;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,16 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* 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;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using JsonKnownTypes;
|
||||
using MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
[MessagePackObject,
|
||||
JsonObject(MemberSerialization.OptIn), JsonConverter(typeof(JsonKnownTypesConverter<DatabaseEntry>))]
|
||||
[MessagePackObject]
|
||||
public class Survey : AgentTask
|
||||
{
|
||||
[IgnoreMember] public override TaskType Type => TaskType.Explore;
|
||||
|
||||
[JsonProperty("station"), Key(4)]
|
||||
|
||||
[Key(4)]
|
||||
public List<Guid> Planets;
|
||||
}
|
||||
Loading…
Reference in a new issue