private bool IsModuleBuyed() { var planetLocalData = Planets.GetPlanet(planetId).LocalData; if (!planetLocalData.IsModuleRequired) { return(true); } return(Services.Modules.IsOpened(planetLocalData.module_id)); }
private void UpdateOpenedClosedContent() { var planet = Planets.GetPlanet(planetId); if (planet.State == PlanetState.Opened) { openedContent?.Activate(); closedContent?.Deactivate(); } else { openedContent?.Deactivate(); closedContent?.Activate(); } }
private bool IsAllowBuyModuleForCurrentPlanet() { var planetLocalData = Planets.GetPlanet(planetId).LocalData; if (!planetLocalData.IsModuleRequired) { return(true); } ModuleTransactionState state; if (Services.Modules.IsAllowBuyModule(planetLocalData.module_id, out state)) { return(true); } return(false); }
/// <summary> /// Activate only modules required for this planet /// </summary> /// <param name="planetId">Target planet id</param> public void Setup(int planetId) { var planetLocalData = Planets.GetPlanet(planetId).LocalData; if (planetLocalData.IsModuleRequired) { modules.ToList().ForEach(m => { if (m.moduleId <= planetLocalData.module_id) { m.Activate(); } else { m.Deactivate(); } }); } else { modules.DeactivateEnumerable(); } }
private void UpdateModules() { var planetLocalData = Services.ResourceService.PlanetNameRepository.GetPlanetNameData(planetId); if (!planetLocalData.IsModuleRequired) { ToggleModules(false); } else { if (Services.Modules.IsOpened(planetLocalData.module_id)) { var planetData = Planets.GetPlanet(planetId); if (planetData.State == PlanetState.Opening || planetData.State == PlanetState.Opened) { ToggleModules(false); } else { ToggleModules(true); } } else { var planetData = Planets.GetPlanet(planetId); if (planetData.State == PlanetState.Opening || planetData.State == PlanetState.Opened) { ToggleModules(false); } else { ToggleModules(true); } } } }