Multiplayer Game Programming: Architecting Networked Games (Gelmut Nayberger's Library) by Josh Glazer & Sanjay Madhav

Multiplayer Game Programming: Architecting Networked Games (Gelmut Nayberger's Library) by Josh Glazer & Sanjay Madhav

Author:Josh Glazer & Sanjay Madhav
Language: eng
Format: epub
Publisher: Addison-Wesley Professional
Published: 2016-09-07T04:00:00+00:00


* * *

class Command

{

public:

enum ECommandType

{

CM_INVALID,

CM_ATTACK,

CM_MOVE

};

Command():

mCommandType(CM_INVALID),

mNetworkId(0),

mPlayerId(0)

{}

//given a buffer, will construct the appropriate command subclass

static shared_ptr<Command> StaticReadAndCreate(

InputMemoryBitStream& inInputStream);

//getters/setters

// ...

virtual void Write(OutputMemoryBitStream& inOutputStream);

virtual void ProcessCommand() = 0;

protected:

virtual void Read(InputMemoryBitStream& inInputStream) = 0;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.