示例#1
0
        /// <summary>
        /// Checks if the current instance is the same subtype [land / sea / air] than <paramref name="other"/>.
        /// </summary>
        /// <param name="other">The second instance.</param>
        /// <returns><c>True</c> if both are the same subtype; <c>False</c> otherwise.</returns>
        internal bool IsSameType(UnitPivot other)
        {
            if (Is <LandUnitPivot>())
            {
                return(other.Is <LandUnitPivot>());
            }
            else if (Is <SeaUnitPivot>())
            {
                return(other.Is <SeaUnitPivot>());
            }
            else if (Is <AirUnitPivot>())
            {
                return(other.Is <AirUnitPivot>());
            }

            // Just in case.
            return(false);
        }
示例#2
0
 /// <summary>
 /// Adds as specified <see cref="UnitPivot"/> in garrison, then check the citizen happiness.
 /// </summary>
 /// <param name="unit">The unit to add.</param>
 internal void AddInGarrison(UnitPivot unit)
 {
     _garrison.Add(unit);
     CheckCitizensHappiness();
 }
示例#3
0
 /// <summary>
 /// Removes as specified <see cref="UnitPivot"/> from garrison, then check the citizen happiness.
 /// </summary>
 /// <param name="unit">The unit to remove.</param>
 internal void RemoveFromGarrison(UnitPivot unit)
 {
     _garrison.Remove(unit);
     CheckCitizensHappiness();
 }