Class RecycleDisplay
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.rendering.RenderComponent
com.deco2800.game.ui.UIComponent
com.deco2800.game.components.foodAndwater.RecycleDisplay
- All Implemented Interfaces:
Disposable
,Renderable
,java.lang.Comparable<Renderable>
public class RecycleDisplay extends UIComponent
A ui component for displaying recycle system.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RecycleDisplay.recycleState
-
Field Summary
Fields Modifier and Type Field Description static boolean
isKey
static java.util.ArrayList<Image>
recycleIcon
static int
recycleNumber
static RecycleDisplay.recycleState
recycleState
static Table
table
-
Constructor Summary
Constructors Constructor Description RecycleDisplay()
-
Method Summary
Modifier and Type Method Description void
create()
Creates reusable recycle ui styles and adds actors to the stage.void
dispose()
remove recycleIcon by useing a for loopvoid
draw(SpriteBatch batch)
Draw the renderable.void
update()
Called once per frame of the game, and should be used for most component logic.void
updateRecyleIconUI(int dis)
Updates the recycle ui time by time conditions, pick up an item.Methods inherited from class com.deco2800.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Field Details
-
recycleState
-
table
-
recycleIcon
-
recycleNumber
public static int recycleNumber -
isKey
public static boolean isKey
-
-
Constructor Details
-
RecycleDisplay
public RecycleDisplay()
-
-
Method Details
-
create
public void create()Creates reusable recycle ui styles and adds actors to the stage. And starts the counting the time.- Overrides:
create
in classUIComponent
-
draw
Description copied from class:RenderComponent
Draw the renderable. Should be called only by the renderer, not manually.- Specified by:
draw
in classRenderComponent
- Parameters:
batch
- Batch to render to.
-
update
public void update()Description copied from class:Component
Called once per frame of the game, and should be used for most component logic. Not called if component is disabled. -
updateRecyleIconUI
public void updateRecyleIconUI(int dis)Updates the recycle ui time by time conditions, pick up an item. -
dispose
public void dispose()remove recycleIcon by useing a for loop- Specified by:
dispose
in interfaceDisposable
- Overrides:
dispose
in classRenderComponent
-