Add ToString overrides for orders
This commit is contained in:
parent
5e74ffc19f
commit
105c372779
@ -34,4 +34,9 @@ public class ConvoyOrder : UnitOrder
|
||||
this.Season = season;
|
||||
this.Location = location;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{this.Unit} convoys {this.Target} -> {this.Province} {this.Season}";
|
||||
}
|
||||
}
|
||||
|
@ -9,4 +9,9 @@ public class HoldOrder : UnitOrder
|
||||
{
|
||||
public HoldOrder(Power power, Unit unit)
|
||||
: base (power, unit) {}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{this.Unit} holds";
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,11 @@ public class MoveOrder : UnitOrder
|
||||
this.Location = location;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{this.Unit} -> {this.Province} {this.Season}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether another move order is in a head-to-head battle with this order.
|
||||
/// </summary>
|
||||
|
@ -11,4 +11,9 @@ public class SupportHoldOrder : SupportOrder
|
||||
: base (power, unit, target)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{this.Unit} supports {this.Target}";
|
||||
}
|
||||
}
|
@ -34,6 +34,11 @@ public class SupportMoveOrder : SupportOrder
|
||||
this.Location = location;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{this.Unit} supports {this.Target} -> {this.Province} {this.Season}";
|
||||
}
|
||||
|
||||
public bool IsSupportFor(MoveOrder move)
|
||||
=> this.Target == move.Unit
|
||||
&& this.Season == move.Season
|
||||
|
Loading…
Reference in New Issue
Block a user