2026-08-10 14:57:50 +01:00
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2020-12-22 03:13:43 +00:00
|
|
|
|
* 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/. */
|
|
|
|
|
|
|
2026-08-10 14:57:50 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using JsonKnownTypes;
|
|
|
|
|
|
using MessagePack;
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
|
|
[MessagePackObject,
|
|
|
|
|
|
Union(0, typeof(StationTowing)),
|
|
|
|
|
|
Union(1, typeof(Mining)),
|
|
|
|
|
|
Union(2, typeof(Survey)),
|
|
|
|
|
|
Union(3, typeof(HaulingTask)),
|
|
|
|
|
|
JsonObject(MemberSerialization.OptIn), JsonConverter(typeof(JsonKnownTypesConverter<DatabaseEntry>))]
|
|
|
|
|
|
public abstract class AgentTask : DatabaseEntry
|
2020-04-29 11:27:55 +01:00
|
|
|
|
{
|
2026-08-10 14:57:50 +01:00
|
|
|
|
[JsonProperty("priority"), Key(1)]
|
2020-05-07 03:53:54 +01:00
|
|
|
|
public int Priority;
|
2026-08-10 14:57:50 +01:00
|
|
|
|
|
|
|
|
|
|
[JsonProperty("zone"), Key(2)]
|
|
|
|
|
|
public Guid Zone;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonProperty("reserved"), Key(3)]
|
2020-05-07 03:53:54 +01:00
|
|
|
|
public bool Reserved;
|
2026-08-10 14:57:50 +01:00
|
|
|
|
|
|
|
|
|
|
[IgnoreMember] public abstract TaskType Type { get; }
|
2020-04-29 11:27:55 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-07 03:53:54 +01:00
|
|
|
|
public enum TaskType
|
2020-04-29 11:27:55 +01:00
|
|
|
|
{
|
2020-05-28 04:50:40 +01:00
|
|
|
|
None,
|
2020-04-29 11:27:55 +01:00
|
|
|
|
Mine,
|
|
|
|
|
|
Haul,
|
|
|
|
|
|
Tow,
|
|
|
|
|
|
Defend,
|
2020-04-29 23:36:00 +01:00
|
|
|
|
Attack,
|
|
|
|
|
|
Explore
|
2020-04-29 11:27:55 +01:00
|
|
|
|
}
|
2021-02-11 03:14:20 +00:00
|
|
|
|
|