public class CardCover extends Actor
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
act()
For internal use only.
|
Location |
getLocation()
Returns the current virtual location (horizontal and vertical coordinates).
|
Location |
getLocationStart()
Returns the virtual start location (horizontal and vertical coordinates).
|
int |
getX()
Returns the current virtual horizontal coordinate.
|
int |
getXStart()
Returns the virtual x-coordinate of the start location.
|
int |
getY()
Returns the current virtual vertical coordinate.
|
int |
getYStart()
Returns the virtual y-coordinate of the start location.
|
void |
putOnTop(boolean onTop)
Sets the card cover actor above or below any other card actors and card covers.
|
void |
setLocation(Location location)
Assigns a new current virtual location.
|
void |
setX(int x)
Assigns a new current virtual horizontal cell coordinate.
|
void |
setY(int y)
Assigns a new current virtual vertical cell coordinate.
|
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.
|
addActorCollisionListener, addActorTouchListener, addActorTouchListener, addBorderListener, addCollisionActor, addCollisionActors, addCollisionTile, addCollisionTiles, addTileCollisionListener, collide, collide, containsPixel, delay, displace, getBackground, getCollisionActors, getCollisionActorsInRange, getCollisionTiles, getCurrentImage, getDirection, getDirectionStart, getDisplacePosition, getHeight, getIdVisible, getImage, getImage, getIntDirection, getLocationOffset, getNbCycles, getNbHorzCells, getNbSprites, getNbVertCells, getNeighbours, getNeighbours, getNextMoveLocation, getPixelColor, getPixelLocation, getRotatedImage, getRotatedPosition, getRotationIndex, getScaledImage, getScaledImage, getScaledImage, getSlowDown, getWidth, getZoomedImage, hide, isActEnabled, isActorCollisionEnabled, isHorzMirror, isInGrid, isMoveValid, isNearBorder, isRemoved, isRotatable, isTileCollisionEnabled, isVertMirror, isVisible, move, move, nearBorder, removeSelf, reset, rotate, rotate, setActEnabled, setActorCollisionEnabled, setActorTouchCircle, setActorTouchCircle, setActorTouchEnabled, setActorTouchImage, setActorTouchImage, setActorTouchRectangle, setActorTouchRectangle, setCollisionCircle, setCollisionCircle, setCollisionImage, setCollisionImage, setCollisionLine, setCollisionLine, setCollisionRectangle, setCollisionRectangle, setCollisionSpot, setCollisionSpot, setDirection, setDirection, setDisplacePosition, setHorzMirror, setLocationOffset, setLocationOffset, setOnBottom, setOnTop, setPixelLocation, setSlowDown, setTileCollisionEnabled, setVertMirror, show, show, showNextSprite, showPreviousSprite, turn
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 virtual 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)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 putOnTop(boolean onTop)
onTop
- if true, the actor is shown on top; otherwise it is
shown at bottom (the paint order is modified).public void setX(int x)
public void setY(int y)
public void setLocation(Location location)
setLocation
in class Actor
location
- the virtual location (value copy)public int getX()
public int getY()
public Location getLocation()
getLocation
in class Actor
public int getXStart()
public int getYStart()
public Location getLocationStart()
getLocationStart
in class Actor