コード例 #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
ファイル: Province.cs プロジェクト: evandrix/DAIDE10
 /// <summary>Gets a value indicating whether a specific <see cref="Power"/> can build a specific <see cref="UnitType"/> on this <see cref="Province"/>
 /// </summary>
 /// <param name="power">Power</param>
 /// <param name="unitType">Unit type.</param>
 /// <returns><c>true</c> if the specified <see cref="Power"/> can build the specified <see cref="UnitType"/> on this <see cref="Province"/>; otherwise, <c>false</c>.</returns>
 public bool CanBuildUnitType(Power power, UnitType unitType)
 {
     switch(unitType)
     {
         case UnitType.Army :
             return CanBuild(power) && ArmyMoveable;
         case UnitType.Fleet :
             return CanBuild(power) && FleetMoveable;
         default :
             throw new ArgumentException(Properties.ErrorMessages.Province_UnknownUnitType, "unitType");
     }
 }
コード例 #3
0
ファイル: Province.cs プロジェクト: evandrix/DAIDE10
 /// <summary>Gets a value indicating whether a specific <see cref="Power"/> can build a fleet on this <see cref="Province"/>
 /// </summary>
 /// <param name="power">Power</param>
 /// <returns><c>true</c> if the specified <see cref="Power"/> can build a fleet on this <see cref="Province"/>; otherwise, <c>false</c>.</returns>
 public bool CanBuildFleet(Power power)
 {
     return CanBuildUnitType(power, UnitType.Fleet);
 }
コード例 #4
0
ファイル: Province.cs プロジェクト: evandrix/DAIDE10
 /// <summary>Gets a value indicating whether a specific <see cref="Power"/> can build an army on this <see cref="Province"/>
 /// </summary>
 /// <param name="power">Power</param>
 /// <returns><c>true</c> if the specified <see cref="Power"/> can build an army on this <see cref="Province"/>; otherwise, <c>false</c>.</returns>
 public bool CanBuildArmy(Power power)
 {
     return CanBuildUnitType(power, UnitType.Army);
 }
コード例 #5
0
ファイル: Province.cs プロジェクト: evandrix/DAIDE10
 /// <summary>Gets a value indicating whether a specific power can build on this <see cref="Province"/>.
 /// </summary>
 /// <param name="power">Power.</param>
 /// <returns><c>true</c> if the power can build on this <see cref="Province"/>; otherwise, <c>false</c>.</returns>
 public bool CanBuild(Power power)
 {
     return IsOpenForBuilding && ( this.owningPower == power );
 }