All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FireworksDisplayService.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Streaming.h"
6 #include "Fireworks.h"
7 #include "Camera.h"
8 #include "SceneGraphCellCallback.h"
9 #include "Random.h"
10 #include "Types.h"
11 #include "ICallback.h"
12 #include "MortonKey.h"
13 #include "Terrain.h"
14 #include <map>
15 #include <vector>
16 
17 namespace Eegeo
18 {
19  namespace Fireworks
20  {
22  {
23  public:
24 
25  FireworksDisplayService(FireworksLocationRepository& fireworksLocationRepository,
26  FireworksSequenceFactory& sequenceFactory,
27  Streaming::StreamingController& streamingController,
29  Random& random);
31 
32  void Update(float dt, const Camera::RenderCamera& renderCamera);
33 
34  private:
35 
36  void HandleCellsMadeVisible(const std::vector<Streaming::MortonKey>& mortonKeys);
37  void HandleCellsMadeInvisible(const std::vector<Streaming::MortonKey>& mortonKeys);
38 
39  void HandleLocationAdded(const IFireworksLocation& fireworksLocation);
40  void HandleLocationRemoved(const IFireworksLocation& fireworksLocation);
41 
42  bool TryAddDisplay(const IFireworksLocation& location);
43  void RemoveDisplay(const IFireworksLocation& location);
44 
45  Random& m_random;
46 
47  FireworksLocationRepository& m_fireworksLocationRepository;
48  FireworksSequenceFactory& m_fireworksSequenceFactory;
50  Streaming::StreamingController& m_streamingController;
51 
54 
57 
58  typedef std::map<u32, FireworksDisplay*> TUidToFireworksDisplayMap;
59  TUidToFireworksDisplayMap m_uniqueIdToFireworksDisplayMap;
60  };
61  }
62 }