2022-02-19 00:58:16 +00:00
|
|
|
using MultiversalDiplomacy.Model;
|
|
|
|
|
|
|
|
namespace MultiversalDiplomacy.Orders;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// An order for a unit to support another unit's move order.
|
|
|
|
/// </summary>
|
2022-03-22 19:57:01 +00:00
|
|
|
public class SupportMoveOrder : SupportOrder
|
2022-02-19 00:58:16 +00:00
|
|
|
{
|
|
|
|
/// <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; }
|
|
|
|
|
|
|
|
public SupportMoveOrder(Power power, Unit unit, Unit target, Season season, Location location)
|
2022-03-22 19:57:01 +00:00
|
|
|
: base(power, unit, target)
|
2022-02-19 00:58:16 +00:00
|
|
|
{
|
|
|
|
this.Season = season;
|
|
|
|
this.Location = location;
|
|
|
|
}
|
2022-03-24 15:12:11 +00:00
|
|
|
|
|
|
|
public bool IsSupportFor(MoveOrder move)
|
|
|
|
=> this.Target == move.Unit
|
|
|
|
&& this.Season == move.Season
|
|
|
|
&& this.Location == move.Location;
|
2022-02-19 00:58:16 +00:00
|
|
|
}
|