Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
clustercache.h
1 #pragma once
2 
3 #include <map>
4 #include <memory>
5 #include <string>
6 #include <map>
7 #include <vector>
8 
9 
10 class Voxel;
11 class VoxelCluster;
12 class WorldObject;
13 class ColorCoder;
14 class ClusterLoader;
15 
16 class ClusterCache {
17 
18 public:
19  ClusterCache();
20  virtual ~ClusterCache();
21 
22  void fillObject(WorldObject* worldObject, const std::string& filename);
23  void fillCluster(VoxelCluster* cluster, const std::string& filename);
24 
25  static ClusterCache *instance();
26 
27 
28 protected:
29  std::vector<Voxel*> * getOrCreate(const std::string& filename);
30 
31  std::map<std::string, std::vector<Voxel*>*> m_items;
32  std::unique_ptr<ClusterLoader> m_loader;
33  std::unique_ptr<ColorCoder> m_colorCoder;
34 
35  static ClusterCache *s_instance;
36 };
Definition: clustercache.h:16
Definition: worldobject.h:43
Definition: voxelcluster.h:21
Definition: clusterloader.h:12
Definition: colorcoder.h:8
Definition: voxel.h:15