Dragonfly 4.20
A text-based game engine
|
Public Member Functions | |
int | insertObject (Object *p_o) |
int | removeObject (Object *p_o) |
ObjectList | activeObjects () const |
ObjectList | solidObjects () const |
ObjectList | visibleObjects (int altitude) const |
ObjectList | objectsOfType (std::string type) |
ObjectList | inactiveObjects () const |
int | updateAltitude (Object *p_o, int new_alt) |
int | updateSolidness (Object *p_o, Solidness new_solidness) |
int | updateVisible (Object *p_vo, bool new_visible) |
int | updateActive (Object *p_o, bool new_active) |
int | updatePosition (Object *p_o, Vector new_position) |
int | updateType (Object *p_o, std::string new_type) |
ObjectList | getCollisions (Object *p_o, Vector where) const |
Grid * | getGrid () |
int | startUp () |
void | shutDown () |
Private Attributes | |
ObjectList | m_active_objects |
ObjectList | m_solid_objects |
ObjectList | m_visible_objects [MAX_ALTITUDE+1] |
ObjectList | m_inactive_objects |
std::map< std::string, ObjectList > | m_type |
Grid | m_grid |
ObjectList df::SceneGraph::activeObjects | ( | ) | const |
Return all active Objects. Empty list if none.
ObjectList df::SceneGraph::getCollisions | ( | Object * | p_o, |
Vector | where | ||
) | const |
Return list of solid Objects collided with at position 'where'.
Does not consider if p_o is solid or not.
ObjectList df::SceneGraph::inactiveObjects | ( | ) | const |
Return all inactive Objects. Empty list if none.
int df::SceneGraph::insertObject | ( | Object * | p_o | ) |
Insert Object into SceneGraph.
Return 0 if ok, else -1.
ObjectList df::SceneGraph::objectsOfType | ( | std::string | type | ) |
Return list of Objects matching type.
List is empty if none found.
int df::SceneGraph::removeObject | ( | Object * | p_o | ) |
Remove Object from SceneGraph.
Return 0 if ok, else -1.
void df::SceneGraph::shutDown | ( | ) |
Shutdown Scenegraph (delete Quadtree, clear Grid).
ObjectList df::SceneGraph::solidObjects | ( | ) | const |
Return all active, solid Objects. Empty list if none.
int df::SceneGraph::startUp | ( | ) |
Startup Scenegraph (create Grid).
Return 0 if ok, else -1.
int df::SceneGraph::updateActive | ( | Object * | p_o, |
bool | new_active | ||
) |
Re-position Object in SceneGraph to new activeness.
Return 0 if ok, else -1.
int df::SceneGraph::updateAltitude | ( | Object * | p_o, |
int | new_alt | ||
) |
Re-position Object in SceneGraph to new altitude.
Return 0 if ok, else -1.
Set position of Object in SceneGraph.
Return 0 if ok, else -1.
Re-position Object in SceneGraph to new solidness.
Return 0 if ok, else -1.
int df::SceneGraph::updateType | ( | Object * | p_o, |
std::string | new_type | ||
) |
Re-position Object in SceneGraph to new type.
Return 0 if ok, else -1.
int df::SceneGraph::updateVisible | ( | Object * | p_vo, |
bool | new_visible | ||
) |
Re-position Object in SceneGraph to new visibility.
Return 0 if ok, else -1.
ObjectList df::SceneGraph::visibleObjects | ( | int | altitude | ) | const |
Return all active, visible Objects at altitude. Empty list if none.
|
private |
All active Objects.
|
private |
All inactive Objects.
|
private |
Solid Objects.
|
private |
Map of type:Object.
|
private |
Visible Objects.