|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunc.cdva.gameengine.managers.ItemManager
public class ItemManager
Item manager keeps track of the physical entities of the game such as projectiles, guns, and even players. It manages model objects and the game's state data.
Method Summary | |
---|---|
void |
addGun(Player player,
PdsBean gunPds)
Adds a gun with the given userId and PdsBean |
void |
addProjectile(Player player,
Problem problem)
Adds a projectile corresponding to the given gun with the given userValue |
void |
addRangeCar(Player player)
Adds a new rangeCar associated with some player. |
void |
addReticle(Player player,
Problem problem,
javax.vecmath.Vector3f position)
Creates a new reticle and add it to the list |
void |
checkHit(Projectile projectile)
Checks if the given projectile hits any of the targets |
void |
fire(Player player,
Problem problem)
Creates a new projectile and sets the position, direction, scale, and player input value Changes the direction of the gun to point toward the reticle and changes the state to reload |
long |
getAddToScore()
|
Gun |
getGun(Player player)
Gets the Gun object associated with a player. |
static ItemManager |
getInstance()
Gets an instance of the item manager. |
ItemsBean |
getItems()
Generate the ItemsBean sent to the graphics manager |
PathwayEnd |
getPathwayEnd()
|
Projectile |
getProjectile(Problem problem)
Finds the projectile associated with a given problem. |
RangeCar |
getRangeCar(Player player)
Returns a player's rangecar. |
Reticle |
getReticle(Problem problem)
Finds the reticle associated with some problem. |
java.util.Vector<Target> |
getTargets()
|
void |
initLevel(int level)
Set gun reload time, boat number, boat interval, boat speed using xml file |
boolean |
isEndGame()
|
boolean |
isEndLevel()
|
boolean |
isMovingTargets()
Checks if movingTargets is true or false |
boolean |
loadTargets()
Loads all the boats for the next level and creates a random position, direction, and scaling for each |
void |
move()
Updates all movable or changeable items during gameplay Checks if projectiles reach their destination Checks if a new target needs to start moving Checks if any targets hit the pathwayEnd or are hit by a projectile Checks if reticles or guns need to change state |
boolean |
removeGun(Player player)
Removes the gun with the given Player |
void |
removeProjectile(Problem problem)
Removes the projectile associated with some problem. |
boolean |
removeRangeCar(Player player)
Removes the rangeCar with the given player |
void |
removeReticle(Problem problem)
Removes the reticle with the given problem |
void |
setAddToScore(long addToScore)
|
void |
setMovingTargets(boolean movingTargets)
Sets the ItemsManager attribute of movingTargets to the given boolean value |
void |
setValue(Problem problem)
Change reticle state to wait for fire |
void |
startMovingTargets()
Sets movingTargets to true and resets the movingTime |
void |
stopMovingTargets()
Sets movingTargets to false |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ItemManager getInstance()
public void initLevel(int level)
level
- public void addGun(Player player, PdsBean gunPds)
player
- The player who 'owns' the gun.gunPds
- The initial position, scaling, and
direction of the gun.public boolean removeGun(Player player)
player
- owner of the gun
public Gun getGun(Player player)
player
- The player who's gun object we want.
java.lang.RuntimeException
- if there is no gun associated with the
player.public void addRangeCar(Player player)
player
- The player the rangeCar is associated
with.public boolean removeRangeCar(Player player)
player
- owner of the range car
public RangeCar getRangeCar(Player player)
player
- Each range car is associated with exactly
one player, this parameter is the player
who's rangecar we want.
public void addProjectile(Player player, Problem problem)
player
- owner of the gunproblem
- problen associated to the projectilepublic void removeProjectile(Problem problem)
problem
- The problem that is associated with the
projectile.public Projectile getProjectile(Problem problem)
problem
- The problem associated with the
projectile.
public void addReticle(Player player, Problem problem, javax.vecmath.Vector3f position)
player
- owner of the gunproblem
- associated problemposition
- position of the reticlepublic void removeReticle(Problem problem)
problem
- problem associated to the reticlepublic Reticle getReticle(Problem problem)
problem
- The problem associated with the reticle.
public void startMovingTargets()
public void stopMovingTargets()
public boolean isMovingTargets()
public void setMovingTargets(boolean movingTargets)
movingTargets
- public boolean loadTargets()
public void move()
public void checkHit(Projectile projectile)
projectile
- public void fire(Player player, Problem problem)
player
- problem
- public void setValue(Problem problem)
problem
- associated problempublic PathwayEnd getPathwayEnd()
public ItemsBean getItems()
public boolean isEndGame()
public boolean isEndLevel()
public long getAddToScore()
public void setAddToScore(long addToScore)
addToScore
- the addToScore to setpublic java.util.Vector<Target> getTargets()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |