region_map.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef EQ2EMU_REGION_MAP_H
  2. #define EQ2EMU_REGION_MAP_H
  3. #include "../../common/types.h"
  4. #include "position.h"
  5. #include <string>
  6. enum WaterRegionType : int {
  7. RegionTypeUnsupported = -2,
  8. RegionTypeUntagged = -1,
  9. RegionTypeNormal = 0,
  10. RegionTypeWater = 1,
  11. RegionTypeLava = 2,
  12. RegionTypeZoneLine = 3,
  13. RegionTypePVP = 4,
  14. RegionTypeSlime = 5,
  15. RegionTypeIce = 6,
  16. RegionTypeVWater = 7
  17. };
  18. enum WaterRegionClass : int32 {
  19. ClassWaterVolume = 0, // matching .region file type by name "watervol"
  20. ClassWaterRegion = 1, // matching .region file type by name "waterregion"
  21. ClassWaterRegion2 = 2, // represents .region file name "water_region" potentially defunct and just a WaterVolume (0)
  22. ClassWaterOcean = 3, // represents .region file with "ocean" and a select node as a parent
  23. ClassWaterCavern = 4, // represents .region file with matches on name "ocean" and "water"
  24. ClassWaterOcean2 = 5 // represents .region file with matches on name "ocean" without previous matches (no select node parent and no water string match)
  25. };
  26. class RegionMap
  27. {
  28. public:
  29. RegionMap() { }
  30. virtual ~RegionMap() { }
  31. static RegionMap* LoadRegionMapfile(std::string zone_name);
  32. virtual WaterRegionType ReturnRegionType(const glm::vec3& location, float belowY = -999999.0f) const = 0;
  33. virtual bool InWater(const glm::vec3& location, float belowY = -999999.0f) const = 0;
  34. virtual bool InLava(const glm::vec3& location) const = 0;
  35. virtual bool InLiquid(const glm::vec3& location) const = 0;
  36. virtual bool InPvP(const glm::vec3& location) const = 0;
  37. virtual bool InZoneLine(const glm::vec3& location) const = 0;
  38. protected:
  39. virtual bool Load(FILE *fp) { return false; }
  40. };
  41. #endif