Esempio n. 1
0
 public void PlayerRolledDice(Player.Player player, int rolledCount)
 {
     foreach (var gameUpdater in _gameUpdaters)
     {
         gameUpdater.PlayerRolledDice(player, rolledCount);
     }
 }
Esempio n. 2
0
 public void ChatPlayerMessage(Player.Player player, string message)
 {
     foreach (var gameUpdater in _gameUpdaters)
     {
         gameUpdater.ChatPlayerMessage(player, message);
     }
 }
Esempio n. 3
0
 public void PlayerSetMoney(Player.Player player, int money)
 {
     foreach (var gameUpdater in _gameUpdaters)
     {
         gameUpdater.PlayerSetMoney(player, money);
     }
 }
Esempio n. 4
0
 public void PlayerSetPlace(Player.Player player, IPlace place)
 {
     foreach (var gameUpdater in _gameUpdaters)
     {
         gameUpdater.PlayerSetPlace(player, place);
     }
 }
Esempio n. 5
0
 public void PlayerRolledThisTurn(Player.Player player, bool rolledThisTurn)
 {
     if (player.PlayerId == _currentPlayerId)
     {
         _currentPlayerRolledThisTurn = rolledThisTurn;
     }
 }
Esempio n. 6
0
 public void PlayerRolledThisTurn(Player.Player player, bool rolledThisTurn)
 {
     foreach (var gameUpdater in _gameUpdaters)
     {
         gameUpdater.PlayerRolledThisTurn(player, rolledThisTurn);
     }
 }
Esempio n. 7
0
 public void NextRound(Player.Player currentPlayer)
 {
     foreach (var gameUpdater in _gameUpdaters)
     {
         gameUpdater.NextRound(currentPlayer);
     }
 }
Esempio n. 8
0
        public InnerRemotePlayerController CreateInnerRemotePlayerController(VsadilNestihl.Game.Player.Player player)
        {
            Receiver.UnsubscribeFromMessage <PlayerJoinRequest>(OnPlayerJoinRequest);
            Receiver.UnsubscribeFromMessage <PlayerPositionSwitchRequest>(OnPlayerPositionSwitchRequest);
            Receiver.UnsubscribeFromMessage <PlayerColorSwitchRequest>(OnPlayerColorSwitchRequest);
            Receiver.UnsubscribeFromMessage <Networking.Messages.Chat.ChatPlayerMessageRequest>(OnChatPlayerMessageRequest);

            return(new InnerRemotePlayerController(Receiver, player));
        }
Esempio n. 9
0
 public void ChatPlayerMessage(Player.Player player, string message)
 {
     if (_gameViewLoaded)
     {
         _gameView.ChatPlayerMessage(player.PlayerId, message);
     }
     else
     {
         _chatMessages.Add(new Tuple <int, string>(player.PlayerId, message));
     }
 }
Esempio n. 10
0
        public void Start()
        {
            if (GameState != GameState.Lobby)
            {
                throw new InvalidActionException("Game is already started.");
            }

            // All playing players (not spectators)
            var actualLobbyPlayers = _lobbyPlayers.Where(x => x.PlayerPosition != Player.PlayerPosition.Spectator).ToList();

            if (actualLobbyPlayers.Count < 2)
            {
                throw new InvalidActionException("More players are needed.");
            }

            var startPlace = Board.GetStartPlace();

            // Create all players
            Players = new List <Player.Player>();
            foreach (var lobbyPlayer in actualLobbyPlayers)
            {
                var player = new Player.Player(lobbyPlayer,
                                               DefaultDice,
                                               GameSettings.StartMoney,
                                               startPlace);
                player.SetGameManager(this);
                lobbyPlayer.PlayerCreated(player);
                Players.Add(player);
            }

            GameState = GameState.ChosingStartingPlayer;
            GameUpdater.GameStarted(Players);
            GameUpdater.ChatServerMessage("Game started.");

            GameState = GameState.Running;
            TurnLogic.BeginFirstRound();
        }
Esempio n. 11
0
 public void PlayerSetMoney(Player.Player player, int money)
 {
     _receiver.SendMessage(new PlayerSetMoney(player.PlayerId, money));
 }
Esempio n. 12
0
 public void ChatPlayerMessage(Player.Player player, string message)
 {
     _receiver.SendMessage(new VsadilNestihl.Networking.Messages.Chat.ChatPlayerMessage(player.PlayerId, message));
 }
Esempio n. 13
0
 public void PlayerSendChatMessage(Player.Player player, string message)
 {
     // TODO: player message handler
     GameUpdater.ChatPlayerMessage(player, message);
 }
Esempio n. 14
0
 public void NextRound(Player.Player currentPlayer)
 {
     _currentPlayerId = currentPlayer.PlayerId;
     _gameView?.NextRound();
 }
Esempio n. 15
0
 public void PlayerSetPlace(Player.Player player, IPlace place)
 {
     _players[player.PlayerId].Place = place;
     _gameView.PlayerSetPlace(player.PlayerId, place.GetPlaceId());
 }
Esempio n. 16
0
 public void PlayerPassedPlace(Player.Player player, IPlace place)
 {
     _gameView.PlayerPassedPlace(player.PlayerId, place.GetPlaceId());
 }
Esempio n. 17
0
 public void PlayerRolledDice(Player.Player player, int rolled)
 {
     DiceRolling.PlayerRolled(player, rolled);
 }
Esempio n. 18
0
 public void PlayerRolledDice(Player.Player player, int rolledCount)
 {
     _gameView.PlayerRolledDice(player.PlayerId, rolledCount);
 }
Esempio n. 19
0
 public void PlayerSetPlace(Player.Player player, IPlace place)
 {
     _receiver.SendMessage(new PlayerSetPlace(player.PlayerId, place.GetPlaceId()));
 }
Esempio n. 20
0
 public void PlayerRolledDice(Player.Player player, int rolledCount)
 {
     _receiver.SendMessage(new PlayerRolledDice(player.PlayerId, rolledCount));
 }
Esempio n. 21
0
 public void PlayerCreated(VsadilNestihl.Game.Player.Player player)
 {
     // Attach inner player controller for player
     PlayerHandler?.CreateInnerRemotePlayerController(player);
 }
Esempio n. 22
0
 public void PlayerRolledThisTurn(Player.Player player, bool rolledThisTurn)
 {
     _receiver.SendMessage(new PlayerRolledThisTurn(player.PlayerId, rolledThisTurn));
 }
Esempio n. 23
0
 public void PlayerSetMoney(Player.Player player, int money)
 {
     _players[player.PlayerId].Money = money;
 }
Esempio n. 24
0
 public void NextRound(Player.Player currentPlayer)
 {
     _receiver.SendMessage(new NextRound(currentPlayer.PlayerId));
 }
Esempio n. 25
0
 public void PlayerEndTurn(Player.Player player)
 {
     TurnLogic.PlayerEndTurn(player);
 }