diff options
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r-- | src/core/entity.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc index fdcce59..538aecb 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -401,6 +401,26 @@ void Entity::remove_menu(std::string const &label) } } +void Entity::list_inventory() const +{ + con_print << " ^B" << name() << "^N "; + if (!entity_inventory) { + con_print << "no inventory availble" << std::endl; + return; + } + con_print << "inventory" << std::endl; + + for (Inventory::Items::const_iterator it = entity_inventory->items().begin(); it != entity_inventory->items().end(); it++) { + Item *item = (*it); + con_print << " " + << " ^B" << std::setw(4) << item->info()->id() + << " ^N" << (item->info()->type() ? item->info()->type()->label() : "NULL") + << " ^N" << item->info()->label() + << " amount " << item->amount() << std::endl; + } + +} + /* ---- class EntityDynamic ---------------------------------------- */ EntityDynamic::EntityDynamic() : Entity() |