AnnLevel.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 
14 #include "AnnTypes.h"
15 
16 #define LEVEL \
17 public \
18  Annwvyn::AnnLevel
19 #define constructLevel() AnnLevel()
20 
21 #include "AnnAbstractMovable.hpp"
22 
23 namespace Annwvyn
24 {
27  {
28  public:
30  AnnLevel();
31 
33  virtual void load() = 0;
34 
36  virtual ~AnnLevel();
37 
39  virtual void unload();
40 
42  virtual void runLogic() = 0;
43 
45  AnnGameObjectList& getContent();
46 
48  AnnLightList& getLights();
49 
51  AnnTriggerObjectList& getTriggers();
52 
53  protected:
54  friend class AnnLevelManager;
55 
56  //Game object of the level
58 
59  //Lights in the level
61 
62  //Spatial trigger volumes in the level
64 
67 
69  std::shared_ptr<AnnLightObject> addLightObject(std::string id = "");
70 
72  std::shared_ptr<AnnTriggerObject> addTrggerObject(std::string id = "");
73 
75  std::shared_ptr<AnnGameObject> addGameObject(std::string entityName, std::string name = "");
76 
78  void addManualMovableObject(std::shared_ptr<AnnAbstractMovable> movable);
79 
81  template <class AbstractMovableType, class... Args>
82  decltype(auto) addManualMovableObject(Args&&... args)
83  {
84  auto movable = std::make_shared<AbstractMovableType>(args...);
85  addManualMovableObject(movable);
86  return movable;
87  }
88 
91  };
92 
94 }
Base class for all Levels. Is abstract.
Definition: AnnLevel.hpp:26
std::vector< std::shared_ptr< AnnAbstractMovable > > levelMovable
List of movable on the level.
Definition: AnnLevel.hpp:66
Namespace containing the totality of Annwvyn components.
Definition: AnnGetter.cpp:8
Class that take care of switching between different levels dynamically and clearing the memory afterw...
AnnTriggerObjectList levelTrigger
Definition: AnnLevel.hpp:63
AnnGameObjectList levelContent
Definition: AnnLevel.hpp:57
Data types definition for Annwvyn.
#define AnnDllExport
Definition: systemMacro.h:24
AnnLightList levelLighting
Definition: AnnLevel.hpp:60
std::string name
Name of the level.
Definition: AnnLevel.hpp:90