示例#1
0
文件: Unit.cs 项目: evandrix/DAIDE10
 /// <summary>Creates a new <see cref="Unit"/> instance.
 /// </summary>
 /// <param name="type">Type.</param>
 /// <param name="power">Power.</param>
 /// <param name="location">Location.</param>
 public Unit(UnitType type, Power power, Location location)
 {
     this.type = type;
     this.power = power;
     this.location = location;
     this.retreatLocations = new LocationCollection();
 }
示例#2
0
 /// <summary>Gets the <see cref="Location"/> in the <see cref="Province"/>.
 /// </summary>
 /// <param name="unitType">Unit type.</param>
 /// <param name="coast">Coast.</param>
 /// <returns><c>null</c> if the <see cref="Location"/> doesn't exist.</returns>
 public Location GetLocation(UnitType unitType, Coast coast)
 {
     Location loc = new Location(this, unitType, coast);
     if (!locations.Contains(loc))
     {
         return null;
     }
     else
     {
         return locations[locations.IndexOf(loc)];
     }
 }