Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/tetris/src/modules/tetris/TetrisStone.h @ 8537

Last change on this file since 8537 was 8537, checked in by catherine, 13 years ago

Almost working.

File size: 2.9 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      ...
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file TetrisStone.h
31    @brief Declaration of the TetrisStone class.
32    @ingroup Tetris
33*/
34
35#ifndef _TetrisStone_H__
36#define _TetrisStone_H__
37
38#include "tetris/TetrisPrereqs.h"
39
40#include "worldentities/ControllableEntity.h"
41#include "tools/Timer.h"
42
43namespace orxonox
44{
45
46    /**
47    @brief
48
49    @author
50
51    @ingroup Tetris
52    */
53    class _TetrisExport TetrisStone : public ControllableEntity
54    {
55        public:
56            TetrisStone(BaseObject* creator); //!< Constructor. Registers and initializes the object.
57            virtual ~TetrisStone() {}
58
59            virtual void tick(float dt);
60
61            virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
62            virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
63
64            virtual void changedPlayer(); //!< Is called when the player changed.
65
66            /**
67            @brief Set the size of the stone.
68            @param size The dimensions a stone has in the game world. (A stone is a cube)
69            */
70            void setSize(float size)
71                { this->size_ = size; }
72            /**
73            @brief Get the size of the stone.
74            @return Returns the dimensions a stone has in the game world. (A stone is a cube)
75            */
76            float getSize(void) const
77                { return this->size_; }
78
79            const Vector3& getPreviousPosition() const
80                { return this->previousPosition_; }
81
82            void setGame(Tetris* tetris)
83                { assert(tetris); tetris_ = tetris; }
84
85        private:
86            void enableMovement(void)
87                { this->delay_ = false; }
88           
89            float size_; //!< The dimensions a stone has in the game world.
90            bool delay_;
91            Timer delayTimer_;
92
93            Vector3 previousPosition_;
94            Tetris* tetris_;
95    };
96}
97
98#endif /* _TetrisStone_H__ */
Note: See TracBrowser for help on using the repository browser.