2022-02-19 00:58:16 +00:00
|
|
|
using MultiversalDiplomacy.Model;
|
|
|
|
|
|
|
|
namespace MultiversalDiplomacy.Orders;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// An order to move another unit via convoy.
|
|
|
|
/// </summary>
|
|
|
|
public class ConvoyOrder : UnitOrder
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The unit to convoy.
|
|
|
|
/// </summary>
|
|
|
|
public Unit Target { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The destination season to which the target is moving.
|
|
|
|
/// </summary>
|
|
|
|
public Season Season { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The destination location to which the target is moving.
|
|
|
|
/// </summary>
|
|
|
|
public Location Location { get; }
|
|
|
|
|
2022-03-30 19:52:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The destination province to which the target is moving.
|
|
|
|
/// </summary>
|
|
|
|
public Province Province => this.Location.Province;
|
|
|
|
|
2024-08-15 14:30:43 +00:00
|
|
|
public ConvoyOrder(string power, Unit unit, Unit target, Season season, Location location)
|
2022-02-19 00:58:16 +00:00
|
|
|
: base (power, unit)
|
|
|
|
{
|
|
|
|
this.Target = target;
|
|
|
|
this.Season = season;
|
|
|
|
this.Location = location;
|
|
|
|
}
|
2022-04-07 22:58:17 +00:00
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
{
|
2022-11-04 00:32:39 +00:00
|
|
|
return $"{this.Unit} C {this.Target} -> {(this.Province, this.Season).ToShort()}";
|
2022-04-07 22:58:17 +00:00
|
|
|
}
|
2022-02-19 00:58:16 +00:00
|
|
|
}
|