MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / make_entity

Method make_entity

samples/factory.cpp:25–29  ·  view source on GitHub ↗

we may as well pass the parameters for the entity to the factory method, this does the initialization in one step.

Source from the content-addressed store, hash-verified

23 // we may as well pass the parameters for the entity to the factory method, this does the initialization
24 // in one step.
25 Entity *make_entity(const int width, const int height, const int x, const int y, const std::string &name)
26 {
27 auto entity = entities.insert({name, Entity{width, height, x, y, name}});
28 return &(entity.first->second);
29 }
30
31 Entity *get_entity(const std::string &name)
32 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected