Пример #1
0
        public GameStateProviderTests()
        {
            _dummyPlayer = GetDummyPlayer();
            _dummyMap    = GetDummyMap();

            _gameStateRepository = Substitute.For <IGameStateRepository>();
            _playersProvider     = Substitute.For <IPlayersProvider>();
            _playersProvider.Get(Guid.Empty).ReturnsForAnyArgs(_dummyPlayer);
            _mapProvider = Substitute.For <IMapProvider>();
            _mapProvider.GetRandomMap().ReturnsForAnyArgs(_dummyMap);
            _gameStateProvider = new GameStateProvider(_gameStateRepository, _playersProvider, _mapProvider);
        }
Пример #2
0
    IEnumerator Start()
    {
        yield return(PlayerCloneState.LoadAssets()); //Load our player clone state assets in

        //Spawn our player
        CharacterController playerController = Instantiate(playerPrefab).GetComponent <CharacterController>();

        //Setup player
        Debug.Assert(playerController != null, "Our player prefab does not have a character controller!");
        player.Possess(playerController);
        player.enabled = true;
        RespawnPlayer();
        //Setup camera
        mainCamera.Follow = playerController.transform;
        //Set gamestate
        currentGameState = GameStateProvider.GetCurrentGameState();
    }
Пример #3
0
 public MyCustomReplay(ChecksumProvider checksumProvider, GameStateProvider gameStateProvider) : base(checksumProvider)
 {
     _gameStateProvider = gameStateProvider;
 }
 public GameStateChecksumProvider(GameStateProvider gameStateProvider)
 {
     _gameStateProvider = gameStateProvider;
 }
Пример #5
0
 private void RoomCompleted()
 {
     OnDoorOpen.Invoke(currentDoorIndex++);
     currentGameState = GameStateProvider.GetCurrentGameState(); //Store the new current gamestate
 }