com.TeamHEC.LocomotionCommotion.Card
Class CardFactory

java.lang.Object
  extended by com.TeamHEC.LocomotionCommotion.Card.CardFactory

public class CardFactory
extends java.lang.Object

Author:
Callum Hewitt This class generates Cards for the players. Cards can be resource cards which give new resources. Or magic cards which produce a variety of fun effects. These include teleporting trains and increasing train speeds.

Constructor Summary
CardFactory(Player player)
          The initialiser.
 
Method Summary
 Card createAnyCard()
          Creates a random card from either the magicCardList or resourceCardList.
 Card createMagicCard()
          Creates a random card from the set of magic cards.
 Card createResourceCard()
          Creates a random card from the set of resource cards.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CardFactory

public CardFactory(Player player)
The initialiser. Creates the lists of magic cards and resource cards. Add new cards here to allow them to be generated.

Parameters:
player - The player that you want to generate Cards for.
Method Detail

createAnyCard

public Card createAnyCard()
Creates a random card from either the magicCardList or resourceCardList.

Returns:
A Card object from either magicCardList or resourceCardList.

createResourceCard

public Card createResourceCard()
Creates a random card from the set of resource cards.

Returns:
A resource Card object.

createMagicCard

public Card createMagicCard()
Creates a random card from the set of magic cards.

Returns:
A magic Card object.