home *** CD-ROM | disk | FTP | other *** search
/ Game Programming in C++ - Start to Finish / GameProgrammingS.iso / developer_install / ReplicaNetFreewareV5_4.exe / data1.cab / Program_Executable_Files / Example9 / GameObject.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-30  |  1.2 KB  |  66 lines

  1. /* START_LICENSE_HEADER
  2.  
  3. Copyright (C) 2000 Martin Piper, original design and program code
  4. Copyright (C) 2001-2005 Replica Software
  5.  
  6. This program file is copyright (C) Replica Software and can only be used under license.
  7. For more information visit: http://www.replicanet.com/
  8. Or email: info@replicanet.com
  9.  
  10. END_LICENSE_HEADER */
  11. /*
  12. The base class definition for game objects. See GameObjkect.cpp
  13. */
  14. #ifndef __GAMEOBJECT_H__
  15. #define __GAMEOBJECT_H__
  16.  
  17. #include "d3dfile.h"
  18. #include <vector>
  19.  
  20. class GameObject;
  21. namespace RNReplicaNet
  22. {
  23. class ReplicaObject;
  24. }
  25.  
  26. extern std::vector<GameObject *> gGameObjects;
  27.  
  28. class GameObject
  29. {
  30. public:
  31.     GameObject();
  32.  
  33.     virtual ~GameObject();
  34.  
  35.     virtual void PollIt(void);
  36.  
  37.     virtual D3DXVECTOR4 GetPosition(void)
  38.     {
  39.         return D3DXVECTOR4(0,0,0,0);
  40.     }
  41.  
  42.  
  43.     /**
  44.      * A delete method for a game object since deletion of a class while in a member function is not very good design
  45.      */
  46.     void Delete(void);
  47.  
  48.     bool mDeleteMe;
  49.  
  50.     enum ObjectType
  51.     {
  52.         kNULL,
  53.         kPlane,
  54.         kCamera
  55.     };
  56.  
  57.     ObjectType mType;
  58.  
  59.     /*
  60.     A pointer held by the class that points to the derived class of this object for forward references
  61.     */
  62.     RNReplicaNet::ReplicaObject *mReplica;
  63. };
  64.  
  65. #endif
  66.