public class RewardState
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
int |
locX |
|
int |
locY |
|
static long |
startLaserTime |
|
static long |
startShieldTime |
Constructor | Description |
---|---|
RewardState(WallState wallState) |
create a reward randomly
|
Modifier and Type | Method | Description |
---|---|---|
int |
chooseRandomReward() |
choose A NUMBER randomly to choose the reward randomly
|
java.awt.Image |
getRewardImage() |
|
boolean |
isRewardForTank(int x,
int y) |
check that tank can get the reward or not
|
boolean |
isVisible() |
check that reward is visible or not
|
void |
runReward(TankState tankState) |
run the chosen reward
|
void |
setVisible(boolean visible) |
set the visibility of the rewards
|
public int locX
public int locY
public static long startShieldTime
public static long startLaserTime
public RewardState(WallState wallState)
wallState
- public int chooseRandomReward()
public java.awt.Image getRewardImage() throws java.io.IOException
java.io.IOException
public void runReward(TankState tankState)
tankState
- public boolean isRewardForTank(int x, int y)
x
- is the x of tanky
- is the y of tankpublic boolean isVisible()
public void setVisible(boolean visible)