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(); } }
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); }
public GameSettings(eGame gameType, eEndCondition endCondition, MapSettings map, PlayerSettings player, TickSettings tick) { _gameType = gameType; _endCondition = endCondition; _mapSettings = map; _playerSettings = player; _tickSettings = tick; }
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; } }
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); }
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(); } }
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(); } }
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(); } }