Leviathan  0.8.0.0
Leviathan game engine
Leviathan::PhysicsStartEventData Class Reference

Data for EVENT_TYPE_PHYSICS_BEGIN. More...

#include <Event.h>

+ Inheritance diagram for Leviathan::PhysicsStartEventData:

Public Member Functions

DLLEXPORT PhysicsStartEventData (sf::Packet &packet)
 Loads from a packet. More...
 
DLLEXPORT PhysicsStartEventData (const float &time, void *worldptr)
 Creates a new PhysicsStartEventData. More...
 
virtual void AddDataToPacket (sf::Packet &packet)
 Adds this to a packet for retrieving it later. More...
 
- Public Member Functions inherited from Leviathan::BaseEventData
virtual ~BaseEventData ()
 

Public Attributes

float TimeStep
 The time step in seconds. More...
 
void * GameWorldPtr
 

Detailed Description

Data for EVENT_TYPE_PHYSICS_BEGIN.

Definition at line 96 of file Event.h.

Constructor & Destructor Documentation

◆ PhysicsStartEventData() [1/2]

DLLEXPORT Leviathan::PhysicsStartEventData::PhysicsStartEventData ( sf::Packet &  packet)

Loads from a packet.

Definition at line 228 of file Event.cpp.

229 {
230  // Load our data //
231  if(!(packet >> TimeStep)) {
232 
233  throw InvalidArgument("packet has invalid format");
234  }
235 
236  // This doesn't make any sense to be stored //
237  GameWorldPtr = NULL;
238 }
float TimeStep
The time step in seconds.
Definition: Event.h:106

◆ PhysicsStartEventData() [2/2]

Leviathan::PhysicsStartEventData::PhysicsStartEventData ( const float &  time,
void *  worldptr 
)

Creates a new PhysicsStartEventData.

Definition at line 223 of file Event.cpp.

223  :
224  TimeStep(time), GameWorldPtr(worldptr)
225 {
226 }
float TimeStep
The time step in seconds.
Definition: Event.h:106

Member Function Documentation

◆ AddDataToPacket()

void Leviathan::PhysicsStartEventData::AddDataToPacket ( sf::Packet &  packet)
virtual

Adds this to a packet for retrieving it later.

Implements Leviathan::BaseEventData.

Definition at line 217 of file Event.cpp.

218 {
219  // Add our data //
220  packet << TimeStep;
221 }
float TimeStep
The time step in seconds.
Definition: Event.h:106

Member Data Documentation

◆ GameWorldPtr

void* Leviathan::PhysicsStartEventData::GameWorldPtr

Pointer to the world

Warning
This is NULL if this event is passed through a packet

Definition at line 110 of file Event.h.

◆ TimeStep

float Leviathan::PhysicsStartEventData::TimeStep

The time step in seconds.

Definition at line 106 of file Event.h.


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