Created
October 4, 2018 20:39
-
-
Save ChristianHohlfeld/cdc877dda059683e0e1b70955219f2ce to your computer and use it in GitHub Desktop.
GameAdapter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef GameAdapter_h | |
#define GameAdapter_h | |
#include <stdio.h> | |
#include "yojimbo.h" | |
#include "GameMessageFactory.h" | |
class GameServer; | |
class GameAdapter : public yojimbo::Adapter { | |
public: | |
explicit GameAdapter(yojimbo::Allocator* allocator = NULL) : | |
myAllocator(allocator) {} | |
void setGameServer(GameServer* gs) { | |
m_game_serverRef = gs; | |
} | |
yojimbo::MessageFactory* CreateMessageFactory(yojimbo::Allocator& allocator) override { | |
return YOJIMBO_NEW(allocator, GameMessageFactory, *myAllocator); | |
} | |
void OnServerClientConnected(int clientIndex) override; | |
void OnServerClientDisconnected(int clientIndex) override; | |
private: | |
GameServer* m_game_serverRef; | |
yojimbo::Allocator* myAllocator; | |
}; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment