Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 19, 2014, 4:08:42 PM (9 years ago)
Author:
richtero
Message:

new structure: Board in separate class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4DgameCenterpoint.h

    r10121 r10131  
    4141#include "worldentities/StaticEntity.h"
    4242#include "mini4Dgame/Mini4DgamePrereqs.h"
    43 #include "mini4Dgame/Mini4Dgame.h"
     43//#include "mini4Dgame/Mini4Dgame.h"
    4444
    4545namespace orxonox
    4646{
    47    
    4847    /**
    4948    @brief
    5049        The Mini4DgameCenterpoint implements the playing field @ref orxonox::Mini4Dgame "Mini4Dgame" takes place in and allows for many parameters of the minigame to be set.
    5150       
    52         Various parameters can be set:
    53         - The <b>dimension</b> is a vector, that defines the width and height of the playing field. The default is <em>(200, 120)</em>.
    54         - The <b>balltemplate</b> is a template that is applied to the @ref orxonox::PongBall "PongBall", it can be used to attach different things to it, e.g. its @ref orxonox::Model "Model". See below for a usage example.
    55         - The <b>battemplate</b> is a template that is applied to the @ref orxonox::PongBall "PongBat", it can be used to attach different things to it, e.g. its @ref orxonox::Model "Model". See below for a usage example.
    56         - The <b>ballspeed</b> is the speed with which the @ref orxonox::PongBall "PongBall" moves. The default is <em>100</em>.
    57         - The <b>ballaccfactor</b> is the acceleration factor for the @ref orxonox::PongBall "PongBall". The default is <em>1.0</em>.
    58         - The <b>batspeed</b> is the speed with which the @ref orxonox::PongBat "PongBats" move. The default is <em>60</em>.
    59         - The <b>batlength</b> is the length of the @ref orxonox::PongBat "PongBats" as the percentage of the height of the playing field. The default is <em>0.25</em>.
    6051    */
    6152    class _Mini4DgameExport Mini4DgameCenterpoint : public StaticEntity
     
    7061
    7162            /**
    72             @brief Set the template for the ball. (e.g. to attach the model of the ball, but also to attach an EventListener to it to detect, when it hits the boundaries, and e.g. display some ParticleEffets, when it does.)
    73             @param balltemplate The name of the template to be set.
     63            @brief Get the template of the board.
     64            @return Returns the name of the template of the board.
     65            */
     66            const std::string& getBoardtemplate() const
     67                { return this->boardtemplate_; }
    7468
    75             void setBalltemplate(const std::string& balltemplate)
    76                 { this->balltemplate_ = balltemplate; }
    77             */
    7869
    7970            /**
    80             @brief Get the template of the ball.
    81             @return Returns the name of the template of the ball.
     71            @brief Set the template for the board.
     72            @param boardtemplate The name of the template to be set.
     73            */
     74            void setBoardtemplate(const std::string& boardtemplate)
     75                { this->boardtemplate_ = boardtemplate; }
    8276
    83             const std::string& getBalltemplate() const
    84                 { return this->balltemplate_; }
    85             */
    86 
    87             /**
    88             @brief Set the template for the bats. (e.g. to attach the model of the bat, but also to attach CameraPositions to it, to be able to view the game from the bats perspective)
    89             @param battemplate The name of the template to be set.
    90 
    91             void setBattemplate(const std::string& battemplate)
    92                 { this->battemplate_ = battemplate; }
    93             */
    9477
    9578            /**
     
    10689                { return Vector3(this->width_, this->height_, this->length_); }
    10790
    108             /**
    109                     @brief checks if the move is valid
    110                     @param the position where to put the stone plus the player who makes the move
    111             */
    112             bool isValidMove(const Vector4 move);
    113 
    114             /**
    115                @brief makes a move on the logic playboard
    116                    @param the position where to put the stone plus the player who makes the move
    117              */
    118             void makeMove(const Vector4 move, const mini4DgamePlayerColor::color playerColor);
    119 
    120             /**
    121                @brief checks if somebody has won
    122                @return the winner with the winning fields or a winner with winner.color_ == mini4DgamePlayerColor::none if nobody has won so far.
    123             */
    124             Mini4DgameWinner Mini4DgameCenterpoint::getWinner();
    125 
    12691        private:
    12792            void checkGametype(); //!< Checks whether the gametype is Mini4Dgame and if it is, sets its centerpoint.
    12893
    129             //std::string balltemplate_; //!< The template for the ball.
    130             //std::string battemplate_; //!< The template for the bats.
     94            std::string boardtemplate_; //!< The template for the board.
    13195
    13296            float width_; //!< The height of the playing field.
    13397            float height_; //!< The width of the playing field.
    13498            float length_; //!< The length of the playing field.
    135             mini4DgamePlayerColor::color board[4][4][4][4]; //!< The logical board where the game takes place. board[row][column][height][number]
    13699    };
    137100}
Note: See TracChangeset for help on using the changeset viewer.