Flatland
Public Types | Public Member Functions | Public Attributes | List of all members
flatland_server::Entity Class Referenceabstract

#include <entity.h>

Inheritance diagram for flatland_server::Entity:
Inheritance graph
[legend]
Collaboration diagram for flatland_server::Entity:
Collaboration graph
[legend]

Public Types

enum  EntityType { LAYER, MODEL }
 Defines the type of entity.
 

Public Member Functions

 Entity (b2World *physics_world, const std::string &name)
 Constructor for the entity. More...
 
const std::string & GetName () const
 
b2World * GetPhysicsWorld ()
 Get Box2D physics world. More...
 
 Entity (const Entity &)=delete
 
Entityoperator= (const Entity &)=delete
 
virtual EntityType Type () const =0
 Get the type of entity, subclasses must override. More...
 
virtual void DebugVisualize () const =0
 Visualize the entity.
 
virtual void DebugOutput () const =0
 Print debug message for the entity.
 

Public Attributes

b2World * physics_world_
 Box2D physics world.
 
std::string name_
 name of the entity
 

Detailed Description

This class defines a entity in the simulation world. It provides a class for high level physical things in the world to inherit from (layers and models)

Constructor & Destructor Documentation

flatland_server::Entity::Entity ( b2World *  physics_world,
const std::string &  name 
)

Constructor for the entity.

Parameters
[in]physics_worldBox2D physics_world
[in]namename of the entity
flatland_server::Entity::Entity ( const Entity )
delete

This class should be non-copyable. This will cause the destructor to be called twice for a given b2Body

Member Function Documentation

const std::string & flatland_server::Entity::GetName ( ) const
Returns
name of the entity
b2World * flatland_server::Entity::GetPhysicsWorld ( )

Get Box2D physics world.

Returns
Pointer to Box2D physics world, use this to call Box2D world methods
virtual EntityType flatland_server::Entity::Type ( ) const
pure virtual

Get the type of entity, subclasses must override.

Returns
the type of entity

Implemented in flatland_server::Layer, and flatland_server::Model.


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