/** * Performs the start-of-turn action according to where the currentPlayer * is located and the type of field. */ private void Action(FieldType fieldType, int diceRoll) { switch (fieldType) { case FieldType.PROPERTY: DefaultCardAction( (PropertyCard)propertyManager .CardAt(gameplan.PlayerPosition(currentPlayer)), -1); return; case FieldType.TREASURE: TreasureCard treasureCard = treasureCardManager.GetTreasureCard(); window.DisplayTreasureCard(treasureCard); currentPlayer.Money += treasureCard.MoneyChange; GameState = GameStage.SPECIAL_CARD; return; case FieldType.RISK: RiskCard riskCard = riskCardManager.GetRiskCard(); window.DisplayRiskCard(riskCard); if (PlayRiskCard(riskCard)) { GameState = GameStage.HOLIDAY; return; } GameState = GameStage.SPECIAL_CARD; return; case FieldType.START: currentPlayer.Money += START_BONUS; NextPlayer(); return; case FieldType.PRISON: GameState = GameStage.NO_ACTION; currentPlayer.Blocked += 3; currentPlayer.Prison = true; window.MovePlayer(playerTurnPointer, gameplan.GoToPrison(currentPlayer, playerTurnPointer)); window.ShowMessage("You are imprisoned for 3 turns!"); Thread.Sleep(2000); NextPlayer(); return; case FieldType.PARKING: window.ShowMessage("You are parking for 1 turn"); currentPlayer.Blocked += 2; GameState = GameStage.SPECIAL_FIELD; return; case FieldType.TAX: window.ShowMessage("Each of us has to pay taxes!"); if (currentPlayer.Money < TAX_PRICE) { window.ShowNoMoneyPay(); GameState = GameStage.NO_FUNDS_PAY; break; } currentPlayer.Money -= TAX_PRICE; GameState = GameStage.SPECIAL_FIELD; break; case FieldType.AGENCY: Player agencyOwner = GetOwner(currentPlayer); AgencyCard agencyCard = (AgencyCard)propertyManager .CardAt(gameplan.PlayerPosition(currentPlayer)); DefaultCardAction(agencyCard, diceRoll); break; case FieldType.TAX_FINE: window.ShowMessage("You have to pay taxes!"); if (currentPlayer.Money < TAX_FINE_COST) { window.ShowNoMoneyPay(); GameState = GameStage.NO_FUNDS_PAY; break; } currentPlayer.Money -= TAX_FINE_COST; GameState = GameStage.SPECIAL_FIELD; break; case FieldType.BONUS_PROPERTY: Player bonusOwner = GetOwner(currentPlayer); BonusCard bonusCard = (BonusCard)propertyManager .CardAt(gameplan.PlayerPosition(currentPlayer)); DefaultCardAction(bonusCard, 0); break; case FieldType.VISIT: window.ShowMessage("You are on a holiday and skip your turn."); GameState = GameStage.HOLIDAY; return; default: break; } }