com.TeamHEC.LocomotionCommotion.Card
Class CardActor

java.lang.Object
  extended by com.badlogic.gdx.scenes.scene2d.Actor
      extended by com.TeamHEC.LocomotionCommotion.Card.CardActor

public class CardActor
extends com.badlogic.gdx.scenes.scene2d.Actor

Author:
Robert Precious This is the Class for the card actor, It functions the same way as Sprite/SpriteButton.

Constructor Summary
CardActor(com.badlogic.gdx.graphics.Texture texture, int actorX, int actorY, boolean empty, int slot)
           
 
Method Summary
 void act(float delta)
           
 void cardCollapse()
          cardCollapse- if the card is expanded: resets the height of the card depending on whether or not the resource bar is expanded sets the expanded boolean, refreshes the action area and calls organiseDeck OR just resets the height when the resource bar changes.
 void cardExpand()
          cardExpand- Calls Organize deck, moves the card up, updates the expanded boolean, and refreshes bounds.
 void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float alpha)
           
 Card getCard()
          returns the selected card
 int getSlot()
          Returns the slot the card is in
 com.badlogic.gdx.graphics.Texture getTexture()
          Returns the texture of the card
 boolean isExpanded()
          Gets if the card is expanded
 void refreshBounds()
           
 void setActorY(float y)
          Set the y coordinate of the card
 void setCard(Card card)
          Sets the selected card
 void setEmpty(boolean b)
          Sets if the slot is empty
 void setexpanded(boolean open)
          Setter for if the card is expanded
 void setSlot(int slot)
          Set the slot the card is in
 void setTexture(com.badlogic.gdx.graphics.Texture texture)
          Sets the texture for the card
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor
addAction, addCaptureListener, addListener, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebug, fire, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasParent, hit, isAscendantOf, isDescendantOf, isTouchable, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotateBy, scaleBy, scaleBy, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CardActor

public CardActor(com.badlogic.gdx.graphics.Texture texture,
                 int actorX,
                 int actorY,
                 boolean empty,
                 int slot)
Method Detail

refreshBounds

public void refreshBounds()

draw

public void draw(com.badlogic.gdx.graphics.g2d.Batch batch,
                 float alpha)
Overrides:
draw in class com.badlogic.gdx.scenes.scene2d.Actor

act

public void act(float delta)
Overrides:
act in class com.badlogic.gdx.scenes.scene2d.Actor

isExpanded

public boolean isExpanded()
Gets if the card is expanded

Returns:
expanded

setexpanded

public void setexpanded(boolean open)
Setter for if the card is expanded

Parameters:
open -

getCard

public Card getCard()
returns the selected card

Returns:
Card

setCard

public void setCard(Card card)
Sets the selected card

Parameters:
card -

setTexture

public void setTexture(com.badlogic.gdx.graphics.Texture texture)
Sets the texture for the card

Parameters:
texture -

getTexture

public com.badlogic.gdx.graphics.Texture getTexture()
Returns the texture of the card

Returns:
Texture

getSlot

public int getSlot()
Returns the slot the card is in

Returns:
Slot

setSlot

public void setSlot(int slot)
Set the slot the card is in

Parameters:
slot -

setActorY

public void setActorY(float y)
Set the y coordinate of the card

Parameters:
y -

setEmpty

public void setEmpty(boolean b)
Sets if the slot is empty

Parameters:
b -

cardExpand

public void cardExpand()
cardExpand- Calls Organize deck, moves the card up, updates the expanded boolean, and refreshes bounds.


cardCollapse

public void cardCollapse()
cardCollapse- if the card is expanded: resets the height of the card depending on whether or not the resource bar is expanded sets the expanded boolean, refreshes the action area and calls organiseDeck OR just resets the height when the resource bar changes.