コード例 #1
0
        public void SaveGame(GameDTO gamedto)
        {
            Game game = mapper.Map <GameDTO, Game>(gamedto);

            Games.Create(game);
            uow.Save();
        }
コード例 #2
0
        internal GameBase CreateGame(GPlayer player, GameInformation GameData)
        {
            if (Games.Limit)
            {
                player.SendResponse(TGAME_CREATE_RESULT.CREATE_GAME_CREATE_FAILED2.ShowRoomError());
                return(null);
            }

            GameBase result = null;

            switch (GameData.GameType)
            {
            case GAME_TYPE.VERSUS_STROKE:
            case GAME_TYPE.VERSUS_MATCH:
            {
            }
            break;

            case GAME_TYPE.CHAT_ROOM:
            {
                result = new ModeChatRoom(player, GameData, CreateGameEvent, UpdateGameEvent, DestroyGame, PlayerJoinGameEvent, PlayerLeaveGameEvent, Games.GetID);
            }
            break;

            case GAME_TYPE.GAME_TYPE_03:
            {
                player.SendResponse(TGAME_CREATE_RESULT.CREATE_GAME_CANT_CREATE.ShowRoomError());
            }
            break;

            case GAME_TYPE.TOURNEY:
            {
            }
            break;

            case GAME_TYPE.TOURNEY_TEAM:
            {
            }
            break;

            case GAME_TYPE.TOURNEY_GUILD:
            {
            }
            break;

            case GAME_TYPE.PANG_BATTLE:
            {
                player.SendResponse(TGAME_CREATE_RESULT.CREATE_GAME_CANT_CREATE.ShowRoomError());
            }
            break;

            case GAME_TYPE.GAME_TYPE_08:
            {
            }
            break;

            case GAME_TYPE.GAME_TYPE_09:
            {
            }
            break;

            case GAME_TYPE.GAME_APROACH:
            {
                player.SendResponse(TGAME_CREATE_RESULT.CREATE_GAME_CANT_CREATE.ShowRoomError());
            }
            break;

            case GAME_TYPE.GM_EVENT:
            {
            }
            break;

            case GAME_TYPE.GAME_TYPE_0C:
            {
            }
            break;

            case GAME_TYPE.GAME_ZOD_OFF:
            {
            }
            break;

            case GAME_TYPE.CHIP_IN_PRACTICE:
            {
            }
            break;

            case GAME_TYPE.GAME_TYPE_0F:
            {
            }
            break;

            case GAME_TYPE.GAME_TYPE_10:
            {
            }
            break;

            case GAME_TYPE.GAME_TYPE_11:
            {
            }
            break;

            case GAME_TYPE.SSC:
            {
            }
            break;

            case GAME_TYPE.HOLE_REPEAT:
            {
                result = new PracticeMode(player, GameData, CreateGameEvent, UpdateGameEvent, DestroyGame, PlayerJoinGameEvent, PlayerLeaveGameEvent, Games.GetID);
            }
            break;

            case GAME_TYPE.GRANDPRIX:
            {
            }
            break;
            }

            if (result == null)
            {
                player.SendResponse(TGAME_CREATE_RESULT.CREATE_GAME_CANT_CREATE.ShowRoomError());
            }
            else
            {
                Games.Create(result);
            }
            return(result);
        }
コード例 #3
0
ファイル: GameController.cs プロジェクト: won5572/BoardGames
 public Task <Game> Create([FromBody] Game.CreateCommand command, CancellationToken cancellationToken = default)
 {
     command.UseDefaultSession(SessionResolver);
     return(Games.Create(command, cancellationToken));
 }
コード例 #4
0
ファイル: Lobby.cs プロジェクト: luismk/Pangya-Server-Source
        internal GameBase CreateGame(Session player, GameInformation GameData)
        {
            if (Games.Limit)
            {
                player.SendResponse(Creator.ShowRoomError(GameCreateResultFlag.CREATE_GAME_CREATE_FAILED2));
                return(null);
            }

            GameBase result = null;

            switch (GameData.GameType)
            {
            case GameTypeFlag.VERSUS_STROKE:
            case GameTypeFlag.VERSUS_MATCH:
            {
                //  result = new ModeVersus(player, GameData, CreateGameEvent, UpdateGameEvent, DestroyGame, PlayerJoinGameEvent, PlayerLeaveGameEvent, Games.GetID);
            }
            break;

            case GameTypeFlag.TOURNEY_TEAM:
            case GameTypeFlag.TOURNEY:
            {
                //result = new ModeTorney(player, GameData, CreateGameEvent, UpdateGameEvent, DestroyGame, PlayerJoinGameEvent, PlayerLeaveGameEvent, Games.GetID);
            }
            break;

            case GameTypeFlag.CHAT_ROOM:
            {
                // result = new ModeChatRoom(player, GameData, CreateGameEvent, UpdateGameEvent, DestroyGame, PlayerJoinGameEvent, PlayerLeaveGameEvent, Games.GetID);
            }
            break;

            case GameTypeFlag.TOURNEY_GUILD:
            {
                //  result = new ModeGuildBattle(player, GameData, CreateGameEvent, UpdateGameEvent, DestroyGame, PlayerJoinGameEvent, PlayerLeaveGameEvent, Games.GetID);
            }
            break;

            case GameTypeFlag.GM_EVENT:
            {
                //  result = new ModeGMEvent(player, GameData, CreateGameEvent, UpdateGameEvent, DestroyGame, PlayerJoinGameEvent, PlayerLeaveGameEvent, Games.GetID);
            }
            break;

            case GameTypeFlag.CHIP_IN_PRACTICE:
            {
                //  result = new ModeChipInPractice(player, GameData, CreateGameEvent, UpdateGameEvent, DestroyGame, PlayerJoinGameEvent, PlayerLeaveGameEvent, Games.GetID);
            }
            break;

            case GameTypeFlag.SSC:
            {
                //  result = new ModeSSC(player, GameData, CreateGameEvent, UpdateGameEvent, DestroyGame, PlayerJoinGameEvent, PlayerLeaveGameEvent, Games.GetID);
            }
            break;

            case GameTypeFlag.HOLE_REPEAT:
            {
                // result = new ModePractice(player, GameData, CreateGameEvent, UpdateGameEvent, DestroyGame, PlayerJoinGameEvent, PlayerLeaveGameEvent, Games.GetID);
            }
            break;

            default:
            {
                player.SendResponse(Creator.ShowRoomError(GameCreateResultFlag.CREATE_GAME_CANT_CREATE));
                return(null);
            }
            }
            Games.Create(result);
            return(result);
        }