The Entity class, to provide functions that call to attached Lua scripts.
More...
#include <entity.h>
Inherited by Button, and TileBar.
|
Image | mImage |
|
std::shared_ptr< Physics > | mPhysics |
| Handle's the objects physics.
|
|
std::string | mTag |
| A general tag for the entity.
|
|
std::string | mName |
| The entity's name.
|
|
std::string | mConfigFile |
|
bool | mMouseOver |
| For tracking mouse over and clicks.
|
|
bool | mClicked |
|
bool | mRender |
| For tracking if the entity should be rendered, and if it's a ui element.
|
|
bool | mUiElement |
|
LuaScript | mScript |
| The entity's lua script.
|
|
The Entity class, to provide functions that call to attached Lua scripts.
Base class for Entities, has functions that simply provide a call to the function of the same name on the Entity's attached Lua script
Entity::Entity |
( |
std::string |
file | ) |
|
Construct the Entity from a entity data file
- Parameters
-
script | The object's data file |
void Entity::CheckMouseOver |
( |
const Vector2f & |
pos | ) |
|
|
virtual |
Check if mouse entered the object's box Updates mMouseOver accordingly
- Parameters
-
pos | The mouse pos to check |
void Entity::Draw |
( |
std::weak_ptr< Camera > |
camera | ) |
|
|
virtual |
Draw the Entity, apply an adjustment for the camera if one is desired
- Parameters
-
cam | The camera to adjust for |
Reimplemented in Button.
Get a pointer to the object's Physics component, for use in allowing it to be gotten and used in a script
- Returns
- A pointer to the entity's Physics member
std::weak_ptr< Physics > Entity::GetPhysicsWeakPtr |
( |
| ) |
|
Get a weak_ptr to the Entity's physics lib TODO: Migrate to using this exclusively
- Returns
- a weak_ptr to the Physics component
void Entity::Init |
( |
std::shared_ptr< Entity > |
self = nullptr | ) |
|
|
virtual |
Initialize the object and give the script the shared_ptr to the entity it's managing
- Parameters
-
self | The shared_ptr to this entity that the manager is also using, so references are counted properly |
Load the Entity from a file with the option for loading overrides as well
- Parameters
-
file | The file to load from |
overrides | The state-specific overrides to load |
void Entity::Move |
( |
float |
deltaT | ) |
|
|
virtual |
Move the object
- Parameters
-
On mouse click event, a mouse click event is described as a mouse-down followed by a mouse-up
Reimplemented in ObjectButton< T >, and Button.
void Entity::Save |
( |
const std::string & |
file | ) |
const |
|
virtual |
Save the Entity to a file
- Parameters
-
file | The file to save the entity too |
void Entity::SetCollisionMap |
( |
CollisionMap |
map | ) |
|
Set a collision map for the physics member to check against
- Parameters
-
Note: Once Lua entity scripting is fully implemented, Image should no longer be a member, but rather should be created and given to the Lua instance to handle if an image is desired
The documentation for this class was generated from the following files:
- C:/Users/Will/Documents/Programs/LPCGame/src/core/entity.h
- C:/Users/Will/Documents/Programs/LPCGame/src/core/entity.cpp