summary refs log tree commit diff stats
path: root/src/systems/realizing.h
blob: 595c58fd70066f6568c4f17d28244e6a4296d408 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef REALIZING_H_6853748C
#define REALIZING_H_6853748C

#include <string>
#include "system.h"

class RealizingSystem : public System {
public:

  RealizingSystem(Game& game) : System(game)
  {
  }

  /**
   * Creates the singleton realizable entity and initializes it with the
   * provided world definition and map object prototype definition.
   */
  id_type initSingleton(
    std::string worldFile,
    std::string prototypeFile);

  /**
   * Helper method that returns the entity ID of the (assumed) singleton entity
   * with a RealizableComponent. Throws an exception if the number of realizable
   * entities is not exactly one.
   */
  id_type getSingleton() const;

  /**
   * Loads the given map.
   */
  void loadMap(id_type mapEntity);

  /**
   * Treats the given entity as part of the active map.
   */
  void enterActiveMap(id_type entity);

  /**
   * Stops treating the given entity as part of the active map.
   */
  void leaveActiveMap(id_type entity);

};

#endif /* end of include guard: REALIZING_H_6853748C */