Refactor Support*Order to inherit from abstract SupportOrder

This commit is contained in:
Jaculabilis 2022-03-22 12:57:01 -07:00
parent 70b004edab
commit be3f6a527f
3 changed files with 24 additions and 16 deletions

View File

@ -5,16 +5,10 @@ namespace MultiversalDiplomacy.Orders;
/// <summary>
/// An order for a unit to support another unit's hold order.
/// </summary>
public class SupportHoldOrder : UnitOrder
public class SupportHoldOrder : SupportOrder
{
/// <summary>
/// The unit to support.
/// </summary>
public Unit Target { get; }
public SupportHoldOrder(Power power, Unit unit, Unit target)
: base (power, unit)
: base (power, unit, target)
{
this.Target = target;
}
}

View File

@ -5,13 +5,8 @@ namespace MultiversalDiplomacy.Orders;
/// <summary>
/// An order for a unit to support another unit's move order.
/// </summary>
public class SupportMoveOrder : UnitOrder
public class SupportMoveOrder : SupportOrder
{
/// <summary>
/// The unit to support.
/// </summary>
public Unit Target { get; }
/// <summary>
/// The destination season to which the target is moving.
/// </summary>
@ -23,9 +18,8 @@ public class SupportMoveOrder : UnitOrder
public Location Location { get; }
public SupportMoveOrder(Power power, Unit unit, Unit target, Season season, Location location)
: base (power, unit)
: base(power, unit, target)
{
this.Target = target;
this.Season = season;
this.Location = location;
}

View File

@ -0,0 +1,20 @@
using MultiversalDiplomacy.Model;
namespace MultiversalDiplomacy.Orders;
/// <summary>
/// An order for a unit to support another unit.
/// </summary>
public abstract class SupportOrder : UnitOrder
{
/// <summary>
/// The unit to support.
/// </summary>
public Unit Target { get; }
public SupportOrder(Power power, Unit unit, Unit target)
: base (power, unit)
{
this.Target = target;
}
}