Cafu Engine
EntityCreateParams.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_GAMESYS_ENTITY_CREATE_PARAMS_HPP_INCLUDED
8 #define CAFU_GAMESYS_ENTITY_CREATE_PARAMS_HPP_INCLUDED
9 
10 #include "TypeSys.hpp"
11 
12 
13 namespace cf
14 {
15  namespace GameSys
16  {
17  class WorldT;
18 
19 
20  /// Creation parameters for a game entity.
22  {
23  public:
24 
25  /// The constructor.
26  /// @param World_ The world in which the entity should be created.
27  EntityCreateParamsT(WorldT& World_);
28 
29  /// This method is used on the client to create entities with the ID sent from the server,
30  /// not the automatically created ID that would otherwise (normally) be used.
31  void ForceID(unsigned int ID);
32 
33  /// Returns the "forced" ID that is to be used for the new entity,
34  /// or `UINT_MAX` if the normal ID should be used.
35  unsigned int GetID() const { return m_ID; }
36 
37 
38  WorldT& World; ///< The world in which the entity should be created.
39 
40 
41  private:
42 
43  unsigned int m_ID;
44  };
45  }
46 }
47 
48 #endif
EntityCreateParamsT(WorldT &World_)
The constructor.
Definition: EntityCreateParams.cpp:15
Creation parameters for a game entity.
Definition: EntityCreateParams.hpp:21
WorldT & World
The world in which the entity should be created.
Definition: EntityCreateParams.hpp:38
Definition: World.hpp:85
void ForceID(unsigned int ID)
This method is used on the client to create entities with the ID sent from the server, not the automatically created ID that would otherwise (normally) be used.
Definition: EntityCreateParams.cpp:22
This class holds the hierarchy of game entities that populate a game world.
Definition: World.hpp:39
unsigned int GetID() const
Returns the "forced" ID that is to be used for the new entity, or UINT_MAX if the normal ID should be...
Definition: EntityCreateParams.hpp:35
Definition: TypeSys.hpp:52