Pol  Revision:cb584c9
umap.h
Go to the documentation of this file.
1 
7 #ifndef UMAP_H
8 #define UMAP_H
9 
10 #include "../bscript/bobject.h"
11 #include "../clib/compilerspecifics.h"
12 #include "../clib/rawtypes.h"
13 #ifndef ITEM_H
14 #include "item/item.h"
15 #endif
16 
17 namespace Pol
18 {
19 namespace Bscript
20 {
21 class BObjectImp;
22 namespace Pol
23 {
24 namespace Bscript
25 {
26 class Executor;
27 } // namespace Bscript
28 namespace Clib
29 {
30 class ConfigElem;
31 class StreamWriter;
32 } // namespace Clib
33 namespace Items
34 {
35 class ItemDesc;
36 } // namespace Items
37 namespace Network
38 {
39 class Client;
40 } // namespace Network
41 } // namespace Pol
42 }
43 namespace Items
44 {
45 class MapDesc;
46 }
47 namespace Core
48 {
49 struct PKTBI_56;
50 
51 struct PinPoint
52 {
53  unsigned short x;
54  unsigned short y;
55 };
56 
57 class Map : public Items::Item
58 {
59  typedef Items::Item base;
60 
61 public:
64  bool editable;
65  bool plotting;
66  typedef std::vector<PinPoint> PinPoints;
67  PinPoints pin_points;
68  typedef PinPoints::iterator pin_points_itr;
69 
70  inline u16 get_xwest() { return xwest; };
71  inline u16 get_xeast() { return xeast; };
72  inline u16 get_ynorth() { return ynorth; };
73  inline u16 get_ysouth() { return ysouth; };
74  bool msgCoordsInBounds( PKTBI_56* msg );
75  u16 gumpXtoWorldX( u16 gumpx );
76  u16 gumpYtoWorldY( u16 gumpy );
77  u16 worldXtoGumpX( u16 worldx );
78  u16 worldYtoGumpY( u16 worldy );
79 
80  virtual Items::Item* clone() const POL_OVERRIDE; // dave 12-20
81  virtual ~Map();
82  virtual size_t estimatedSize() const POL_OVERRIDE;
83 
84 protected:
85  Map( const Items::MapDesc& mapdesc );
86  friend Items::Item* Items::Item::create( const Items::ItemDesc& itemdesc, u32 serial );
87 
88  virtual void builtin_on_use( Network::Client* client ) POL_OVERRIDE;
89  virtual Bscript::BObjectImp* script_method( const char* methodname,
91  virtual Bscript::BObjectImp* script_method_id( const int id, Bscript::Executor& ex ) POL_OVERRIDE;
92  virtual Bscript::BObjectImp* get_script_member( const char* membername ) const POL_OVERRIDE;
93  virtual Bscript::BObjectImp* get_script_member_id( const int id ) const POL_OVERRIDE;
94  // virtual Bscript::BObjectImp* set_script_member( const char *membername, const std::string&
95  // value );
96  virtual Bscript::BObjectImp* set_script_member( const char* membername, int value ) POL_OVERRIDE;
97  virtual Bscript::BObjectImp* set_script_member_id( const int id,
98  int value ) POL_OVERRIDE; // id test
99  // virtual Bscript::BObjectImp* set_script_member_double( const char *membername, double value );
100  virtual bool script_isa( unsigned isatype ) const POL_OVERRIDE;
101  virtual void printProperties( Clib::StreamWriter& sw ) const POL_OVERRIDE;
102  void printPinPoints( Clib::StreamWriter& sw ) const;
103  virtual void readProperties( Clib::ConfigElem& elem ) POL_OVERRIDE;
104 
105 
106 private:
112 
113 private: // not implemented
114  Map( const Map& map );
115  Map& operator=( const Map& map );
116 };
117 }
118 }
119 #endif
static Item * create(u32 objtype, u32 serial=0)
Definition: itemcr.cpp:53
#define POL_OVERRIDE
std::vector< PinPoint > PinPoints
Definition: umap.h:66
unsigned short y
Definition: umap.h:54
PinPoints pin_points
Definition: umap.h:67
u16 ynorth
Definition: umap.h:109
u16 ysouth
Definition: umap.h:110
bool plotting
Definition: umap.h:65
u16 gumpheight
Definition: umap.h:63
unsigned short u16
Definition: rawtypes.h:26
unsigned int u32
Definition: rawtypes.h:27
bool editable
Definition: umap.h:64
u16 get_xwest()
Definition: umap.h:70
u16 get_ysouth()
Definition: umap.h:73
u16 get_ynorth()
Definition: umap.h:72
Items::Item base
Definition: umap.h:59
u16 xwest
Definition: umap.h:107
PinPoints::iterator pin_points_itr
Definition: umap.h:68
u16 xeast
Definition: umap.h:108
u16 gumpwidth
Definition: umap.h:62
unsigned short x
Definition: umap.h:53
Definition: berror.cpp:12
u16 get_xeast()
Definition: umap.h:71
u16 facetid
Definition: umap.h:111