Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- namespace AnimalSimulator.Infrastructure.States
- {
- using Gameplay.Services;
- using Services;
- using Services.Gameplay;
- using Services.Inputs;
- using UI.Services;
- public class LoadGameplayState : IPayloadedState<ServicesContainer>
- {
- private readonly GameStateMachine _stateMachine;
- public LoadGameplayState(GameStateMachine gameStateMachine) =>
- _stateMachine = gameStateMachine;
- public void Enter(ServicesContainer gameplayContainer)
- {
- // Initialize Services
- var initializes = new List<IInitialized>()
- {
- gameplayContainer.Single<IGameplayCameraService>(),
- gameplayContainer.Single<IPlayerService>(),
- gameplayContainer.Single<IIslandsService>(),
- gameplayContainer.Single<IGameplayUIService>(),
- gameplayContainer.Single<IInputService>()
- };
- foreach (var initialized in initializes)
- initialized.Initialize();
- // Next State
- _stateMachine.Enter<GameLoopState>();
- }
- public void Exit() { }
- }
- }
Add Comment
Please, Sign In to add comment