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>2014-12-25 15:58:24 +0000
committerStijn Buys <ingar@osirion.org>2014-12-25 15:58:24 +0000
commit8f393ff70e60172c632efc81694433568df2862b (patch)
treeac87596d59ccf27dff0896c97e410643d21185bf /src/core/entity.cc
parent8f28c82e2fb26b453a2cfe976e48f74d97d6388a (diff)
Added a core::Level type, added a level attribute to core::Entity and core::Info, updated core::Player to use the new type.
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r--src/core/entity.cc78
1 files changed, 58 insertions, 20 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index f4a29dd..41ead7e 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -155,6 +155,8 @@ Entity::Entity() :
entity_died = false;
entity_dirty = false;
entity_keepalive = 0;
+
+ entity_level = 1;
entity_zone = 0;
entity_oldzone = 0;
@@ -181,6 +183,8 @@ Entity::Entity(std::istream & is)
entity_oldzone = 0;
entity_visible = true;
entity_keepalive = 0;
+
+ entity_level = 1;
entity_model = 0;
@@ -265,11 +269,6 @@ void Entity::print() const
// print header
print_header();
- // faction
- if (faction()) {
- con_print << " ^Nfaction ^B" << faction()->label() << std::endl;
- }
-
// entity type id
con_print << " ^Ntype ^B";
switch (type()) {
@@ -299,27 +298,66 @@ void Entity::print() const
// print entity flags
con_print << " ^Nflags ^B";
- if (has_flag(NonSolid)) {
- con_print << " ^Bnonsolid";
- }
- if (has_flag(Bright)) {
- con_print << " ^Bbright";
- }
- if (has_flag(Dockable)) {
- con_print << " ^Bdockable";
- }
- if (has_flag(ShowOnMap)) {
- con_print << " ^Bshownmap";
- }
- if (has_flag(KeepAlive)) {
- con_print << " ^Bkeepalive";
+ if (flags() == 0)
+ {
+ if (has_flag(NonSolid)) {
+ con_print << " ^Bnonsolid";
+ }
+ if (has_flag(Bright)) {
+ con_print << " ^Bbright";
+ }
+ if (has_flag(Dockable)) {
+ con_print << " ^Bdockable";
+ }
+ if (has_flag(ShowOnMap)) {
+ con_print << " ^Bshownmap";
+ }
+ if (has_flag(KeepAlive)) {
+ con_print << " ^Bkeepalive";
+ }
+ } else
+ {
+ con_print << " ^Bnone";
}
con_print << std::endl;
+
+ // level
+ con_print << " ^Nlevel ^B" << level() << std::endl;
+
+ // faction
+ if (faction()) {
+ con_print << " ^Nfaction ^Nid ^B" << faction()->id() << " ^Nlabel ^B" << faction()->label() << std::endl;
+ }
// info record
if (info()) {
- con_print << " ^Ninfo id ^B" << info()->id() << std::endl;
+ con_print << " ^Ninfo ^Nid ^B" << info()->id() << " ^Nlabel ^B" << info()->label() << std::endl;
+ }
+
+ // model or shape
+ if (model())
+ {
+ con_print << " ^Nmodel ^B" << model()->name() << std::endl;
+ } else
+ {
+ con_print << " ^Nshape ^B";
+ switch (shape())
+ {
+ case Diamond:
+ con_print << "diamond";
+ break;
+ case Sphere:
+ con_print << "sphere";
+ break;
+ case Cube:
+ con_print << "cube";
+ break;
+ case Axis:
+ con_print << "axis";
+ break;
+ }
}
+
// slots
if (slots() && slots()->size()) {