CleverRaven/Cataclysm-DDA — pull request #9629 by BevapDin (2014-10-21 11:17:54+00:00)
Title: Get rid of the itypes map and other old and redundant containers.

This removes the `itypes` map and the `standard_itype_ids` and `artifact_itype_ids` along with some minor improvements:

- Replace access to `itypes` with either access to `item_controller->find_template` or access to a temporary item instance (let the item constructor get the item type from the id).
- Add functions to export the available item type definitions from the `item_controller`, that way one can iterator them to get the artifacts (for storing them) and the list of item ids for the debug menu. This makes the artifact_itype_ids and standard_itype_ids obsolete.
- Wrap the `item_controller` into a `std::unique_ptr` because valgrind complained that it was not freed upon end of game, now it is automatically freed when the program exits.
- Move loading and storing `morale_point` into savegame_json.cpp
- Move the creation of the MISSING_ITEM itype into itypedef.cpp to the remaining static item types. Also added a static constant that contains that item type id and use that as reference in npc.cpp instead of a string literal.
- Add documentation for the Item_factory class.

Add two wrapper functions to `Item_factory`:
- `Item_factory::nname` is a wrapper around `itype::nname`
- `Item_factory::count_by_charges` is a wrapper around `itype::count_by_charges`

Both itype functions of often used and when the caller does not need the whole itype pointer (e.g. just the translated name of the item) one can use those functions. This would also allow the caller to *not* include the itype header, but sadly itype.h is included via artifact.h, via inventory.h, via player.h in nearly every file.