public void Remove(Siege siege, Realms realm) { DeployedSieges.Remove(siege); var siegeType = SiegeTracking.SingleOrDefault(x => x.Type == siege.SiegeInterface.Type && x.Realm == realm); siegeType?.Decrement(); }
public int GetNumberByType(SiegeType siegeType, Realms realm) { var tracking = SiegeTracking.SingleOrDefault(x => x.Type == siegeType && x.Realm == realm); if (tracking != null) { return(tracking.CurrentNumberSiege); } else { return(0); } }
/// <summary> /// Determine whether the counts mean we can deploy this siege. /// </summary> /// <param name="typeToDeploy"></param> /// <returns></returns> private bool SiegeTypeCanDeploy(SiegeType typeToDeploy, Realms realm) { var okToDeploy = SiegeTracking.SingleOrDefault(x => x.Type == typeToDeploy && x.Realm == realm); if (okToDeploy != null) { return(okToDeploy.CanDeploy()); } else { return(false); } }