Exemple #1
0
 public GameFrame(GUIManager manager, int gameID, List <Models.Move> moves)//USED ONLY FOR REPLAYS
 {
     this.manager = manager;
     this.game    = null;
     this.gameID  = gameID;
     this.moves   = moves;
 }
Exemple #2
0
 internal void UpdatePlayerList(int gameID, GameStartMove move)
 {
     Models.ClientGame game = findGame(gameID);
     game.UpdatePlayerListFromWaitingList();
     foreach (Models.ClientUserProfile prof in game.players)
     {
         prof.credit = move.playerBets[prof.username];
     }
 }
Exemple #3
0
        internal async void CreateGame(GamePreferences pref)
        {
            Models.ClientGame newGame = await Communication.GameCenterFunctions.Instance.createGame(pref);

            if (newGame == null)
            {
                MessageBox.Show("Something went wrong!", "Oh Oh!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                MessageBox.Show("New game created successfuly!", "New Game Created!", MessageBoxButton.OK, MessageBoxImage.Information);
                mainWindow.mainFrame.NavigationService.GoBack();
            }
        }
Exemple #4
0
        internal async void JoinGame(int gameID, int credit)
        {
            Models.ClientGame game = await Communication.GameCenterFunctions.Instance.joinGame(gameID, credit);

            if (game != null)
            {
                game.InitMessageList(profile.username);
                AddGame(game);
                await RefreshProfile();

                GameFrame gameFrame = new GameFrame(this, game);
                AddGameFrame(gameFrame);
                gameFrame.Init(false);
                NavigateToGameFrame(gameFrame);
            }
            else
            {
                MessageBox.Show("something went wrong:(");
            }
        }
Exemple #5
0
 internal List <string> GetUsersForPM(int gameID)
 {
     Models.ClientGame game = findGame(gameID);
     return(new List <string>(game.messageList.Keys));
 }
Exemple #6
0
 internal string GetMessages(int gameID, string v)
 {
     Models.ClientGame game = findGame(gameID);
     return(game.GetMessages(v));
 }
Exemple #7
0
 public GameFrame(GUIManager manager, Models.ClientGame game)
 {
     this.manager = manager;
     this.game    = game;
     this.gameID  = game.id;
 }