Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-09-17 23:05:58 +0000
committerStijn Buys <ingar@osirion.org>2010-09-17 23:05:58 +0000
commita85c3ca1ff34775f2fc93013306dec21b34b0359 (patch)
treedc45be555858f53413d2477680247c8758b98d2a /src/core/entity.cc
parent417eeaa34b8374de18358cc64511d7298bc33756 (diff)
Initial inventory loading, ships docking ships
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r--src/core/entity.cc20
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()