コード例 #1
0
ファイル: GameFrame.xaml.cs プロジェクト: Nivlipetz1/WSEP
 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;
 }
コード例 #2
0
ファイル: GUIManager.cs プロジェクト: Nivlipetz1/WSEP
 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];
     }
 }
コード例 #3
0
ファイル: GUIManager.cs プロジェクト: Nivlipetz1/WSEP
        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();
            }
        }
コード例 #4
0
ファイル: GUIManager.cs プロジェクト: Nivlipetz1/WSEP
        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:(");
            }
        }
コード例 #5
0
ファイル: GUIManager.cs プロジェクト: Nivlipetz1/WSEP
 internal List <string> GetUsersForPM(int gameID)
 {
     Models.ClientGame game = findGame(gameID);
     return(new List <string>(game.messageList.Keys));
 }
コード例 #6
0
ファイル: GUIManager.cs プロジェクト: Nivlipetz1/WSEP
 internal string GetMessages(int gameID, string v)
 {
     Models.ClientGame game = findGame(gameID);
     return(game.GetMessages(v));
 }
コード例 #7
0
ファイル: GameFrame.xaml.cs プロジェクト: Nivlipetz1/WSEP
 public GameFrame(GUIManager manager, Models.ClientGame game)
 {
     this.manager = manager;
     this.game    = game;
     this.gameID  = game.id;
 }