Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 1, 2006, 2:06:53 PM (19 years ago)
Author:
rennerc
Message:

implemented gamestates for multiplayerTeamDeathmatch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/util/multiplayer_team_deathmatch.h

    r7984 r8067  
    1818class ImagePlane;
    1919
     20enum
     21{
     22  GAMESTATE_PRE_GAME = 0,
     23  GAMESTATE_GAME,
     24  GAMESTATE_POST_GAME
     25};
     26
    2027
    2128class MultiplayerTeamDeathmatch : public NetworkGameRules
     
    2835    virtual void loadParams(const TiXmlElement* root);
    2936
     37    virtual int getTeamForNewUser();
     38    virtual ClassID getPlayableClassId( int team );
     39    virtual std::string getPlayableModelFileName( int team, ClassID classId );
    3040
    3141    virtual void onPlayerSpawn();
     
    3949    inline void setMaxKills(int kills) { this->maxKills = kills; }
    4050    void setDeathScreen(const std::string& imageName);
     51   
     52    inline void setNumTeams( int numTeams ){ this->numTeams = numTeams; }
     53    inline int getNumTeams(){ return this->numTeams; }
     54   
     55    int getRandomTeam();
    4156
    4257  protected:
     
    4964    int                maxKills;                   //!< max kills for winning condition
    5065
    51     int                teamAKills;                 //!< kills of team A
    52     int                teamBKills;                 //!< kills of team B
     66    int                numTeams;                   //!< number of teams
    5367
    54     ImagePlane*         deathScreen;                //!< the death screen
     68    std::map<int,int>  teamScore;                  //!< team score
     69
     70    ImagePlane*        deathScreen;                //!< the death screen
     71
     72    int                currentGameState;           //!< game state
     73    float              gameStateTimer;             //!< if less than 0 -> change game state
     74
     75    void calculateTeamScore();
     76    void nextGameState();
     77    void handleTeamChanges();
     78    void teamChange( int userId );
    5579};
    5680
Note: See TracChangeset for help on using the changeset viewer.