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>();
|
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>
|
/// <summary>
|
||||||
/// Set another location as bordering this location.
|
/// Set another location as bordering this location.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -14,4 +14,9 @@ public class Power
|
||||||
{
|
{
|
||||||
this.Name = name;
|
this.Name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return this.Name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,11 @@ public class Province
|
||||||
this.LocationList = new List<Location>();
|
this.LocationList = new List<Location>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return this.Name;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new province with no supply center.
|
/// Create a new province with no supply center.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -64,6 +64,11 @@ public class Season
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return $"{this.Turn}:{this.Timeline}";
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a root season at the beginning of time.
|
/// Create a root season at the beginning of time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -39,6 +39,11 @@ public class Unit
|
||||||
this.Type = type;
|
this.Type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return $"{this.Power} {this.Type} {this.Location.Province} {this.Season}";
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new unit. No validation is performed; the adjudicator should only call this
|
/// Create a new unit. No validation is performed; the adjudicator should only call this
|
||||||
/// method after accepting a build order.
|
/// method after accepting a build order.
|
||||||
|
|
Loading…
Reference in New Issue