コード例 #1
0
    public static GameSettings Make(GameConfigs configs)
    {
        eGame gameType = configs._gameType;

        if (gameType == eGame.Sandbox)
        {
            return(new GameSettings(configs));
        }
        else if (gameType == eGame.Exodus)
        {
            return(new GameSettings(eGame.Exodus,
                                    eEndCondition.Survival,
                                    new MapSettings(configs._mapConfigs),
                                    PlayerSettings.ExodusSettings(),
                                    TickSettings.ExodusSettings()));
        }
        else if (gameType == eGame.HotSeat)
        {
            return(new GameSettings(eGame.HotSeat,
                                    eEndCondition.LastOneStanding,
                                    MapSettings.HotseatSettings(),
                                    new PlayerSettings(configs._playerConfigs),
                                    TickSettings.HotseatSettings()));
        }
        else
        {
            throw new System.NotImplementedException();
        }
    }
コード例 #2
0
    public GameSettings(GameConfigs configs)
    {
        _gameType = configs._gameType;

        _endCondition = configs._endCondition;

        _mapSettings = new MapSettings(configs._mapConfigs);

        _playerSettings = new PlayerSettings(configs._playerConfigs);

        _tickSettings = new TickSettings(configs._tickConfigs);
    }
コード例 #3
0
    public GameSettings(eGame gameType, eEndCondition endCondition, MapSettings map, PlayerSettings player, TickSettings tick)
    {
        _gameType = gameType;

        _endCondition = endCondition;

        _mapSettings = map;

        _playerSettings = player;

        _tickSettings = tick;
    }
コード例 #4
0
    public void SetGame(eGame Game)
    {
        CurGame = GameObject.Instantiate(Resources.Load("Prefabs/Object/Manager/GameManager") as GameObject) as GameObject;

        switch (Game)
        {
        case eGame.BASEBALL:
            Baseball baseball = CurGame.AddComponent <Baseball>();
            baseball.Init();
            break;

        case eGame.DIALSAFE:
            DialSafe dialsafe = CurGame.AddComponent <DialSafe>();
            dialsafe.Init();
            break;
        }
    }
コード例 #5
0
ファイル: FGame.cs プロジェクト: NickSchade/SeagullEngine
    static GameSettings GetGameSettingsForGame(GameSettings settings)
    {
        eGame gameType = settings._gameType;

        if (gameType == eGame.Sandbox)
        {
            // DO NOTHING
        }
        else if (gameType == eGame.Exodus)
        {
            settings._mapSettings._mapType = eMap.Gaea;
        }
        else if (gameType == eGame.HotSeat)
        {
            settings._tickSettings._type = eTickSystem.TurnBased;
        }
        return(settings);
    }
コード例 #6
0
    public static HomelandsLocation Make(HomelandsGame game, Pos position, HomelandsTerrain terrain, HomelandsResource resource)
    {
        eGame gameType = game._settings._gameType;

        if (gameType == eGame.Exodus)
        {
            return(new ExodusLocation(game, position, terrain, resource));
        }
        else if (gameType == eGame.Sandbox)
        {
            return(new SandboxLocation(game, position, terrain, resource));
        }
        else
        {
            return(new SandboxLocation(game, position, terrain, resource));
            //throw new KeyNotFoundException();
        }
    }
コード例 #7
0
ファイル: FGame.cs プロジェクト: NickSchade/SeagullEngine
    public static HomelandsGame Make(GameManager gameManager, GameSettings settings)
    {
        eGame gameType = settings._gameType;

        settings = GetGameSettingsForGame(settings);
        if (gameType == eGame.Exodus)
        {
            return(new ExodusGame(gameManager, settings));
        }
        else if (gameType == eGame.Sandbox)
        {
            return(new SandboxGame(gameManager, settings));
        }
        else
        {
            return(new SandboxGame(gameManager, settings));
            //throw new System.NotImplementedException();
        }
    }
コード例 #8
0
    public static HomelandsStructure Make(HomelandsGame game, dStructurePlacement data)
    {
        eGame gameType = game._settings._gameType;

        Debug.Log($@"Created Structure({gameType})");

        if (gameType == eGame.Exodus)
        {
            return(new ExodusStructure(game, data));
        }
        else if (gameType == eGame.Sandbox)
        {
            return(new SandboxStructure(game, data));
        }
        else
        {
            return(new SandboxStructure(game, data));
            //throw new System.NotImplementedException();
        }
    }