[Gcblue-commits] gcb_wx/include/sim tcControllableObject.h,NONE,1.1 Game.h,1.55,1.56
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-05-06 23:57:25
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11073/include/sim Modified Files: Game.h Added Files: tcControllableObject.h Log Message: added player name to connection status, update rates are slower for non-controlled objects, non-controlled objects now display as green, added chat text popup Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** Game.h 29 Apr 2005 18:52:02 -0000 1.55 --- Game.h 6 May 2005 23:57:16 -0000 1.56 *************** *** 306,310 **** tcGame(const wxPoint& pos, const wxSize& size); ! virtual ~tcGame(); DECLARE_EVENT_TABLE() --- 306,310 ---- tcGame(const wxPoint& pos, const wxSize& size); ! ~tcGame(); DECLARE_EVENT_TABLE() --- NEW FILE: tcControllableObject.h --- /** ** @file tcControllableObject.h */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB 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 GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **/ #ifndef _TCCONTROLLABLEOBJECT_H_ #define _TCCONTROLLABLEOBJECT_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include <string> class tcUserInfo; class tcStream; class tcCommandStream; class tcCreateStream; class tcUpdateStream; /** * Base class for multiplayer client control of game objects */ class tcControllableObject { public: enum { ACCESS_LEVEL_MASK = 0x00FF }; unsigned char GetAlliance() const; void SetAlliance(unsigned char val); unsigned char GetAccessLevel() const; void SetAccessLevel(unsigned char level); const std::string& GetController() const; void SetController(const std::string& username); bool IsAvailable() const; bool IsAvailable(unsigned char playerAlliance, unsigned char rank) const; /// @return true if controlled by player bool IsControlledBy(const std::string& playerName) const; /// @return true if controlled by client player (client only, uses local userInfo for playerName) bool IsControlled() const; tcCreateStream& operator<<(tcCreateStream& stream); tcUpdateStream& operator<<(tcUpdateStream& stream); tcCreateStream& operator>>(tcCreateStream& stream); tcUpdateStream& operator>>(tcUpdateStream& stream); static void AttachUserInfo(); tcControllableObject(); tcControllableObject(const tcControllableObject& src); ~tcControllableObject(); private: unsigned char alliance; unsigned short flags; ///< flags governing control permission std::string controller; ///< username of player controlling object static tcUserInfo* userInfo; }; #endif |