home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / gamesystem / includes / gs_map.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-07-21  |  1.5 KB  |  78 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    gsCMap
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    12/03/00
  8. //
  9. // Base:    gsCObject
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #ifndef _INCLUDE_GS_MAP_H
  16. #define _INCLUDE_GS_MAP_H
  17.  
  18. #include "gs_object.h"
  19. #include "gs_point.h"
  20. #include "gs_maptile.h"
  21. #include "gs_tiledimage.h"
  22.  
  23. //-------------------------------------------------------------
  24.  
  25. class gsCMap : public gsCObject
  26. {
  27.     private:
  28.  
  29.         gsCTiledImage *m_image;
  30.         gsCPoint m_size;
  31.         gsCMapTile *m_map_tiles;
  32.         gsCPoint m_position;
  33.  
  34.         gsCPoint m_tile_size;
  35.         gsCPoint m_total_size;
  36.  
  37.         void createMapTiles();
  38.         void destroyMapTiles();
  39.         void calculateTotalSize();
  40.  
  41.         gsCList<gsCPoint> m_hit_list;
  42.  
  43.     public:
  44.  
  45.         gsCMap();
  46.         ~gsCMap();
  47.  
  48.         void destroy();
  49.  
  50.         bool load(const char *filename,const gsCPoint& size);
  51.  
  52.         void setImage(gsCTiledImage *image);
  53.         void setSize(const gsCPoint& size);
  54.  
  55.         bool setMapTile(const gsCPoint& coords,const gsCMapTile& map_tile);
  56.         void setPosition(const gsCPoint& position);
  57.  
  58.         gsCTiledImage *getImage();
  59.         gsCPoint getSize();
  60.         gsCPoint getSizeInPixels();
  61.  
  62.         gsCMapTile *getMapTile(const gsCPoint& coords);
  63.         gsCPoint getPosition();
  64.  
  65.         void clear(int tile,bool empty);
  66.  
  67.         void move(const gsCPoint& offset);
  68.  
  69.         void draw();
  70.  
  71.         int hitBy(const gsCRect& rect,gsUBYTE collision_mask);
  72.         gsCPoint getHitPosition(int n);
  73. };
  74.  
  75. //-------------------------------------------------------------
  76.  
  77. #endif
  78.