LazyLib

org.lazywizard.lazylib.combat.entities
Class SimpleEntity

Object
  extended by SimpleEntity
All Implemented Interfaces:
CombatEntityAPI

public class SimpleEntity
extends Object

A bare-bones implementation of CombatEntityAPI, mostly useful for decorative EMP arc targeting. These entities do not actually exist on the battle map, so most other methods that take a CombatEntityAPI will fail if you use one of these as a parameter.

Since:
1.4
Author:
LazyWizard

Nested Class Summary
static class SimpleEntity.SimpleEntityType
           
 
Constructor Summary
SimpleEntity(Object toFollow)
          Creates a CombatEntityAPI that mimics the location of another object that contains a getLocation() method.
SimpleEntity(Vector2f location)
          Creates a CombatEntityAPI that stays in a single, predefined location.
SimpleEntity(WeaponAPI weapon)
          Creates a CombatEntityAPI that mimics the location of a WeaponAPI.
 
Method Summary
 float getAngularVelocity()
          NONFUNCTIONAL/PLACEHOLDER
 CollisionClass getCollisionClass()
          NONFUNCTIONAL/PLACEHOLDER
 float getCollisionRadius()
          NONFUNCTIONAL/PLACEHOLDER
 BoundsAPI getExactBounds()
          NONFUNCTIONAL/PLACEHOLDER
 float getFacing()
          NONFUNCTIONAL/PLACEHOLDER
 float getHitpoints()
          NONFUNCTIONAL/PLACEHOLDER
 float getHullLevel()
          NONFUNCTIONAL/PLACEHOLDER
 Vector2f getLocation()
          Returns the location this SimpleEntity is mimicking.
 float getMass()
          NONFUNCTIONAL/PLACEHOLDER
 float getMaxHitpoints()
          NONFUNCTIONAL/PLACEHOLDER
 int getOwner()
          NONFUNCTIONAL/PLACEHOLDER
 ShieldAPI getShield()
          NONFUNCTIONAL/PLACEHOLDER
 SimpleEntity.SimpleEntityType getType()
          Returns the SimpleEntity.SimpleEntityType corresponding to the constructor used to create this object.
 Vector2f getVelocity()
          NONFUNCTIONAL/PLACEHOLDER
 WeaponAPI getWeapon()
          Returns the WeaponAPI this entity is attached to, if any.
 void setAngularVelocity(float angVel)
          NONFUNCTIONAL/PLACEHOLDER
 void setCollisionClass(CollisionClass collisionClass)
          NONFUNCTIONAL/PLACEHOLDER
 void setFacing(float facing)
          NONFUNCTIONAL/PLACEHOLDER
 void setMass(float mass)
          NONFUNCTIONAL/PLACEHOLDER
 void setOwner(int owner)
          NONFUNCTIONAL/PLACEHOLDER
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleEntity

public SimpleEntity(Vector2f location)
Creates a CombatEntityAPI that stays in a single, predefined location. This version is a simple wrapper around a Vector2f and costs virtually nothing.

Parameters:
location - The Vector2f that getLocation() should return.

Since:
1.4

SimpleEntity

public SimpleEntity(WeaponAPI weapon)
Creates a CombatEntityAPI that mimics the location of a WeaponAPI.

Parameters:
weapon - The WeaponAPI whose location getLocation() should return.

Since:
1.7

SimpleEntity

public SimpleEntity(Object toFollow)
Creates a CombatEntityAPI that mimics the location of another object that contains a getLocation() method.

Parameters:
toFollow - The Object to mimic the location of. This object MUST have the method getLocation(), which MUST return a Vector2f!

Since:
1.4
Method Detail

getLocation

public Vector2f getLocation()
Returns the location this SimpleEntity is mimicking.

Specified by:
getLocation in interface CombatEntityAPI
Returns:
The Vector2f passed in at creation or the result of getLocation() on the followed Object, depending on which constructor was used. Can return null if the object it is following is no longer on the battle map.

Since:
1.4

getWeapon

public WeaponAPI getWeapon()
Returns the WeaponAPI this entity is attached to, if any.

Returns:
The WeaponAPI passed into the constructor, or null if another constructor was used.

Since:
1.7

getType

public SimpleEntity.SimpleEntityType getType()
Returns the SimpleEntity.SimpleEntityType corresponding to the constructor used to create this object.

Returns:
The type of constructor used to create this entity.

Since:
1.7

getVelocity

public Vector2f getVelocity()
NONFUNCTIONAL/PLACEHOLDER

Specified by:
getVelocity in interface CombatEntityAPI

getFacing

public float getFacing()
NONFUNCTIONAL/PLACEHOLDER

Specified by:
getFacing in interface CombatEntityAPI

setFacing

public void setFacing(float facing)
NONFUNCTIONAL/PLACEHOLDER

Specified by:
setFacing in interface CombatEntityAPI

getAngularVelocity

public float getAngularVelocity()
NONFUNCTIONAL/PLACEHOLDER

Specified by:
getAngularVelocity in interface CombatEntityAPI

setAngularVelocity

public void setAngularVelocity(float angVel)
NONFUNCTIONAL/PLACEHOLDER

Specified by:
setAngularVelocity in interface CombatEntityAPI

getOwner

public int getOwner()
NONFUNCTIONAL/PLACEHOLDER

Specified by:
getOwner in interface CombatEntityAPI

setOwner

public void setOwner(int owner)
NONFUNCTIONAL/PLACEHOLDER

Specified by:
setOwner in interface CombatEntityAPI

getCollisionRadius

public float getCollisionRadius()
NONFUNCTIONAL/PLACEHOLDER

Specified by:
getCollisionRadius in interface CombatEntityAPI

getCollisionClass

public CollisionClass getCollisionClass()
NONFUNCTIONAL/PLACEHOLDER

Specified by:
getCollisionClass in interface CombatEntityAPI

setCollisionClass

public void setCollisionClass(CollisionClass collisionClass)
NONFUNCTIONAL/PLACEHOLDER

Specified by:
setCollisionClass in interface CombatEntityAPI

getMass

public float getMass()
NONFUNCTIONAL/PLACEHOLDER

Specified by:
getMass in interface CombatEntityAPI

setMass

public void setMass(float mass)
NONFUNCTIONAL/PLACEHOLDER

Specified by:
setMass in interface CombatEntityAPI

getExactBounds

public BoundsAPI getExactBounds()
NONFUNCTIONAL/PLACEHOLDER

Specified by:
getExactBounds in interface CombatEntityAPI

getShield

public ShieldAPI getShield()
NONFUNCTIONAL/PLACEHOLDER

Specified by:
getShield in interface CombatEntityAPI

getHullLevel

public float getHullLevel()
NONFUNCTIONAL/PLACEHOLDER

Specified by:
getHullLevel in interface CombatEntityAPI

getHitpoints

public float getHitpoints()
NONFUNCTIONAL/PLACEHOLDER

Specified by:
getHitpoints in interface CombatEntityAPI

getMaxHitpoints

public float getMaxHitpoints()
NONFUNCTIONAL/PLACEHOLDER

Specified by:
getMaxHitpoints in interface CombatEntityAPI

LazyLib