// Universe base class /* * Universe base class * * Base class to develop custom universes (technically, game modules) from. * * * Copyright (C) 2007-2008 Alejandro Valenzuela Roca, * * http://mexinetica.com/~lanjoe9 * * This file is part of MotorJ, a free framework for videogame development. * * * * MotorJ is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MotorJ is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with MotorJ. If not, see . */ #ifndef UNIVERSE_CLASS_H #define UNIVERSE_CLASS_H //using namespace std; #include "events.h" #include #ifdef VISUAL_STUDIO #include #endif #ifdef PC_SDL #include #include #endif //! Universe base class /*! * Universe base class * * Base class to develop custom universes (technically, game modules) from. * * */ class Universe { public: //! Initialize the current Universe /*! Use this method to set up local universe variables and allocate memory */ virtual void Init() {}; //! Respond to input /*! Process input events and update logical variables */ virtual void ProcessEvent(s_event & event) {}; virtual void Update(float t_elapsed) {}; virtual void Redraw(void) {}; virtual void Cleanup(void) {}; Universe * GetNextUniverse(void); void SetNextUniverse(Universe * next); #ifdef PC_SDL virtual void Resize(int newWidth, int newHeight); #endif bool mustInit; bool mustCleanup; private: Universe * NextUniverse; }; // Beware! In C++, friends can see your privates! - Signature seen in a C++ forum #endif