public static List <BuildItemUnitView> GetBuildItemUnitViewList(Dictionary <UnitType, int> hangarUnits, Dictionary <UnitType, TurnedUnit> unitTurn, ItemProgress spaceShipyard, UserPremiumWorkModel userPremium, OwnType ownType) { var unitTypes = UnitList.UnitsTypesList.ToList(); // if (ownType == OwnType.Mother && unitTypes.Count == 5) unitTypes.RemoveRange(3, 2); var units = unitTypes.Select(i => GetUnitViewInSpaceShipyard(i, hangarUnits[i], (unitTurn.ContainsKey(i)) ? unitTurn[i] : null, spaceShipyard, userPremium)).ToList(); return(units); }
public ItemProgress FixItemProgress(UnitType unitType, object modelData, OwnType ownType, UserPremiumWorkModel userPremium) { switch (ownType) { case OwnType.Mother: return(FixMotherItemProgress(unitType, (UserMothershipDataModel)modelData, userPremium)); case OwnType.Planet: return(FixPlanetItemProgress(unitType, (GDetailPlanetDataModel)modelData, userPremium)); default: throw new ArgumentOutOfRangeException(nameof(ownType), ownType, null); } }
public Dictionary <UnitType, HangarUnitsOut> GetherHangarUnits(object own, UserPremiumWorkModel userPremium, OwnType ownType) { switch (ownType) { case OwnType.Mother: return(GetherMotherUnits((UserMothershipDataModel)own, userPremium)); case OwnType.Planet: return(GetherPlanetUnits((GDetailPlanetDataModel)own, userPremium)); default: throw new ArgumentOutOfRangeException(nameof(ownType), ownType, null); } }
public PlanshetViewData GetCollection(IDbConnection connection, UserDataModel user, UserPremiumWorkModel currentUserPremium, object dataModel, OwnType ownType, bool synchronize = true) { switch (ownType) { case OwnType.Mother: return(GetMotherCollection(connection, user, currentUserPremium, (UserMothershipDataModel)dataModel, synchronize)); case OwnType.Planet: return(GetPlanetCollection(connection, user, currentUserPremium, (GDetailPlanetDataModel)dataModel, synchronize)); default: throw new ArgumentOutOfRangeException(nameof(ownType), ownType, null); } }
public Dictionary <string, IPlanshetViewData> GetEstate(IDbConnection connection, UserDataModel user, UserPremiumWorkModel userPremium, object own, OwnType ownType, bool synchronize = true) { switch (ownType) { case OwnType.Mother: return(GetMotherEstate(connection, user, userPremium, (UserMothershipDataModel)own, synchronize)); case OwnType.Planet: return(GetPlanetEstate(connection, user, userPremium, (GDetailPlanetDataModel)own, synchronize)); default: throw new ArgumentOutOfRangeException(nameof(ownType), ownType, null); } }
public ItemProgress SetUnitTurn(IDbConnection connection, UnitType unitType, int count, object dataModel, OwnType ownType, UserPremiumWorkModel userPremium) { switch (ownType) { case OwnType.Mother: return(SetMotherUnitTurn(connection, unitType, count, (UserMothershipDataModel)dataModel, userPremium)); case OwnType.Planet: return(SetPlanetUnitTurn(connection, unitType, count, (GDetailPlanetDataModel)dataModel, userPremium)); default: throw new ArgumentOutOfRangeException(nameof(ownType), ownType, null); } }