| src/surfacecollection.h |
| 21 | 21 | #define SURFACECOLLECTION_H |
| 22 | 22 | |
| 23 | 23 | #include <google/dense_hash_map> |
| 24 | #include <string> |
| 24 | 25 | |
| 25 | | #include "surface.h" |
| 26 | | #include "utilities.h" |
| 26 | class Surface; |
| 27 | 27 | |
| 28 | | using google::dense_hash_map; |
| 29 | | typedef dense_hash_map<string, Surface *> SurfaceHash; |
| 28 | typedef google::dense_hash_map<std::string, Surface *> SurfaceHash; |
| 30 | 29 | |
| 31 | 30 | /** |
| 32 | 31 | Hash Map of surfaces that loads surfaces not already loaded and reuses already loaded ones. |
| ... | ... | |
| 36 | 35 | class SurfaceCollection { |
| 37 | 36 | private: |
| 38 | 37 | SurfaceHash surfaces; |
| 39 | | string skin; |
| 38 | std::string skin; |
| 40 | 39 | |
| 41 | 40 | public: |
| 42 | | SurfaceCollection(bool defaultAlpha=true, const string &skin="default"); |
| 41 | SurfaceCollection( |
| 42 | bool defaultAlpha = true, const std::string &skin = "default"); |
| 43 | 43 | ~SurfaceCollection(); |
| 44 | 44 | |
| 45 | | void setSkin(const string &skin); |
| 46 | | string getSkinFilePath(const string &file); |
| 45 | void setSkin(const std::string &skin); |
| 46 | std::string getSkinFilePath(const std::string &file); |
| 47 | 47 | |
| 48 | 48 | bool defaultAlpha; |
| 49 | 49 | void debug(); |
| 50 | 50 | |
| 51 | | Surface *add(Surface *s, const string &path); |
| 52 | | Surface *add(const string &path, bool alpha=true); |
| 53 | | Surface *addSkinRes(const string &path, bool alpha=true); |
| 54 | | void del(const string &path); |
| 51 | Surface *add(Surface *s, const std::string &path); |
| 52 | Surface *add(const std::string &path, bool alpha=true); |
| 53 | Surface *addSkinRes(const std::string &path, bool alpha=true); |
| 54 | void del(const std::string &path); |
| 55 | 55 | void clear(); |
| 56 | | void move(const string &from, const string &to); |
| 57 | | bool exists(const string &path); |
| 56 | void move(const std::string &from, const std::string &to); |
| 57 | bool exists(const std::string &path); |
| 58 | 58 | |
| 59 | | Surface *operator[](const string &); |
| 60 | | Surface *skinRes(const string &); |
| 59 | Surface *operator[](const std::string &); |
| 60 | Surface *skinRes(const std::string &); |
| 61 | 61 | }; |
| 62 | 62 | |
| 63 | 63 | #endif |