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-18 13:25:37 +0000
committerStijn Buys <ingar@osirion.org>2010-09-18 13:25:37 +0000
commitfc4809e41bc5694231046eb2fd4c324c4daba13f (patch)
tree02f183a0779aa0457e13f42037f3631ea28b7b65 /src/core/entity.cc
parent8c6a1a404ac8d1589a37d54b3b7ce0d776fe4751 (diff)
cosmetic updates in engine list functions, trade menu updates
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r--src/core/entity.cc46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 538aecb..0b3a402 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -81,6 +81,26 @@ void Entity::clear()
entity_nextid = 0;
}
+void Entity::list_inventory() const
+{
+ con_print << " entity id ^B" << id() << " ^Nlabel ^B" << label() << " ^Nname ^B" << name() << std::endl;
+ if (!entity_inventory) {
+ con_print << "no inventory availble" << std::endl;
+ return;
+ }
+
+ con_print << " ^Nid type label amount" << 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" << aux::pad_right((item->info()->type() ? item->info()->type()->label() : "NULL"), 8)
+ << " ^N" << aux::pad_right(item->info()->label(), 24)
+ << std::setw(5) << item->amount() << std::endl;
+ }
+ con_print << "^B " << entity_inventory->items().size() << " inventory items" << std::endl;
+}
+
void Entity::list_header()
{
con_print << " "
@@ -94,8 +114,8 @@ void Entity::list(const Entity *entity)
{
con_print << " "
<< "^B" << std::setw(4) << entity->id() << " "
- << "^B" << std::setfill('0') << std::setw(4) << entity->type() << ":" << std::setw(4) << entity->moduletype() << std::setfill(' ') << " "
- << "^B" << aux::pad_right(entity->label(), 24) << " "
+ << "^N" << std::setfill('0') << std::setw(4) << entity->type() << ":" << std::setw(4) << entity->moduletype() << std::setfill(' ') << " "
+ << "^N" << aux::pad_right(entity->label(), 24) << " "
<< "^N" << entity->name() << std::endl;
}
@@ -107,7 +127,7 @@ void Entity::list()
Entity *entity = (*it).second;
list(entity);
}
- con_print << entity_registry.size() << " entities" << std::endl;
+ con_print << "^B " << entity_registry.size() << " entities" << std::endl;
}
/* ---- class Entity ----------------------------------------------- */
@@ -401,26 +421,6 @@ 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()