/// <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); }
/// <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(); }
/// <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(); }