public override void UpdateGraphicBySeason() { SetGraphic(SeasonManager.GetSeasonGraphic(World.Season, OriginalGraphic)); AllowedToDraw = !GameObjectHelper.IsNoDrawable(Graphic); SetTextureByGraphic(Graphic); IsVegetation = StaticFilters.IsVegetation(Graphic); }
public void EndSeasonAndCreateNext(string seasonId) { Team managersTeam; using (var repo = RepositoryFactory.CreateGameInfoRepository()) { managersTeam = repo.GetGameInfo().CurrentTeam; } var seasonManager = new SeasonManager(RepositoryFactory, managersTeam); Season season; using (var seasonRepository = RepositoryFactory.CreateSeasonRepository()) { season = seasonRepository.GetOne(seasonId); } // Create a transaction which ends the current season and creates a new one. var transactionManager = RepositoryFactory.CreateTransactionManager(); seasonManager.EndSeason(season, transactionManager); seasonManager.CreateNextSeason(season, transactionManager); transactionManager.Save(); }
public ActionResult Create([Bind(Include = "SeasonManagerId,Season,NumberSeats,BookedCurrent,FallProd,FallTime,BookedFall,WinterProd,WinterTime,BookedWinter,SpringProd,SpringTime,BookedSpring,SeasonManagerPerson")] SeasonManager seasonManager) { ModelState.Remove("SeasonManagerPerson"); string userId = Request.Form["dbUsers"].ToString(); if (ModelState.IsValid) { ViewData["dbUsers"] = new SelectList(db.Users.ToList(), "Id", "UserName"); seasonManager.SeasonManagerPerson = db.Users.Find(userId); db.SeasonManagers.Add(seasonManager); if (seasonManager.FallTime != null) { seasonManager.BookedFall = true; } if (seasonManager.WinterTime != null) { seasonManager.BookedWinter = true; } if (seasonManager.SpringTime != null) { seasonManager.BookedSpring = true; } db.SaveChanges(); return(RedirectToAction("Index")); } return(View(seasonManager)); }
private void Awake() { _playerManager = GetComponent <PlayerManager>(); _seasonManager = GetComponent <SeasonManager>(); _seasonManager.OnSeasonEnded.AddListener(SeasonEndedHandler); _seasonManager.OnYearEnded.AddListener(YearEndedHandler); }
public ActionResult DeleteConfirmed(int id) { SeasonManager seasonManager = db.SeasonManagers.Find(id); db.SeasonManagers.Remove(seasonManager); db.SaveChanges(); return(RedirectToAction("Index")); }
private void Start() { _scarecrowManager = Utility.ScarecrowManager; _seasonManager = Utility.SeasonManager; _spriteRenderer = GetComponent <SpriteRenderer>(); _scarecrowSelected = _scarecrowManager.ScarecrowsLeftToRight.First(); UpdateSelection(); }
private void OnDiscoveredSpaceClicked() { KFMOD.PlayOneShot(GlobalAssets.GetSound(GetSound(), false)); MusicManager.instance.PlaySong("Stinger_Surface", false); CameraController.Instance.SetTargetPos(cameraFocusPos, 8f, true); SeasonManager component = SaveGame.Instance.GetComponent <SeasonManager>(); component.ForceBeginMeteorSeasonWithShower(); }
// Start is called before the first frame update void Awake() { gameController = WorldMethods.GetGameController(); inputController = WorldMethods.GetInputController(); unitManager = WorldMethods.GetUnitManager(); seasonManager = WorldMethods.GetSeasonManager(); //Reduce the speed to an appropriate level for the engine realUnitSpeed = unitSpeed * gameController.realUnitSpeedFactor; }
private void Awake() { if (Instance == null && DayCycleManager.Instance != null) { Instance = this; } else { Destroy(this); } }
void Start() { InputController = WorldMethods.GetInputController(); UIController = WorldMethods.GetUIController(); playerResourceManager = WorldMethods.GetPlayerResourceManager(); seasonManager = WorldMethods.GetSeasonManager(); waitPerTick = waitPerTickSpeedThree; //Set the game speed to default UIController.UIControllerSetup(); SetUpGame(); }
public IEnumerable <YieldResult> New_TendToFields() { Furniture furniture = InteractionTarget.GetPrimaryHolder <Furniture>(); SoilModule soilModule = furniture.GetModule <SoilModule>(); foreach (var interaction in soilModule.GetInteractions(human, InteractionInfo.issuedByAI, false)) { if (interaction.interaction == Interaction.RemoveInfestedPlants || interaction.interaction == Interaction.RemovePlant || interaction.interaction == Specialization.TendToFieldsInteraction) { continue; } if (interaction.interaction == Interaction.WaterPlant) { if (!soilModule.GetSeasons().Contains(SeasonManager.GetCurrentSeason())) { continue; } //InteractionRestrictionCanTakeResourceNearby cheat. we don't check the distance if (!WorldScripts.Instance.furnitureFactory.GetModules <InventoryReplenishmentModule>().Any(x => x.GetResource() == Resource.Water)) { continue; } //InteractionRestrictionEquipmentEffect cheat. we don't check the distance if (!human.equipmentSet.GetEffects().Any(x => x.first == EquipmentEffect.WateringPlants)) { continue; } } else if (!WorkInteractionControllerPatch.CheckInteraction(InteractionTarget, interaction, human)) { continue; } subTask = new YieldMicroInteraction(new InteractionInfo( interaction.interaction, InteractionTarget, interaction.restrictions, InteractionInfo.issuedByAI, InteractionInfo.priority, isContinuationOrSubtask: true), human); while (subTask != null) // WHILEPROTECTED { subTask = subTask.Handle(); yield return(YieldResult.WaitFrame); } StopCurrentSubtask(); } yield return(YieldResult.Completed); }
// GET: Subscribers/SeasonManager/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SeasonManager seasonManager = db.SeasonManagers.Find(id); if (seasonManager == null) { return(HttpNotFound()); } return(View(seasonManager)); }
// GET: Subscribers/SeasonManager/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SeasonManager seasonManager = db.SeasonManagers.Find(id); if (seasonManager == null) { return(HttpNotFound()); } ViewData["dbUsers"] = new SelectList(db.Users.ToList(), "ID", "UserName"); return(View(seasonManager)); }
public override void OnInspectorGUI() { _target = target as SeasonManager; EditorGUI.BeginChangeCheck(); EditorGUILayout.LabelField("現在の季節は" + _target.current_season_jpn); _target.isSimulateSeason = EditorGUILayout.ToggleLeft("IsSimulateSeason", _target.isSimulateSeason); if (_target.isSimulateSeason) { var simulateDate = serializedObject.FindProperty("simulateDate"); EditorGUILayout.PropertyField(simulateDate); ClampDayProperty(simulateDate); serializedObject.ApplyModifiedProperties(); } _target.setSeasonStart = EditorGUILayout.ToggleLeft("SetSeasonStart", _target.setSeasonStart); if (_target.setSeasonStart) { var springStart = serializedObject.FindProperty("springStart"); EditorGUILayout.PropertyField(springStart); ClampDayProperty(springStart); var summerStart = serializedObject.FindProperty("summerStart"); EditorGUILayout.PropertyField(summerStart); ClampDayProperty(summerStart); var fallStart = serializedObject.FindProperty("fallStart"); EditorGUILayout.PropertyField(fallStart); ClampDayProperty(fallStart); var winterStart = serializedObject.FindProperty("winterStart"); EditorGUILayout.PropertyField(winterStart); ClampDayProperty(winterStart); serializedObject.ApplyModifiedProperties(); } }
public void UIControllerSetup() { GameController = GameObject.Find("GameController").GetComponent <GameController> (); inputController = GameObject.Find("InputController").GetComponent <InputController>(); playerResourceManager = WorldMethods.GetPlayerResourceManager(); pauseBoard = GameObject.Find("PauseBoard"); GameSpeedDisplay = GameObject.Find("GameSpeedDisplay").GetComponent <TextMeshProUGUI> (); DaysCounter = GameObject.Find("DaysCounter").GetComponent <TextMeshProUGUI>(); MonthsCounter = GameObject.Find("MonthsCounter").GetComponent <TextMeshProUGUI>(); YearsCounter = GameObject.Find("YearsCounter").GetComponent <TextMeshProUGUI>(); authorityNumber = GameObject.Find("AuthorityNumber").GetComponent <TextMeshProUGUI>(); populationNumber = GameObject.Find("PopulationNumber").GetComponent <TextMeshProUGUI>(); foodNumber = GameObject.Find("FoodNumber").GetComponent <TextMeshProUGUI>(); woodNumber = GameObject.Find("WoodNumber").GetComponent <TextMeshProUGUI>(); silverNumber = GameObject.Find("SilverNumber").GetComponent <TextMeshProUGUI>(); seasonManager = WorldMethods.GetSeasonManager(); RealDate = GameController.RealDate; }
private void CreateGameData(RepositoryFactory repositoryFactory, string gameId) { using (var transactionManager = repositoryFactory.CreateTransactionManager()) { // Create GameInfo. // Overrule the GameInfo Id with the Game Id. var gameInfo = new GameInfo { Name = DateTime.Now.ToString("yyyyMMddHHmmss"), Id = gameId }; // Create teams and players. var teamsAndPlayers = CreateTeamsAndPlayers(repositoryFactory); // =================================================================== //TODO OK, let MODDERVOKKIN op var numberRandomizer = new NumberRandomizer(); int randomIndex = numberRandomizer.GetNumber(0, Constants.HowManyTeamsPerLeague * Constants.HowManyLeagues - 1); gameInfo.CurrentTeam = teamsAndPlayers.Teams[randomIndex]; // =================================================================== transactionManager.RegisterInsert(gameInfo); // Insert teams. transactionManager.RegisterInsert(teamsAndPlayers.Teams); // Insert players. transactionManager.RegisterInsert(teamsAndPlayers.Players); // Create a season with match schedules. var seasonManager = new SeasonManager(repositoryFactory, gameInfo.CurrentTeam); seasonManager.CreateFirstSeason(teamsAndPlayers.Teams, transactionManager); transactionManager.Save(); } }
private void NextWeather() { float cycle = DayCycleManager.Instance.Cycle; SeasonManager season = SeasonManager.Instance; nextWeatherStart = cycle + Random.Range(minRainCoolDown, maxRainCoolDown); nextWeatherDuration = Random.Range(minDuration, maxDuration); nextWeatherIntensity = Random.Range(0.5f, 1.5f); float nextTransition = season._transitionDay * (season.whichSeason + 1) + season._transitionPeriodStart; if (nextWeatherStart + nextWeatherDuration + transitionCycle > nextTransition) { nextWeatherStart = nextTransition; nextWeatherDuration = season._transitionPeriodEnd - season._transitionPeriodStart; nextWeatherIntensity = 1.5f; /*if(season.IsWinter()){ * * }else{ * * }*/ } }
public override void UpdateGraphicBySeason() { Graphic = SeasonManager.GetLandSeasonGraphic(World.Season, OriginalGraphic); AllowedToDraw = Graphic > 2; }
public override void UpdateGraphicBySeason() { Graphic = SeasonManager.GetSeasonGraphic(World.Season, _originalGraphic); IsVegetation = StaticFilters.IsVegetation(Graphic); }
private void Start() { _seasonManager = GameObject.FindGameObjectWithTag("GameGod").GetComponent <SeasonManager>(); _cloudEmissionModule = _elementManager._cloudsPT.emission; }
public static SeasonManager GetSeasonManager() { SeasonManager seasonManagerToGet = GameObject.Find("SeasonManager").GetComponent <SeasonManager>(); return(seasonManagerToGet); }
private void Update() { crops.localScale = new Vector3(crops.localScale.x, Mathf.Max(0.1f, GetComponent <Workstation>().PercentComplete), crops.localScale.z); GetComponent <Workstation>().canFunction = SeasonManager.GetInstance().season == SeasonManager.Season.Summer; }
public override void UpdateGraphicBySeason() { SetGraphic(SeasonManager.GetSeasonGraphic(World.Season, OriginalGraphic)); AllowedToDraw = CanBeDrawn(Graphic); IsVegetation = StaticFilters.IsVegetation(Graphic); }
private IEnumerator RunAsync() { if (this.EventService != null) { this.EventService.Notify(new EventBeginTurn(base.GameClient.Game.Turn)); if (base.GameClient.Game.Turn == 0 && TutorialManager.IsActivated) { IPlayerControllerRepositoryService service = base.GameClient.Game.Services.GetService <IPlayerControllerRepositoryService>(); this.EventService.Notify(new EventTutorialGameStarted(service.ActivePlayerController.Empire)); } if (base.GameClient.Game.Turn == 0) { IDownloadableContentService service2 = Services.GetService <IDownloadableContentService>(); if (service2 != null) { List <DownloadableContent> list = new List <DownloadableContent>(); foreach (DownloadableContent downloadableContent in service2) { DownloadableContentType type = downloadableContent.Type; if ((type == DownloadableContentType.Exclusive || type == DownloadableContentType.Personal) && service2.IsShared(downloadableContent.Name)) { list.Add(downloadableContent); } } if (list.Count > 0) { for (int i = list.Count - 1; i >= 0; i--) { StaticString key = string.Format("DownloadableContent/{0}/RunOnce/Notified", list[i].Name); if (!Amplitude.Unity.Framework.Application.Registry.GetValue <bool>(key, false)) { Amplitude.Unity.Framework.Application.Registry.SetValue <bool>(key, true); this.EventService.Notify(new EventDownloadableContentPresentation(list[i])); } } } Empire clientEmpire = base.GameClient.GetClientEmpire(); if (clientEmpire != null && !clientEmpire.Faction.IsCustom && clientEmpire.Faction.IsStandard) { this.EventService.Notify(new EventFactionPresentation(clientEmpire.Faction)); } } } } SeasonManager seasonManager = base.GameClient.Game.GetService <ISeasonService>() as SeasonManager; if (seasonManager != null) { seasonManager.GameClient_Turn_Begin(); } PillarManager pillarManager = base.GameClient.Game.GetService <IPillarService>() as PillarManager; if (pillarManager != null) { pillarManager.OnBeginTurn(); } TerraformDeviceManager terraformDeviceManager = base.GameClient.Game.GetService <ITerraformDeviceService>() as TerraformDeviceManager; if (terraformDeviceManager != null) { terraformDeviceManager.GameClient_Turn_Begin(); } WorldEffectManager worldEffectManager = base.GameClient.Game.GetService <IWorldEffectService>() as WorldEffectManager; if (worldEffectManager != null) { worldEffectManager.OnBeginTurn(); } LeechManager leechManager = base.GameClient.Game.GetService <ILeechService>() as LeechManager; if (leechManager != null) { leechManager.OnBeginTurn(); } CooldownManager cooldownManager = base.GameClient.Game.GetService <ICooldownManagementService>() as CooldownManager; if (cooldownManager != null) { cooldownManager.OnBeginTurn(); } MapBoostManager mapBoostManager = base.GameClient.Game.GetService <IMapBoostService>() as MapBoostManager; if (mapBoostManager != null) { mapBoostManager.GameClient_OnBeginTurn(); } RegionalEffectsManager regionalEffectsManager = base.GameClient.Game.GetService <IRegionalEffectsService>() as RegionalEffectsManager; if (regionalEffectsManager != null) { regionalEffectsManager.GameClient_Turn_Begin(); } WeatherManager weatherManager = base.GameClient.Game.GetService <IWeatherService>() as WeatherManager; if (weatherManager != null) { weatherManager.GameClient_Turn_Begin(); } int num; for (int index = 0; index < base.GameClient.Game.Empires.Length; index = num + 1) { yield return(base.GameClient.Game.Empires[index].DoPasses("GameClientState_Turn_Begin")); base.GameClient.Game.Empires[index].Refresh(true); num = index; } IVisibilityService service3 = base.GameClient.Game.GetService <IVisibilityService>(); if (service3 != null) { IPlayerControllerRepositoryService service4 = base.GameClient.Game.GetService <IPlayerControllerRepositoryService>(); if (service4 != null && service4.ActivePlayerController != null && service4.ActivePlayerController.Empire != null) { service3.NotifyVisibilityHasChanged((Empire)service4.ActivePlayerController.Empire); } } IVictoryManagementService service5 = base.GameClient.Game.GetService <IVictoryManagementService>(); if (service5 != null) { service5.CheckForAlerts(base.GameClient.Game.Turn - 1); } IWorldPositionningService service6 = base.GameClient.Game.GetService <IWorldPositionningService>(); if (service6 != null) { service6.RefreshDefensiveTowerMapForEveryone(); } yield break; }
public void SeasonButtonOnClick() { SeasonManager.CurrentSeason = SeasonIndex; SeasonManager.SelectSeason(); } // Use this for initialization
public SeasonController(ISeasonService Season, ILeagueService league, ITeamService team) { _seasonmanager = (SeasonManager)Season; _leagueManager = (LeagueManager)league; _teamManager = (TeamManager)team; }