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; }
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]; } }
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(); } }
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:("); } }
internal List <string> GetUsersForPM(int gameID) { Models.ClientGame game = findGame(gameID); return(new List <string>(game.messageList.Keys)); }
internal string GetMessages(int gameID, string v) { Models.ClientGame game = findGame(gameID); return(game.GetMessages(v)); }
public GameFrame(GUIManager manager, Models.ClientGame game) { this.manager = manager; this.game = game; this.gameID = game.id; }