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>2012-11-25 12:06:13 +0000
committerStijn Buys <ingar@osirion.org>2012-11-25 12:06:13 +0000
commitd8be908233fd7b85492d7a9e87f07bb207173990 (patch)
tree70d9103a867688838fc517290bb370366c69fedb /src/core/entity.cc
parentedc5ddce817244111b302e449c28a052f2746cc4 (diff)
Moved core::EntityGlobe into a separate file,
added various methods to core::Item and core::Slot, added r_slots cvar to draw entity slots and docks, added game methods for mounting and umounting of weapons, added playerlist to chat window.
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r--src/core/entity.cc72
1 files changed, 16 insertions, 56 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 462a46d..64546a7 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -278,7 +278,7 @@ void Entity::print_inventory() const
return;
}
- con_print << " ^Nitem info infotype amount" << std::endl;
+ con_print << " ^Nitem infotype info amount flags" << std::endl;
for (Inventory::Items::const_iterator it = entity_inventory->items().begin(); it != entity_inventory->items().end(); it++) {
Item *item = (*it);
// TODO item flags
@@ -286,7 +286,20 @@ void Entity::print_inventory() const
<< " ^B" << std::setw(4) << item->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;
+ << std::setw(5) << item->amount();
+ if (item->has_flag(core::Item::Tradeable)) {
+ con_print << " tradeable";
+ }
+ if (item->has_flag(core::Item::Unique)) {
+ con_print << " unique";
+ }
+ if (item->has_flag(core::Item::Unrestricted)) {
+ con_print << " unrestricted";
+ }
+ if (item->has_flag(core::Item::Mounted)) {
+ con_print << " mounted";
+ }
+ con_print<< std::endl;
}
con_print << "^B " << entity_inventory->items().size() << " inventory items" << std::endl;
}
@@ -1460,58 +1473,5 @@ void EntityControlable::frame(const unsigned long elapsed)
}
}
-
-/*----- EntityGlobe ------------------------------------------------ */
-
-EntityGlobe::EntityGlobe() : Entity()
-{
- entity_texture_id = 0;
- entity_corona_id = 0;
- entity_rotationspeed = 0;
- set_shape(Sphere);
-}
-
-EntityGlobe::EntityGlobe(std::istream & is) : Entity(is)
-{
- entity_texture_id = 0;
- entity_corona_id = 0;
- entity_rotationspeed = 0;
- set_shape(Sphere);
-}
-
-EntityGlobe::~EntityGlobe()
-{
-}
-
-void EntityGlobe::serialize_server_create(std::ostream & os) const
-{
- Entity::serialize_server_create(os);
- os << entity_rotationspeed << " \"" << texturename() << "\" \"" << coronaname() << "\" ";
-}
-
-void EntityGlobe::receive_server_create(std::istream &is)
-{
- Entity::receive_server_create(is);
-
- is >> entity_rotationspeed;
-
- std::string n;
- char c;
-
- // read texture name
- while ((is.get(c)) && (c != '"'));
- while ((is.get(c)) && (c != '"'))
- n += c;
-
- entity_texturename.assign(n);
-
- // read corona name
- n.clear();
- while ((is.get(c)) && (c != '"'));
- while ((is.get(c)) && (c != '"'))
- n += c;
- entity_coronaname.assign(n);
-}
-
-}
+} //namespace core