Refactor Support*Order to inherit from abstract SupportOrder
This commit is contained in:
parent
70b004edab
commit
be3f6a527f
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue