32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
using MultiversalDiplomacy.Model;
|
|
|
|
namespace MultiversalDiplomacy.Orders;
|
|
|
|
/// <summary>
|
|
/// A submitted action by a power.
|
|
/// </summary>
|
|
[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
|
|
[JsonDerivedType(typeof(BuildOrder), typeDiscriminator: "move")]
|
|
[JsonDerivedType(typeof(ConvoyOrder), typeDiscriminator: "convoy")]
|
|
[JsonDerivedType(typeof(DisbandOrder), typeDiscriminator: "disband")]
|
|
[JsonDerivedType(typeof(HoldOrder), typeDiscriminator: "hold")]
|
|
[JsonDerivedType(typeof(MoveOrder), typeDiscriminator: "move")]
|
|
[JsonDerivedType(typeof(RetreatOrder), typeDiscriminator: "retreat")]
|
|
[JsonDerivedType(typeof(SupportHoldOrder), typeDiscriminator: "supportHold")]
|
|
[JsonDerivedType(typeof(SupportMoveOrder), typeDiscriminator: "supportMove")]
|
|
[JsonDerivedType(typeof(SustainOrder), typeDiscriminator: "sustain")]
|
|
public abstract class Order
|
|
{
|
|
/// <summary>
|
|
/// The power that submitted this order.
|
|
/// </summary>
|
|
public Power Power { get; }
|
|
|
|
public Order(Power power)
|
|
{
|
|
this.Power = power;
|
|
}
|
|
}
|