/* ....[@@@..[@@@..............[@.................. MUD++ is a written from ....[@..[@..[@..[@..[@..[@@@@@....[@......[@.... scratch multi-user swords and ....[@..[@..[@..[@..[@..[@..[@..[@@@@@..[@@@@@.. sorcery game written in C++. ....[@......[@..[@..[@..[@..[@....[@......[@.... This server is an ongoing ....[@......[@..[@@@@@..[@@@@@.................. development project. All ................................................ contributions are welcome. ....Copyright(C).1995.Melvin.Smith.............. Enjoy. ------------------------------------------------------------------------------ Melvin Smith (aka Fusion) msmith@hom.net MUD++ development mailing list mudpp@van.ml.org ------------------------------------------------------------------------------ description.h */ #include "io.h" #include "string.h" #include "nameable.h" class Description : public Nameable { private: String desc; public: Description() {} Description( const String & x, const String & y ) : Nameable( x ), desc( y ) { } const String & getDesc() { return desc; } void setDesc( const String & x ) { desc = x; } int readFrom( StaticInput & ); int writeTo( Output & ); }; inline int Description::readFrom( StaticInput & in ) { char buf[ 256 ]; if( *in.getword( buf ) != '{' ) return -1; name = in.getstring( buf ); desc = in.getstring( buf ); if( *in.getword( buf ) != '}' ) return -1; return 0; } inline int Description::writeTo( Output & out ) { out << '{' << name << "~ " << desc << "~}\n"; return 0; }