Package it.polimi.ingsw.model.market
Class MarketMarble
java.lang.Object
it.polimi.ingsw.model.market.MarketMarble
- Direct Known Subclasses:
NormalMarble,RedMarble,WhiteMarble
public abstract class MarketMarble
extends java.lang.Object
Represents a generic market marble
-
Constructor Summary
Constructors Modifier Constructor Description protectedMarketMarble(MarbleColor color) -
Method Summary
Modifier and Type Method Description abstract voidaddResource(InterfacePlayerBoard playerBoard)Adds the resources owed to the player due to this marble possibly converting it with the player's leader cardsvoidaddResource(InterfacePlayerBoard playerBoard, LeaderCard leaderCard)Adds the resources owed to the player due to this marble converted using the specified leader card if it can be converted, otherwise the default resources corresponding to this marbleMarbleColorgetColor()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MarketMarble
-
-
Method Details
-
addResource
public abstract void addResource(InterfacePlayerBoard playerBoard) throws NotEnoughSpaceException, MoreWhiteLeaderCardsExceptionAdds the resources owed to the player due to this marble possibly converting it with the player's leader cards- Parameters:
playerBoard- the player board of the player to whom the resources belong- Throws:
NotEnoughSpaceException- there isn't enough space in the warehouse to add this resourceMoreWhiteLeaderCardsException- the player has more than one leader card that can modify this type of marble
-
addResource
public void addResource(InterfacePlayerBoard playerBoard, LeaderCard leaderCard) throws NotEnoughSpaceException, WrongLeaderCardExceptionAdds the resources owed to the player due to this marble converted using the specified leader card if it can be converted, otherwise the default resources corresponding to this marble- Parameters:
playerBoard- the player board of the player to whom the resources belongleaderCard- the leader card that must be used to convert this marble, if this marble can't be converted this parameter will be ignored- Throws:
NotEnoughSpaceException- there isn't enough space in the warehouse to add this resourceWrongLeaderCardException- this type of marble must be converted, but the specified leader card don't convert itjava.lang.NullPointerException- this type of marble must be converted, but the specified leader card is null
-
getColor
-