we may as well pass the parameters for the entity to the factory method, this does the initialization in one step.
| 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 | { |
nothing calls this directly
no outgoing calls
no test coverage detected