Esempio n. 1
0
 public GameController(
     ILogger <GameController> logger,
     IGameSessionService gameSessionService)
 {
     _logger             = logger;
     _gameSessionService = gameSessionService;
 }
        private void Awake()
        {
            _cueBallRB          = cueBall.GetComponent <Rigidbody>();
            _yellowTargetBallRB = yellowTargetBall.GetComponent <Rigidbody>();
            _redTargetBallRB    = redTargetBall.GetComponent <Rigidbody>();

            if (!_cueBallRB || !_yellowTargetBallRB || !_redTargetBallRB)
            {
                Debug.LogError("All balls must have an attached Rigidbody!");
            }

            _cameraTransform = Camera.main.transform;

            _gameSessionService  = ServiceLocator.Resolve <IGameSessionService>();
            _gameSettingsService = ServiceLocator.Resolve <IGameSettingsService>();
            _gameSettingsService.LoadGameSettings(Constants.DIRECTORY_PATH_SAVES, Constants.FILE_NAME_SETTINGS, Constants.EXTENSION_SAVE_FILES);
            _eventService = ServiceLocator.Resolve <IEventService>();

            _cachedCueBallPosition          = cueBall.transform.position;
            _cachedRedTargetBallPosition    = redTargetBall.transform.position;
            _cachedYellowTargetBallPosition = yellowTargetBall.transform.position;

            // Setup the state machine
            stateHolder.updateDelegates = new StateHolder.UpdateDelegate[3];
            stateHolder.updateDelegates[(int)ControllerState.AwaitingInput] = UpdateAwaitingInput;
            stateHolder.updateDelegates[(int)ControllerState.BallInMotion]  = UpdateBallInMotion;
            stateHolder.updateDelegates[(int)ControllerState.Replay]        = UpdateReplay;
        }
Esempio n. 3
0
 public GameSessionController(IGameSessionService service, ILogger logger, IUserSessions sessions, IEnvironment environment)
 {
     _service     = service;
     _logger      = logger;
     _sessions    = sessions;
     _environment = environment;
 }
        private void Awake()
        {
            _gameSettingsService = ServiceLocator.Resolve <IGameSettingsService>();
            _gameSessionService  = ServiceLocator.Resolve <IGameSessionService>();

            // Load game settings from the previously saved session if it exists (for now audio volume only).
            _gameSettingsService.LoadGameSettings(Constants.DIRECTORY_PATH_SAVES, Constants.FILE_NAME_SETTINGS, Constants.EXTENSION_SAVE_FILES);

            // Load game data from the previously saved session if it exists (saved during game over).
            _gameSessionService.LoadGameSessionData(Constants.DIRECTORY_PATH_SAVES, Constants.FILE_NAME_LAST_SESSION, Constants.EXTENSION_SAVE_FILES);

            UpdateUIFromGameSettings();
            UpdateUIFromGameSessionData();
        }
 private void Awake()
 {
     _eventService       = ServiceLocator.Resolve <IEventService>();
     _gameSessionService = ServiceLocator.Resolve <IGameSessionService>();
 }
 public GameSessionController(IGameSessionService gameSessionService)
 {
     _gameSessionService = gameSessionService;
 }
Esempio n. 7
0
 public GameSessionsHub(IGameService gameService, IGameSessionService gameSessionService, IMapper mapper)
 {
     this.gameService        = gameService;
     this.gameSessionService = gameSessionService;
     this.mapper             = mapper;
 }
 public FeedbackCreateRequestHandler(IGameSessionService gameSessionService
                                     , IFeedbackService feedbackService)
 {
     _feedbackService    = feedbackService;
     _gameSessionService = gameSessionService;
 }
 public GameSessionViewComponent(IGameSessionService gameSessionService)
 {
     _gameSessionService = gameSessionService;
 }
Esempio n. 10
0
 protected override void Awake()
 {
     base.Awake();
     _gameSessionService = ServiceLocator.Resolve <IGameSessionService>();
 }
Esempio n. 11
0
 public GameSessionController(IGameSessionService service, ILogger logger)
 {
     _service = service;
     _logger  = logger;
 }
 protected override void OnSetup()
 {
     _mockGameSessionStorage = Substitute.For <IGameSessionStorage>();
     _mockGameSessionService = Substitute.For <IGameSessionService>();
     Controller = new GameSessionController(_mockGameSessionStorage, _mockGameSessionService);
 }
Esempio n. 13
0
 public PlayerController(IPlayerService authenticationService, IGameSessionService gameSessionService)
 {
     _playerService      = authenticationService;
     _gameSessionService = gameSessionService;
 }
Esempio n. 14
0
 public GameSessionHub(IGameSessionService gameSessionService)
 {
     _gameSessionService = gameSessionService;
 }
Esempio n. 15
0
 public GameSessionController(IGameSessionService gameSessionService, DbContextOptions <GameDbContext> dbContextOptions) // wstrzyknięcie zależności
 {
     _dbContextOptions   = dbContextOptions;
     _gameSessionService = gameSessionService;
 }
 public GameSessionContext(ISceneHost scene, GameSessionConfiguration config, IGameSessionService service)
 {
     Scene   = scene;
     Config  = config;
     Service = service;
 }
Esempio n. 17
0
 public CleanOldGamesJob(IGameSessionService gameSessionService)
 {
     this.gameSessionService = gameSessionService;
 }
 public GameSessionController(IGameSessionStorage gameSessionStorage, IGameSessionService gameSessionService)
 {
     _gameSessionStorage = gameSessionStorage;
     _gameSessionService = gameSessionService;
 }