lane.sente
Class Turret

java.lang.Object
  |
  +--lane.sente.Turret

public class Turret
extends java.lang.Object

The purpose of this class is to hold information about turret aim It is also to determine (given a location) if another Element is in view It can also "fire" a projectile by giving it a position and speed


Constructor Summary
Turret(Location loc)
          the contructor for the turret
 
Method Summary
 boolean canSee(GameElement ele)
          decides if the turret is capable of seeing that particular element (note: it does not have enough information to determine visibility such as if that element is obstructed)
 int getxAim()
          the method used to retrieve the degree value of the turret
 int getzAim()
          the method used to retrieve the degree value of the turret
 void setProjectileMomentum(GameElement e, int speed)
          method used to set the x,y,and z speed of a projectile shot from this turret
 void setxAim(int i)
          the method used to set the aim of the turret in the x Axis
 void setzAim(int i)
          the method used to set the aim of the turret in the x Axis
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Turret

public Turret(Location loc)
the contructor for the turret
Parameters:
loc - The location that this turret is "looking" from
Method Detail

setxAim

public void setxAim(int i)
the method used to set the aim of the turret in the x Axis
Parameters:
i - an int (0-360) signifying the degree to look at

setzAim

public void setzAim(int i)
the method used to set the aim of the turret in the x Axis
Parameters:
i - an int (0-360) signifying the degree to look at

getxAim

public int getxAim()
the method used to retrieve the degree value of the turret
Returns:
an int (0-360) showing where the turret is looking along the X axis

getzAim

public int getzAim()
the method used to retrieve the degree value of the turret
Returns:
an int (0-360) showing where the turret is looking along the X axis

canSee

public boolean canSee(GameElement ele)
decides if the turret is capable of seeing that particular element (note: it does not have enough information to determine visibility such as if that element is obstructed)
Parameters:
ele - The other element to check for intersection with Turret's LOS
Returns:
boolean value based on if the element is in the LOS

setProjectileMomentum

public void setProjectileMomentum(GameElement e,
                                  int speed)
method used to set the x,y,and z speed of a projectile shot from this turret
Parameters:
e - The element being shot
speed - The speed that the element should move at