00001 /* Crown and Cutlass 00002 * Environment Object 00003 * 00004 * This class is a parent to any object which may appear 00005 * in the game. Initially the things that come to mind which 00006 * this would be used as a parent class would be cities, 00007 * hidden treasures, and perhaps enemy pirate ships. 00008 */ 00009 00010 #if !defined ( _IENVIRONMENTOBJECT_H_ ) 00011 00012 #define _IENVIRONMENTOBJECT_H_ 00013 00014 #include <string> 00015 00016 using namespace std; 00017 00018 class IEnvironmentObject { 00019 public: 00020 // Constructors 00021 IEnvironmentObject(); 00022 IEnvironmentObject(string objName, int objLocX, int objLocZ, bool objVisible); 00023 00024 virtual ~IEnvironmentObject() { }; 00025 00026 // Methods 00027 00028 // Returns the name of the object 00029 string getName(); 00030 00031 int GetLocX(); 00032 int GetLocZ(); 00033 00034 // Returns distance from (x, z) to object 00035 float calcDist(float x, float z); 00036 00037 // Return angle in radians from (x, z) to object 00038 float calcAngle(float x, float z); 00039 00040 virtual void DisplayObject() = 0; 00041 00042 protected: 00043 int locX; 00044 int locZ; 00045 bool visible; 00046 string name; 00047 00048 private: 00049 }; 00050 00051 #endif
1.4.7