|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.event.KeyAdapter components.GameObject
public abstract class GameObject
GameObject is the most basic description of an object in gizmo ball. It is mutable and abstract.
name
: String // the name of the object
center
: Vect3 // the center of rotation of the object
velocity
: Vect3 // the velocity of the object
orientation
// the orientation of the object
gs
: GameSpace // the GameSpace that the object is in
shape
: Shape // the Shape of the object
targets
: set // the other GameObjects that this object affects
frozen
: boolean // whether the GameObject reponds to forces
Field Summary | |
---|---|
protected Vect3 |
center
|
protected double |
coRef
|
protected int |
delay
|
protected int |
depth
|
protected boolean |
frozen
|
protected GameSpace |
g
|
protected int |
height
|
protected String |
name
|
protected Angle |
orientAngle
|
protected Vect3 |
orientVect
|
protected boolean |
selected
|
protected Shape |
shape
|
protected Set<GameObject> |
targets
|
protected Vect3 |
velocity
|
protected boolean |
visible
|
protected int |
width
|
Constructor Summary | |
---|---|
GameObject(Map<String,String> props,
GameSpace gs)
|
|
GameObject(Vect3 tlf,
Vect3 ov,
Angle oa,
String name,
GameSpace g)
|
|
GameObject(Vect3 tlf,
Vect3 velocity,
Vect3 ov,
Angle oa,
String name,
GameSpace g)
|
Method Summary | |
---|---|
void |
action()
Schedules actionPerformed() to happen after this.delay |
void |
actionPerformed(ActionEvent e)
This is overriden in objects where something actually occurs when triggered, for example, Flippers |
void |
addTarget(GameObject obj)
|
void |
clearTargets()
|
protected Map<String,String> |
defaults()
sets all the defaults for this class. |
boolean |
equals(Object go)
|
void |
getBasicPropertyMap(Map<String,String> m)
changes the map to represent the values of this GameObject required by the xml spec |
PhysicsShape |
getBounds()
|
Vect3 |
getCenter()
get the center of rotation of the object |
double |
getCoRef()
|
int |
getDelay()
|
int |
getDepth()
|
Vect3 |
getDiff()
Difference between TLF and center. |
GameSpace |
getGameSpace()
|
abstract GameObjectClassification |
getGOClassification()
Requires that all obejects return their own classification |
int |
getHeight()
|
String |
getName()
|
Vect3 |
getNonRoundedTLF()
gets the top-left-front corner, no rounding |
abstract Set<Vect3> |
getOccupiedPositions()
|
Angle |
getOrientAngle()
|
Vect3 |
getOrientVector()
|
Vect3 |
getRoundedTLF()
convenience method -- getTLF() is rounded |
Shape |
getShape()
|
Set<GameObject> |
getTargets()
|
Vect3 |
getTLF()
gets the top-left-front corner, rounded for double precision things |
Vect3 |
getVelocity()
|
int |
getWidth()
|
int |
hashCode()
|
boolean |
isFrozen()
|
boolean |
isSelected()
|
boolean |
isVisible()
|
void |
onCollision(GameObject projectile)
|
static void |
putInVect3(Vect3 v,
Map<String,String> m,
String title)
Convience overload of putInVect3, this prevents rounding |
static void |
putInVect3(Vect3 v,
Map<String,String> m,
String title,
boolean round)
Given a property map, a vector, and a string, adds the keys x + title, y + title, and z + title with the corresponding values from v, to m |
boolean |
removeTarget(GameObject t)
|
void |
setCenter(Vect3 c)
|
void |
setCoRef(double coRef)
|
void |
setDelay(int d)
|
void |
setDepth(int depth)
|
void |
setFrozen(boolean frozen)
|
void |
setHeight(int height)
|
void |
setOrientAngle(Angle newAngle)
|
void |
setOrientVect(Vect3 newVect)
|
protected void |
setProperty(String s1,
String s2)
|
void |
setSelected(boolean s)
|
void |
setTLF(Vect3 tlf)
Set the top-left-front corner of the object |
void |
setVelocity(Vect3 newVel)
|
void |
setVisible(boolean visible)
|
void |
setWidth(int width)
|
protected abstract Shape |
shape()
the Shape of the object |
void |
stepFrame()
This is overriden in mobile objects |
String |
toString()
string representation of this object. |
Methods inherited from class java.awt.event.KeyAdapter |
---|
keyPressed, keyReleased, keyTyped |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected GameSpace g
protected Vect3 center
protected Vect3 orientVect
protected Angle orientAngle
protected Vect3 velocity
protected Shape shape
protected String name
protected double coRef
protected boolean visible
protected boolean frozen
protected int width
protected int height
protected int depth
protected int delay
protected Set<GameObject> targets
protected boolean selected
Constructor Detail |
---|
public GameObject(Vect3 tlf, Vect3 ov, Angle oa, String name, GameSpace g)
public GameObject(Map<String,String> props, GameSpace gs)
public GameObject(Vect3 tlf, Vect3 velocity, Vect3 ov, Angle oa, String name, GameSpace g)
Method Detail |
---|
protected Map<String,String> defaults()
protected void setProperty(String s1, String s2)
public Vect3 getDiff()
protected abstract Shape shape()
public Vect3 getTLF()
public Vect3 getNonRoundedTLF()
public Vect3 getRoundedTLF()
public void setTLF(Vect3 tlf)
public Vect3 getVelocity()
public void setVelocity(Vect3 newVel)
public GameSpace getGameSpace()
public String getName()
public Vect3 getCenter()
public void setCenter(Vect3 c)
public Angle getOrientAngle()
public void setOrientAngle(Angle newAngle)
public Vect3 getOrientVector()
public void setOrientVect(Vect3 newVect)
public Set<GameObject> getTargets()
public void addTarget(GameObject obj)
public void clearTargets()
public boolean removeTarget(GameObject t)
public void stepFrame()
public void action()
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void onCollision(GameObject projectile)
public int hashCode()
hashCode
in class Object
public boolean equals(Object go)
equals
in class Object
public Shape getShape()
public PhysicsShape getBounds()
public boolean isVisible()
public void setVisible(boolean visible)
visible
- the visible to setpublic boolean isFrozen()
public void setFrozen(boolean frozen)
frozen
- the frozen to setpublic void getBasicPropertyMap(Map<String,String> m)
public static void putInVect3(Vect3 v, Map<String,String> m, String title, boolean round)
public static void putInVect3(Vect3 v, Map<String,String> m, String title)
public abstract GameObjectClassification getGOClassification()
public abstract Set<Vect3> getOccupiedPositions()
public boolean isSelected()
public void setSelected(boolean s)
public int getDepth()
public void setDepth(int depth)
depth
- the depth to setpublic int getHeight()
public void setHeight(int height)
public int getWidth()
public void setWidth(int width)
public void setDelay(int d)
public int getDelay()
public String toString()
toString
in class Object
public double getCoRef()
public void setCoRef(double coRef)
coRef
- the coRef to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |