private void HandleDrawCardCase(IPlayer player) { if (player.PlayerLocation.Group == PropertyGroup.Chance) { var card = cardHandler.DrawChanceCard(); if (card.GetType() == typeof (GetOutOfJailCard)) { player.AddGetOutOfJailCard(card); } CompleteCardTasks(player, card); Discard(card); } else if (player.PlayerLocation.Group == PropertyGroup.Chest) { ProcessCard(player, DrawChestCard()); } }
public void ProcessCard(IPlayer player, ICard card) { if (card.GetType() == typeof (GetOutOfJailCard)) { player.AddGetOutOfJailCard(card); } else { CompleteCardTasks(player, card); Discard(card); } }