public class Building extends BaseEntity
BaseEntity.DepthOrder
tag, tagNo
Constructor and Description |
---|
Building(java.lang.String name,
Vector2D offset,
Vector2D[] contour)
Create a building with the given contour.
|
Building(Vector2D[] contour)
Create a building with the given contour.
|
Building(Vector2D offset,
Vector2D[] contour)
Create a building with the given contour.
|
Modifier and Type | Method and Description |
---|---|
Vector2D[] |
contour()
This is needed by any renderer you might want to create.
|
Vector2D[] |
expandedContour(double e)
Get an expanded contour.
|
Domain |
getExtent()
Get the rectangle that encompasses the building in world coordinates.
|
boolean |
isEitherSide(double x0,
double y0,
double x1,
double y1)
Determines whether two world points are either side of a building.
|
boolean |
isInDomain(Domain view)
Determine whether this building is inside or part inside the domain.
|
boolean |
isOver(double px,
double py)
Determines whether a world point is inside the building or not
|
static Building[] |
makeFromXML(java.io.File xmlFile)
Alternative if not using Processing
|
static Building[] |
makeFromXML(processing.core.PApplet app,
java.lang.String xmlFilename)
This is the one to use with Processing
|
static Building[] |
makeFromXML(java.lang.String xmlFilename)
Alternative if not using Processing
|
java.lang.String |
toString()
Entity ID number and name returned as a String
|
java.lang.Integer[] |
triangle()
This is needed by any renderer you might want to create.
|
Wall[] |
walls() |
void |
walls(Wall[] walls) |
addFSM, born, colRadius, colRadius, compareTo, die, draw, draw, FSM, hasFSM, ID, isEitherSide, isOverLapAllowed, isVisible, moveBy, moveBy, moveTo, moveTo, name, name, overLapAllowed, pos, removeFSM, renderer, renderer, update, updateFSM, visible, Z, Z
public Building(Vector2D[] contour)
contour
- open list (shape is automatically closed) of corners in counter-clockwise orderpublic Building(Vector2D offset, Vector2D[] contour)
offset
- x/y to offset the contour datacontour
- open list (shape is automatically closed) of corners in counter-clockwise orderpublic Building(java.lang.String name, Vector2D offset, Vector2D[] contour)
name
- an optional name for the buildingoffset
- x/y to offset the contour datacontour
- open list (shape is automatically closed) of corners in counter-clockwise orderpublic static Building[] makeFromXML(processing.core.PApplet app, java.lang.String xmlFilename)
app
- xmlFilename
- public static Building[] makeFromXML(java.lang.String xmlFilename)
xmlFilename
- name of the file to parsepublic static Building[] makeFromXML(java.io.File xmlFile)
xmlFile
- File to parsepublic Wall[] walls()
public void walls(Wall[] walls)
walls
- the walls to setpublic Domain getExtent()
public boolean isOver(double px, double py)
isOver
in class BaseEntity
px
- x position of point of interestpy
- y position of point of interestpublic boolean isEitherSide(double x0, double y0, double x1, double y1)
isEitherSide
in class BaseEntity
x0
- y0
- x1
- y1
- public Vector2D[] contour()
public Vector2D[] expandedContour(double e)
e
- the perpendicular distance between existent and expanded walls.public java.lang.Integer[] triangle()
public boolean isInDomain(Domain view)
isInDomain
in class BaseEntity
view
- the world domainpublic java.lang.String toString()
BaseEntity
toString
in class BaseEntity
Processing library AI_for_2D_Games by Peter Lager. (C) 2013