Changeset 05051c7 in network-game for common/WorldMap.h


Ignore:
Timestamp:
May 19, 2013, 7:12:07 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
cc1c6c1
Parents:
035d852
Message:

Added support for objects that can be at any pixel on the map, not just one per grid cell. What used to be called objects are now caled structures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/WorldMap.h

    r035d852 r05051c7  
    55
    66#include <vector>
     7
     8#include "Common.h"
    79
    810using namespace std;
     
    1719   };
    1820
     21   enum StructureType {
     22      STRUCTURE_NONE,
     23      STRUCTURE_BLUE_FLAG,
     24      STRUCTURE_RED_FLAG
     25   };
     26
    1927   enum ObjectType {
    2028      OBJECT_NONE,
     
    2331   };
    2432
     33   class Object {
     34   public:
     35      ObjectType type;
     36      POSITION pos;
     37
     38      Object(ObjectType type, int x, int y);
     39      Object(ObjectType type, POSITION pos);
     40
     41      ~Object();
     42   };
     43
    2544   int width, height;
    2645   vector<vector<TerrainType>*>* vctMap;
    27    vector<vector<ObjectType>*>* vctObjects;
     46   vector<vector<StructureType>*>* vctStructures;
     47   vector<Object>* vctObjects;
    2848
    2949   WorldMap(int width, int height);
     
    3454   void setElement(int x, int y, TerrainType type);
    3555
    36    ObjectType getObject(int x, int y);
    37    void setObject(int x, int y, ObjectType type);
     56   StructureType getStructure(int x, int y);
     57   void setStructure(int x, int y, StructureType type);
     58
     59   vector<Object> getObjects(int x, int y);
     60   void addObject(int x, int y, ObjectType type);
    3861
    3962   static WorldMap* createDefaultMap();
Note: See TracChangeset for help on using the changeset viewer.