/* * ORXONOX - the hottest 3D action shooter ever to exist * > www.orxonox.net < * * * License notice: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Author: * Fabian 'x3n' Landau * Co-authors: * ... * */ /** @file Pong.h @brief Declaration of the Pong class. @ingroup Pong */ #ifndef _Pong_H__ #define _Pong_H__ #include "pong/PongPrereqs.h" #include "tools/Timer.h" #include "gametypes/Deathmatch.h" namespace orxonox { /** @brief Implements a Pong minigame. //TODO: Add details to different classes used and how. PongBall, is the ball, PongBats are the things that can be moved by the players (ControllableEntities), PongCenterpoint is the playing field. (x-z area) @author Fabian 'x3n' Landau @ingroup Pong */ class _PongExport Pong : public Deathmatch { public: Pong(BaseObject* creator); //!< Constructor. Registers and initializes the object. virtual ~Pong(); //!< Destructor. Cleans up, if initialized. virtual void start(); //!< Starts the Pong minigame. virtual void end(); ///!< Ends the Pong minigame. virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player. virtual void playerScored(PlayerInfo* player); //!< Is called when the player scored. /** @brief Set the PongCenterpoint (the playing field). @param center A pointer to the PongCenterpoint to be set. */ void setCenterpoint(PongCenterpoint* center) { this->center_ = center; } PlayerInfo* getLeftPlayer() const; //!< Get the left player. PlayerInfo* getRightPlayer() const; //!< Get the right player. protected: virtual void spawnPlayersIfRequested(); //!< Spawns players, and fills the rest up with bots. void startBall(); //!< Starts the ball with some default speed. void cleanup(); //!< Cleans up the Gametype by destroying the ball and the bats. WeakPtr center_; //!< The playing field. WeakPtr ball_; //!< The Pong ball. WeakPtr bat_[2]; //!< The two bats. Timer starttimer_; //!< A timer to delay the start of the game. }; } #endif /* _Pong_H__ */