Elaztek Developer Hub
Blamite Game Engine - blam!  00357.06.18.22.0809.blamite
The core library for the Blamite Game Engine.
BlamWorldState Class Reference

Class representing a world state. More...

#include <world.h>

+ Inheritance diagram for BlamWorldState:

Public Member Functions

 BlamWorldState ()
 Initializes a new world state. More...
 
 ~BlamWorldState ()
 Destroys the world state. More...
 
void AddObject (BlamWorldObject *object)
 
void RemoveObject (uint64_t object_id)
 
int GetObjectCount ()
 
bool HasObject (uint64_t object_id)
 
BlamWorldObjectGetObjectAtIndex (int index)
 
BlamWorldObjectGetObjectById (uint64_t object_id)
 
bool Drop (BlamTagData *tag_data, BlamVector3 position)
 Drops a tag into the world at the specified coordinates. More...
 
void OnTickEvent (TickEvent *event)
 Called when the listener is subscribed to Key Press events, and a new TickEvent is fired. More...
 
- Public Member Functions inherited from BlamEventListener
void Subscribe (BlamEventType type)
 Subscribes to an event type. More...
 
 ~BlamEventListener ()
 
std::vector< BlamEventTypeGetSubscribedEvents ()
 Retrieves the list of subscribed event types. More...
 
bool IsSubscribed (BlamEventType type)
 Determines whether or not the listener is subscribed to the specified event type. More...
 
void SetPriority (int new_priority)
 Sets the priority of the listener. More...
 
int GetPriority ()
 Retrieves the priority of the listener. More...
 
virtual void OnCharacterInputEvent (CharacterInputEvent *event)
 Called when the listener is subscribed to Character Input events, and a new CharacterInputEvent is fired. More...
 
virtual void OnConfigurationReloadEvent (ConfigurationReloadEvent *event)
 Called when the listener is subscribed to configuration reload events, and a new ConfigurationReloadEvent is fired. More...
 
virtual void OnKeyPressEvent (KeyPressEvent *event)
 Called when the listener is subscribed to Key Press events, and a new KeyPressEvent is fired. More...
 
virtual void OnMouseClickEvent (MouseClickEvent *event)
 Called when the listener is subscribed to Mouse Click events, and a new MouseClickEvent is fired. More...
 
virtual void OnMouseMoveEvent (MouseMoveEvent *event)
 Called when the listener is subscribed to Mouse Move events, and a new MouseMoveEvent is fired. More...
 
virtual void OnNewFrameEvent (NewFrameEvent *event)
 Called when the listener is subscribed to New Frame events, and a new NewFrameEvent is fired. More...
 
virtual void OnLogMessageEvent (LogMessageEvent *event)
 Called when the listener is subscribed to Log Message events, and a new LogMessageEvent is fired. More...
 

Additional Inherited Members

- Public Attributes inherited from BlamEventListener
std::string name = ""
 The name of the listener. Used for debugging purposes. More...
 

Detailed Description

Class representing a world state.

The world state stores all data related to the current state of the world in-engine. Primarily, this will include a list of all world objects currently placed down.

Constructor & Destructor Documentation

◆ BlamWorldState()

BlamWorldState::BlamWorldState ( )

Initializes a new world state.

◆ ~BlamWorldState()

BlamWorldState::~BlamWorldState ( )

Destroys the world state.

Member Function Documentation

◆ AddObject()

void BlamWorldState::AddObject ( BlamWorldObject object)

◆ Drop()

bool BlamWorldState::Drop ( BlamTagData tag_data,
BlamVector3  position 
)

Drops a tag into the world at the specified coordinates.

This method will create a new world object from the specified tag.

Parameters
tag_data- The tag data to use to create the new world object.
position- The position to place the new object at.
Returns
true if the tag was successfully dropped into the world, otherwise returns false.

◆ GetObjectAtIndex()

BlamWorldObject * BlamWorldState::GetObjectAtIndex ( int  index)

◆ GetObjectById()

BlamWorldObject * BlamWorldState::GetObjectById ( uint64_t  object_id)

◆ GetObjectCount()

int BlamWorldState::GetObjectCount ( )

◆ HasObject()

bool BlamWorldState::HasObject ( uint64_t  object_id)

◆ OnTickEvent()

void BlamWorldState::OnTickEvent ( TickEvent event)
virtual

Called when the listener is subscribed to Key Press events, and a new TickEvent is fired.

Parameters
event- The event that was fired.

Reimplemented from BlamEventListener.

◆ RemoveObject()

void BlamWorldState::RemoveObject ( uint64_t  object_id)

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