Define ToString methods on the main models
This commit is contained in:
parent
9e1782c401
commit
70b004edab
|
@ -41,6 +41,13 @@ public class Location
|
|||
this.AdjacentList = new List<Location>();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name == null
|
||||
? $"{this.Province.Name} ({this.Type})"
|
||||
: $"{this.Province.Name} ({this.Type}:{this.Name}]";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set another location as bordering this location.
|
||||
/// </summary>
|
||||
|
|
|
@ -14,4 +14,9 @@ public class Power
|
|||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,11 @@ public class Province
|
|||
this.LocationList = new List<Location>();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new province with no supply center.
|
||||
/// </summary>
|
||||
|
|
|
@ -64,6 +64,11 @@ public class Season
|
|||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{this.Turn}:{this.Timeline}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a root season at the beginning of time.
|
||||
/// </summary>
|
||||
|
|
|
@ -39,6 +39,11 @@ public class Unit
|
|||
this.Type = type;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{this.Power} {this.Type} {this.Location.Province} {this.Season}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new unit. No validation is performed; the adjudicator should only call this
|
||||
/// method after accepting a build order.
|
||||
|
|
Loading…
Reference in New Issue