|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.jgamegrid.Actor ch.aplu.jcardgame.CardCover
public class CardCover
Class that represents the cover (back) of a card (card with face down). This class derives from Actor and can be used as such. Be careful when overriding the act() method because it is used for the slide animation.
Field Summary |
---|
Fields inherited from class ch.aplu.jgamegrid.Actor |
---|
nbCycles |
Constructor Summary | |
---|---|
CardCover(GameGrid gameGrid,
Location location,
Deck deck,
double scaleFactor,
double rotationAngle)
Same as CardCover(gameGrid, location, deck, scaleFactor, rotationAngle, hide) with show = true. |
|
CardCover(GameGrid gameGrid,
Location location,
Deck deck,
double scaleFactor,
double rotationAngle,
boolean show)
Creates a transformed card cover actor from the seed actor of the first card in the given deck and adds it at the given location to the given game grid. |
Method Summary | |
---|---|
void |
act()
For internal use only. |
void |
putOnTop(boolean onTop)
Sets the card cover actor above or below any other card actors and card covers. |
void |
slideToTarget(Location targetLocation,
int slideStep,
boolean onTop,
boolean blocking)
Slides the card cover actor from the current location to the given target location using the given step. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CardCover(GameGrid gameGrid, Location location, Deck deck, double scaleFactor, double rotationAngle)
gameGrid
- the GameGrid referencelocation
- the location where the actor is showndeck
- the deck where to take the seed actorscaleFactor
- the scale factor (1: no scaling) applied to seed actorrotationAngle
- the rotation angle (in degrees, clockwise) applied
to the seed actorpublic CardCover(GameGrid gameGrid, Location location, Deck deck, double scaleFactor, double rotationAngle, boolean show)
gameGrid
- the GameGrid referencelocation
- the location where the actor is showndeck
- the deck where to take the seed actorscaleFactor
- the scale factor (1: no scaling) applied to seed actorrotationAngle
- the rotation angle (in degrees, clockwise) applied
to the seed actorshow
- if true, the actor is shown; otherwise it is hidden (use Actor.show()
or slideToTarget() to show it)Method Detail |
---|
public void slideToTarget(Location targetLocation, int slideStep, boolean onTop, boolean blocking)
targetLocation
- the location where the movement endsslideStep
- the number of moving steps in one simulation cycle;
if zero, the actor jumps immediately to the target locationonTop
- if true, the actor is shown on top of any other card actors;
otherwise it is shown below other card actors and card covers.blocking
- if true, the methods blocks until the actor arrives at the
target; otherwise the method returns immediatelypublic void act()
act
in class Actor
public void putOnTop(boolean onTop)
onTop
- if true, the actor is shown on top; otherwise it is
shown at bottom (the paint order is modified).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |