card_hand_sprites[0] = new CardHandSprite(data);
card_hand_sprites[0].SetCardClickListener(new CardClickListener()
{
@Override public void OnClick(Card c)
{
Player p = game.GetPlayers()[0];
if(p instanceof HumanPlayer)
{
if(game.GetPhase() == Phase.PLAY)
((HumanPlayer)p).SetCardToPut(c);
else if(game.GetPhase() == Phase.REMOVE_SPARE_CARDS)
((HumanPlayer)p).RemoveSpareCard(c);
}
}
});
surface.AddSprite(card_hand_sprites[0]);
card_hand_sprites[1] = new CardHandSprite(data);
card_hand_sprites[1].SetCardClickListener(new CardClickListener()
{
@Override public void OnClick(Card c)
{
Player p = game.GetPlayers()[1];
if(p instanceof HumanPlayer)
{
if(game.GetPhase() == Phase.PLAY)
((HumanPlayer)p).SetCardToPut(c);
else if(game.GetPhase() == Phase.REMOVE_SPARE_CARDS)