Leviathan  0.8.0.0
Leviathan game engine
Leviathan::BaseGameSpecificPacketFactory Class Referenceabstract

Base class that is passed to the list of type handlers to GameSpecificPacketHandler. More...

#include <GameSpecificPacketHandler.h>

Public Member Functions

DLLEXPORT BaseGameSpecificPacketFactory (int typenumber, bool isrequesttype)
 
virtual DLLEXPORT ~BaseGameSpecificPacketFactory ()
 
virtual DLLEXPORT bool SerializeToPacket (GameSpecificPacketData *data, sf::Packet &packet)=0
 Function for factories to pass their object data to a packet when requested. More...
 
virtual DLLEXPORT std::shared_ptr< GameSpecificPacketDataUnSerializeObjectFromPacket (sf::Packet &packet)=0
 Called when a factory needs to extract data from a packet. More...
 

Public Attributes

int TypeIDNumber
 The integer identifying when this factory needs to be used. More...
 
bool HandlesRequests
 Specifies are the TypeIDNumbers corresponding to request or response packets. More...
 

Detailed Description

Base class that is passed to the list of type handlers to GameSpecificPacketHandler.

Definition at line 60 of file GameSpecificPacketHandler.h.

Constructor & Destructor Documentation

◆ BaseGameSpecificPacketFactory()

DLLEXPORT Leviathan::BaseGameSpecificPacketFactory::BaseGameSpecificPacketFactory ( int  typenumber,
bool  isrequesttype 
)

Definition at line 202 of file GameSpecificPacketHandler.cpp.

202  :
203  TypeIDNumber(typenumber), HandlesRequests(isrequesttype)
204 {
205 
206 }
bool HandlesRequests
Specifies are the TypeIDNumbers corresponding to request or response packets.
int TypeIDNumber
The integer identifying when this factory needs to be used.

◆ ~BaseGameSpecificPacketFactory()

DLLEXPORT Leviathan::BaseGameSpecificPacketFactory::~BaseGameSpecificPacketFactory ( )
virtual

Definition at line 208 of file GameSpecificPacketHandler.cpp.

208  {
209 
210 }

Member Function Documentation

◆ SerializeToPacket()

virtual DLLEXPORT bool Leviathan::BaseGameSpecificPacketFactory::SerializeToPacket ( GameSpecificPacketData data,
sf::Packet &  packet 
)
pure virtual

Function for factories to pass their object data to a packet when requested.

Note
Should not throw anything

◆ UnSerializeObjectFromPacket()

virtual DLLEXPORT std::shared_ptr<GameSpecificPacketData> Leviathan::BaseGameSpecificPacketFactory::UnSerializeObjectFromPacket ( sf::Packet &  packet)
pure virtual

Called when a factory needs to extract data from a packet.

Note
Should not throw, instead should return NULL when invalid data is encountered

Member Data Documentation

◆ HandlesRequests

bool Leviathan::BaseGameSpecificPacketFactory::HandlesRequests

Specifies are the TypeIDNumbers corresponding to request or response packets.

Definition at line 76 of file GameSpecificPacketHandler.h.

◆ TypeIDNumber

int Leviathan::BaseGameSpecificPacketFactory::TypeIDNumber

The integer identifying when this factory needs to be used.

Definition at line 74 of file GameSpecificPacketHandler.h.


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