public Pile getPile(CardEngine game) { for (int i = 0; i < game.playerCount; i++) { Player player = game.getPlayerAt(i); foreach (Pile pile in player.getPiles()) { if (pile.Contains(this)) { return(pile); } } } return(null); }