public GameObject(GameTable gameTable, GameEndingCondition gameEndingCondition) { this.gameTable = gameTable; this.gameEndingCondition = gameEndingCondition; this.playedRoundCount = 0; ScoreBoard.ResetScores(); }
/// <summary> /// Room Owner will send a Callback to this method after receiving feedback from all the players /// </summary> public void PlayersReadyCallback() { if (LobbyPlayerStats.RoomData.getRoomOwner() == MultiplayerManager.StaticPlayer.GetInternalPlayer().PlayerName) { MultiplayerManager.SendBytes(ByteHelper.GetBytes("START")); } GameEndingCondition gameEndingCondition = null; switch (MultiplayerManager.CurrentEndCondition) { case GameMode.TargetScore: gameEndingCondition = new TargetScoreCondition(new object[1] { MultiplayerManager.CurrentEndConditionGoal }); break; case GameMode.RoundCount: object[] roundCountConditionParams = new object[2]; roundCountConditionParams[0] = this; roundCountConditionParams[1] = MultiplayerManager.CurrentEndConditionGoal; gameEndingCondition = new RoundCountCondition(roundCountConditionParams); break; } game = new UnityGame(this, gameEndingCondition); game.Commence(UITable.MultiplayerGamers.GetPlayerByPlayerName(LobbyPlayerStats.RoomData.getRoomOwner()).GetPlayersSeat()); state = GameState.PLAYING; }
public override void InitializeGame() { GameEndingCondition gameEndingCondition = null; switch (gameMode) { case GameMode.TargetScore: gameEndingCondition = new TargetScoreCondition(modeParams); break; case GameMode.RoundCount: object[] roundCountConditionParams = new object[modeParams.Length + 1]; roundCountConditionParams[0] = game; modeParams.CopyTo(roundCountConditionParams, 1); gameEndingCondition = new RoundCountCondition(modeParams); break; } // HANDLE PLAYER ACTIONS // Deck mainDeck = new Deck(); List <Card>[] splittedCards = mainDeck.Deal(); for (int i = 0; i < 4; i++) { Deck newPlayerDeck = new Deck(splittedCards[i]); seats[i].SetPlayersDeck(newPlayerDeck); } game = new ConsoleGame(this, gameEndingCondition); game.Commence(); state = GameState.PLAYING; }
public virtual void InitializeGame() { GameEndingCondition gameEndingCondition = null; switch (gameMode) { case GameMode.TargetScore: gameEndingCondition = new TargetScoreCondition(modeParams); break; case GameMode.RoundCount: object[] roundCountConditionParams = new object[modeParams.Length + 1]; roundCountConditionParams[0] = game; modeParams.CopyTo(roundCountConditionParams, 1); gameEndingCondition = new RoundCountCondition(modeParams); break; } DealCards(); UpdatePlayerDeckValues(); game = new GameObject(this, gameEndingCondition); game.Commence(); state = GameState.PLAYING; }
public override void InitializeGame() { if (Properties.ActiveGameType == GameType.SinglePlayer) { GameEndingCondition gameEndingCondition = null; switch (gameMode) { case GameMode.TargetScore: gameEndingCondition = new TargetScoreCondition(modeParams); break; case GameMode.RoundCount: object[] roundCountConditionParams = new object[modeParams.Length + 1]; roundCountConditionParams[0] = this; modeParams.CopyTo(roundCountConditionParams, 1); gameEndingCondition = new RoundCountCondition(modeParams); break; } DealCards(); UpdatePlayerDeckValues(); game = new UnityGame(this, gameEndingCondition); game.Commence(); state = GameState.PLAYING; } else { if (LobbyPlayerStats.RoomData.getRoomOwner() == MultiplayerManager.StaticPlayer.GetInternalPlayer().PlayerName) { MultiplayerManager.DealCallback = 0; DealCards(); UpdatePlayerDeckValues(); } } }
public ConsoleGame(GameTable gameTable, GameEndingCondition gameEndingCondition) : base(gameTable, gameEndingCondition) { gameEnded = false; }
public UnityGame(GameTable gameTable, GameEndingCondition gameEndingCondition) : base(gameTable, gameEndingCondition) { }