/*
....[@@@..[@@@..............[@.................. 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@falcon.mercer.peachnet.edu 
MUD++ development mailing list    mudpp-list@spice.com
------------------------------------------------------------------------------
description.h
*/

#include "file.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( InFile & );
		int writeTo( OutFile & ); 
};

inline int Description::readFrom( InFile & 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( OutFile & out )
{
	out << '{' << name << "~ " << desc << "~}\n";

	return 0;
}