public void Awake() { entitySystem = new EntityStateSystem(); Console.RegisterCommand("showEntity", "showEntity 1337", "returns all states for an entity", command => { var args = Console.SplitParameters(command); var debug = entitySystem.DebugEntity(Convert.ToInt32(args[1])); Console.WriteLine(debug); } ); //TODO: this should be via the entity System. Fix this before save load. StaticStates.Add(new WorldEntityState(entitySystem.BuildEntity(new List <IState>()))); StaticStates.Add(new ActiveEntityState(entitySystem.BuildEntity(new List <IState>()))); StaticStates.Add(new GameModeState(GameMode.Design)); StaticStates.Add(new EntityLibraryState(InitialBuildableEntities.BuildableEntityLibrary)); StaticStates.Add(new SelectedState()); entitySystem.AddSystem(new WorldInitSystem()); entitySystem.AddSystem(new GlobalControlsSystem()); entitySystem.AddSystem(new PlayerEntityModificationSystem()); entitySystem.AddSystem(new EngineSystem()); entitySystem.AddSystem(new SubstanceNetworkSystem()); entitySystem.AddSystem(new EntityLibrarySystem()); entitySystem.AddSystem(new SaveLoadSystem()); entitySystem.AddSystem(new CrewMovementSystem()); entitySystem.AddSystem(new CrewHealthSystem()); entitySystem.AddSystem(new SeaSystem()); entitySystem.Init(); StartCoroutine(Ticker()); }
public void StartGame() { GameSettings.IsDebugOn = Debug.isDebugBuild && IsDebugOn; GameSettings.SkipFirstDayFadein = SkipFirstDayFadein; GameSettings.DisableTutorial = DisableTutorial; entitySystem = new EntityStateSystem(); //StaticStates StaticStates.Add(new DayPhaseState(DayPhase.Morning)); StaticStates.Add(new TimeState(Constants.GameStartTime)); StaticStates.Add(new CursorState(null, new SerializableVector3())); StaticStates.Add(new MoneyState(Constants.StartingMoney)); StaticStates.Add(new PlayerDecisionsState()); StaticStates.Add(new OutcomeTrackerState()); StaticStates.Add(new PaymentTrackerState()); //Debug entitySystem.AddSystem(new DebugControlsSystem()); entitySystem.AddSystem(new EntityTooltipSystem()); //Init entitySystem.AddSystem(new WaypointSystem()); entitySystem.AddSystem(new TransformSystem()); entitySystem.AddSystem(new SpawningSystem()); entitySystem.AddSystem(new InitVisualizersSystem()); //Camera entitySystem.AddSystem(new CameraSystem()); //Game entitySystem.AddSystem(new TimeSystem()); entitySystem.AddSystem(new PausingSystem()); entitySystem.AddSystem(new PathfindingSystem()); entitySystem.AddSystem(new CharacterControllerSystem()); entitySystem.AddSystem(new DrinkMakingSystem()); entitySystem.AddSystem(new InputResponseSystem()); entitySystem.AddSystem(new DialogueSystem()); entitySystem.AddSystem(new HierarchyManipulationSystem()); //Must run before VisibleSlotSystem entitySystem.AddSystem(new VisibleSlotSystem()); entitySystem.AddSystem(new ItemStackSystem()); entitySystem.AddSystem(new BarQueueSystem()); entitySystem.AddSystem(new BarEntitiesSystem()); //NPC/AI entitySystem.AddSystem(new ActionManagerSystem()); entitySystem.AddSystem(new DayDirectorSystem()); //Input - Ordering of systems important here. entitySystem.AddSystem(new CursorSystem()); entitySystem.AddSystem(new InteractionSystem()); entitySystem.AddSystem(new EntitySelectorSystem()); //GameStart entitySystem.AddSystem(new GameSetupSystem()); entitySystem.Init(); GameStarted = true; }