public void AddPlayerToGame(int PlayerID)
 {
     if (Players.ContainsKey(PlayerID))
     {
         PlayersInGame.Add(PlayerID);
     }
 }
示例#2
0
 //Create players other than Dealer
 public void CreatePlayers()
 {
     for (int counter = NumberOfPlayers; counter > 0; counter = counter - 1)
     {
         IPlayer _player = new Player();
         _player.PlayerName = "Player " + counter;
         PlayersInGame.Add(_player);
     }
 }
示例#3
0
 public bool AddPlayer(Player player)
 {
     if (GameMode == GameMode.GUIDED)
     {
         if (GameState == GameState.COUNTDOWN)
         {
             if (PlayersInGame.Count < PlayersLimit)   // pripoji hrača do bežiacej hry
             {
                 PlayersInGame.Add(player);
                 PlayersInLobby.Add(player);
                 player.InGame = true;
                 Map.SpawnPlayer(player);
                 ++PlayersAllive;
                 return(true);
             }
             return(false);
         }
         else     // Lobby
         {
             if (PlayersInLobby.Count < PlayersLimit)
             {
                 PlayersInLobby.Add(player);
                 return(true);
             }
             return(false);
         }
     }
     else     // Player Mode - hraju iba hrači ktory boli pri štarte, ostatny čakaju na skončenie hry
     {
         if (PlayersInLobby.Count < PlayersLimit)
         {
             PlayersInLobby.Add(player);
             if (PlayersInLobby.Count == 1)
             {
                 Creator = player;
             }
             else if (GameState == GameState.LOBBY)
             {
                 FramesToStart /= 2;
             }
             return(true);
         }
         return(false);
     }
 }
示例#4
0
        public ViewModel(IGameService gameService)
        {
            _gameService = gameService;

            // Add players to the ObservableCollection
            PlayersInGame.Add(Nate);
            PlayersInGame.Add(Jake);
            PlayersInGame.Add(Evan);
            PlayersInGame.Add(Chad);

            PopulateDisplayCards();
            foreach (var player in PlayersInGame)
            {
                dealer.DealPlayerCards(player);
            }

            CallCommand  = new SyncCommand <HumanPlayer>(Call);
            RaiseCommand = new SyncCommand <HumanPlayer>(Raise);
            FoldCommand  = new SyncCommand <HumanPlayer>(Fold);

            //DrawCommunityCards(5);
        }
 public PlayersInGame AddPlayers(Player p)
 {
     _players.Add(p);
     return(_players);
 }