コード例 #1
0
ファイル: Player.cs プロジェクト: Jenya25/TabletopGamesArena
 /// <summary>
 /// Creates a new game room with the selected gameType
 /// </summary>
 /// <param name="_gameType"></param>
 public void CreateGameRoom(GameType _gameType)
 {
     try
     {
         GameRoom gameRoom = new GameRoom(_gameType, this);
         GamesArena.AddGameRoom(gameRoom);
         GamesHistoryRepository.AddGameHistory(gameRoom.GameID, ID);
         CurrentGameRoom = gameRoom;
     }
     catch (Exception)
     {
         throw new Exception("Something Went Wrong. Support Code: 1223");
     }
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: Jenya25/TabletopGamesArena
 /// <summary>
 /// adds palyer to existing game room using room code
 /// </summary>
 /// <param name="RoomCode"></param>
 public void JoinGameRoom(string RoomCode)
 {
     try
     {
         if (!(CurrentGameRoom is null))
         {
             ExitGameRoom();
         }
         GameRoom gameRoom = GamesArena.GetGameRoom(RoomCode);
         gameRoom.AddPlayer(this);
         GamesHistoryRepository.AddGameHistory(gameRoom.GameID, ID);
         CurrentGameRoom = gameRoom;
     }
     catch (Exception)
     {
         throw; /*new Exception("Something Went Wrong. Support Code: 1443");*/
     }
 }
コード例 #3
0
ファイル: Player.cs プロジェクト: Jenya25/TabletopGamesArena
 /// <summary>
 /// gets a datatable of user's games history
 /// </summary>
 /// <returns>DataTable of Game history details</returns>
 public DataTable MyHistory() => GamesHistoryRepository.GetGamesHistory(ID);