AI for Games 1.1.1
Loading...
Searching...
No Matches
game2dai.entities.Artefact Class Reference
Inheritance diagram for game2dai.entities.Artefact:

Public Member Functions

 Artefact ()
 
 Artefact (String entityName)
 
 Artefact (String entityName, Vector2D entityPos, double width, double height)
 
Domain getExtent ()
 
boolean isInDomain (Domain view)
 
- Public Member Functions inherited from game2dai.entities.BaseEntity
 BaseEntity ()
 
 BaseEntity (String name)
 
 BaseEntity (String entityName, Vector2D entityPos, double entityColRadius)
 
int ID ()
 
void updateFSM (double deltaTime, World world)
 
FiniteStateMachine FSM ()
 
boolean hasFSM ()
 
void addFSM ()
 
boolean removeFSM ()
 
int Z ()
 
BaseEntity Z (int z)
 
boolean isVisible ()
 
BaseEntity visible (boolean visible)
 
double colRadius ()
 
BaseEntity colRadius (double colRadius)
 
boolean isOverLapAllowed ()
 
BaseEntity overLapAllowed (boolean overLapAllowed)
 
boolean isInDomain (Domain view)
 
boolean isOver (double px, double py)
 
BaseEntity renderer (Picture renderer)
 
Picture renderer ()
 
void die (World world, double timeToLive)
 
void born (World world, double timeToLive)
 
BaseEntity moveTo (double x, double y)
 
BaseEntity moveTo (Vector2D p)
 
BaseEntity moveBy (double x, double y)
 
BaseEntity moveBy (Vector2D p)
 
Vector2D pos ()
 
BaseEntity name (String name)
 
String name ()
 
boolean isEitherSide (double x0, double y0, double x1, double y1)
 
boolean isEitherSide (Vector2D p0, Vector2D p1)
 
void update (double deltaTime, World world)
 
void draw (World world)
 
void draw (double elapsedTime, World world)
 
int compareTo (BaseEntity o)
 
String toString ()
 

Protected Attributes

double minX
 
double maxX
 
double minY
 
double maxY
 
- Protected Attributes inherited from game2dai.entities.BaseEntity
Integer entityID
 
String name = ""
 
Picture renderer = null
 
boolean visible = true
 
Vector2D pos = new Vector2D()
 
double colRadius
 

Additional Inherited Members

- Public Attributes inherited from game2dai.entities.BaseEntity
String tag = ""
 
int tagNo = 0
 
- Package Attributes inherited from game2dai.entities.BaseEntity
boolean overlapAllowed = false
 

Detailed Description

This class represents an artefact that can be added to a game. This artefact may have a FSM and a renderer but it is invisible to any moving entity, so is not detected by any Vehicle's steering behaviour.

Author
Peter Lager

Constructor & Destructor Documentation

◆ Artefact() [1/3]

game2dai.entities.Artefact.Artefact ( )

Default constructor

◆ Artefact() [2/3]

game2dai.entities.Artefact.Artefact ( String  entityName)

Constructor will give the entity a unique ID.

Parameters
entityNamethe name of this entity - default name is used if none provided.

◆ Artefact() [3/3]

game2dai.entities.Artefact.Artefact ( String  entityName,
Vector2D  entityPos,
double  width,
double  height 
)
Parameters
entityName
entityPos
width
height

Member Function Documentation

◆ getExtent()

Domain game2dai.entities.Artefact.getExtent ( )

Get the rectangle that encompasses this artefact in world coordinates.

◆ isInDomain()

boolean game2dai.entities.Artefact.isInDomain ( Domain  view)

Determine whether this artefact is inside or part inside the domain. This method is used by the world draw method to see if this entity should be drawn.

Parameters
viewthe world domain
Returns
true if any part of this entity is inside the domain

Reimplemented from game2dai.entities.BaseEntity.


The documentation for this class was generated from the following file: