yapb-noob-edition/include/gamestate.h
jeefo fa64fe2ea7 some code cleanup
started to move game-specific stuff into own class
2016-03-05 21:04:46 +03:00

42 lines
No EOL
897 B
C++

//
// Yet Another POD-Bot, based on PODBot by Markus Klinge ("CountFloyd").
// Copyright (c) YaPB Development Team.
//
// This software is licensed under the BSD-style license.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
// http://yapb.jeefo.net/license
//
// Purpose: Represents Counter-Strike Game.
//
#pragma once
//
class IGameEvents
{
public:
// called when new round occurs
virtual void OnNewRound (void) = 0;
};
class Game
{
private:
IGameEvents *m_listener;
public:
Game (void) : m_listener (NULL) { }
~Game (void) { }
public:
// we have only one listener, so register it here
void RegisterEventListener (IGameEvents *listener) { m_listener = listener; }
// get events interface
IGameEvents *GetGameEventListener (void) { return m_listener; }
};
// helper macros
#define events game.GetGameEventListener ()