예제 #1
0
 public Models.GameTable GetGameTable(int id)
 {
     using (GameTableManagementServiceClient proxy = new GameTableManagementServiceClient()) {
         GameTableServiceReference.GameTable serviceGameTable = proxy.GetGameTableById(id);
         Models.GameTable clientGameTable = GameTableModelConverter.ConvertFromServiceGameTableToClientGameTable(serviceGameTable);
         return(clientGameTable);
     }
 }
예제 #2
0
 public List <Models.GameTable> GetAll()
 {
     using (GameTableManagementServiceClient proxy = new GameTableManagementServiceClient()) {
         var serviceGameTables = proxy.GetAll();
         List <Models.GameTable> clientGameTables = GameTableModelConverter.ConvertFromServiceGameTablesToClientGameTables(serviceGameTables);
         return(clientGameTables);
     }
 }
예제 #3
0
        public Models.GameTable JoinGameTable(string userId, int tableId)
        {
            UserManagementServiceAccess userManagement = new UserManagementServiceAccess();

            using (GameTableManagementServiceClient proxy = new GameTableManagementServiceClient()) {
                Models.CGUser user = userManagement.GetUserByUserId(userId);
                GameTableServiceReference.CGUser    serviceUser      = GameTableModelConverter.ConvertFromClientUserToServiceUser(user);
                GameTableServiceReference.GameTable serviceTable1    = proxy.GetGameTableById(tableId);
                GameTableServiceReference.GameTable serviceGameTable = proxy.JoinGameTable(serviceUser, serviceTable1);
                Models.GameTable clientGameTable = GameTableModelConverter.ConvertFromServiceGameTableToClientGameTable(serviceGameTable);
                return(clientGameTable);
            }
        }
예제 #4
0
        public Models.GameTable CreateGameTable(string userId, string tableName)
        {
            UserManagementServiceAccess userManagement = new UserManagementServiceAccess();

            Models.GameTable clientGameTable = null;
            using (GameTableManagementServiceClient proxy = new GameTableManagementServiceClient()) {
                Models.CGUser user = userManagement.GetUserByUserId(userId);
                GameTableServiceReference.CGUser    serviceUser      = GameTableModelConverter.ConvertFromClientUserToServiceUser(user);
                GameTableServiceReference.GameTable serviceGameTable = proxy.CreateGameTable(serviceUser, tableName);
                if (serviceGameTable != null)
                {
                    clientGameTable = GameTableModelConverter.ConvertFromServiceGameTableToClientGameTable(serviceGameTable);
                }
                return(clientGameTable);
            }
        }