diff options
author | Stijn Buys <ingar@osirion.org> | 2009-11-14 18:05:52 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-11-14 18:05:52 +0000 |
commit | e61d9ba10a40c9e51d14b30b86b2b3fe853f5db8 (patch) | |
tree | 469ec5d63897744132d87397c6898fa847431a4e /src/core/zone.cc | |
parent | 4293e8854a30443e4d5818fc55df404976dbfd9b (diff) |
made core::Entity and core::Zone child classes from core::Label
Diffstat (limited to 'src/core/zone.cc')
-rw-r--r-- | src/core/zone.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/core/zone.cc b/src/core/zone.cc index ac3bc4d..49b20d5 100644 --- a/src/core/zone.cc +++ b/src/core/zone.cc @@ -108,14 +108,14 @@ void Zone ::clear() } /* ---- class Zone ------------------------------------------------- */ -Zone::Zone(std::string const & label) : - zone_label(label) +Zone::Zone(std::string const & label) { zone_id = 0; - zone_name.clear(); zone_sky.clear(); zone_sky_texture = 0; zone_defaultview = 0; + + set_label(label); } Zone::Zone(std::istream & is) @@ -230,8 +230,8 @@ Entity *Zone::search_entity(const std::string & searchname) void Zone::serialize_server_update(std::ostream & os) const { - os << zone_label << " "; - os << "\"" << zone_name << "\" "; + os << label() << " "; + os << "\"" << name() << "\" "; os << "\"" << zone_sky << "\" "; os << (zone_defaultview ? zone_defaultview->id() : 0); @@ -239,16 +239,18 @@ void Zone::serialize_server_update(std::ostream & os) const void Zone::receive_server_update(std::istream &is) { - is >> zone_label; - - std::string n; unsigned int id = 0; + std::string n; char c; - + + is >> n; + set_label(n); + n.clear(); + while ((is.get(c)) && (c != '"')); while ((is.get(c)) && (c != '"')) n += c; - zone_name.assign(n); + set_name(n); n.clear(); while ((is.get(c)) && (c != '"')); |