OregonCore  revision fb2a440-git
Your Favourite TBC server
IVMapManager.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef _IVMAPMANAGER_H
19 #define _IVMAPMANAGER_H
20 
21 #include <string>
22 #include "Platform/Define.h"
23 
24 //===========================================================
25 
30 namespace VMAP
31 {
32 
34 {
38 };
39 
40 #define VMAP_INVALID_HEIGHT -100000.0f // for check
41 #define VMAP_INVALID_HEIGHT_VALUE -200000.0f // real assigned value in unknown height case
42 
43  //===========================================================
45 {
46  private:
49 
50  public:
51  IVMapManager() : iEnableLineOfSightCalc(true), iEnableHeightCalc(true) {}
52 
53  virtual ~IVMapManager(void) {}
54 
55  virtual VMAPLoadResult loadMap(const char* pBasePath, unsigned int pMapId, int x, int y) = 0;
56 
57  virtual bool existsMap(const char* pBasePath, unsigned int pMapId, int x, int y) = 0;
58 
59  virtual void unloadMap(unsigned int pMapId, int x, int y) = 0;
60  virtual void unloadMap(unsigned int pMapId) = 0;
61 
62  virtual bool isInLineOfSight(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2) = 0;
63  virtual float getHeight(unsigned int pMapId, float x, float y, float z, float maxSearchDist) = 0;
68  virtual bool getObjectHitPos(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float& ry, float& rz, float pModifyDist) = 0;
72  virtual bool processCommand(char* pCommand) = 0;
73 
78  void setEnableLineOfSightCalc(bool pVal) { iEnableLineOfSightCalc = pVal; }
83  void setEnableHeightCalc(bool pVal) { iEnableHeightCalc = pVal; }
84 
85  bool isLineOfSightCalcEnabled() const { return(iEnableLineOfSightCalc); }
86  bool isHeightCalcEnabled() const { return(iEnableHeightCalc); }
87  bool isMapLoadingEnabled() const { return(iEnableLineOfSightCalc || iEnableHeightCalc ); }
88 
89  virtual std::string getDirFileName(unsigned int pMapId, int x, int y) const = 0;
94  virtual bool getAreaInfo(unsigned int pMapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const = 0;
95  virtual bool GetLiquidLevel(uint32 pMapId, float x, float y, float z, uint8 ReqLiquidType, float& level, float& floor, uint32& type) const = 0;
96 };
97 
98 }
99 #endif
virtual void unloadMap(unsigned int pMapId, int x, int y)=0
virtual ~IVMapManager(void)
Definition: IVMapManager.h:53
void setEnableLineOfSightCalc(bool pVal)
Definition: IVMapManager.h:78
virtual bool GetLiquidLevel(uint32 pMapId, float x, float y, float z, uint8 ReqLiquidType, float &level, float &floor, uint32 &type) const =0
virtual std::string getDirFileName(unsigned int pMapId, int x, int y) const =0
ACE_INT32 int32
Definition: Define.h:67
virtual bool getObjectHitPos(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2, float &rx, float &ry, float &rz, float pModifyDist)=0
ACE_UINT8 uint8
Definition: Define.h:73
virtual bool isInLineOfSight(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2)=0
virtual bool getAreaInfo(unsigned int pMapId, float x, float y, float &z, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const =0
bool isLineOfSightCalcEnabled() const
Definition: IVMapManager.h:85
VMAPLoadResult
Definition: IVMapManager.h:33
virtual VMAPLoadResult loadMap(const char *pBasePath, unsigned int pMapId, int x, int y)=0
bool isHeightCalcEnabled() const
Definition: IVMapManager.h:86
void setEnableHeightCalc(bool pVal)
Definition: IVMapManager.h:83
virtual bool existsMap(const char *pBasePath, unsigned int pMapId, int x, int y)=0
virtual float getHeight(unsigned int pMapId, float x, float y, float z, float maxSearchDist)=0
bool isMapLoadingEnabled() const
Definition: IVMapManager.h:87
ACE_UINT32 uint32
Definition: Define.h:71
true
Definition: Log.cpp:534
virtual bool processCommand(char *pCommand)=0