objtypes.h
./mud++0.26/src/objtypes.h · 7.1 KB
From the archive mud++0.26f.tar.gz
Download the archive « Back to the archive contents
/*
....[@@@..[@@@..............[@.................. 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-list@mailhost.net
------------------------------------------------------------------------------
objtypes.h
*/
// instead of this file include object.h
#ifndef OBJTYPES_H
#define OBJTYPES_H
/*
class ObjTemplate : public Object
{
protected:
int values;
public:
ObjTemplate()
: values(0)
{}
ObjTemplate( const ObjTemplate & x)
: Object(x), values(x.values)
{}
virtual ~ObjTemplate() {}
virtual Object * clone() const { return new ObjTemplate(*this); }
virtual int readFromTypeSpecific( InFile & in );
virtual int writeToTypeSpecific( OutFile & out ) const;
virtual void reportVals( String & str ) const;
virtual char * setVals( const String & str );
virtual bool isTemplate() const { return true; }
virtual const char *typeName() const
{ return lookupObjTypeName(ITEM_TEMPLATE); }
virtual bool isType( int type )
{ return (type == ITEM_TEMPLATE ) ? true : Object::isType(type); }
int getValues() { return values; }
void setValues(int x) { values = x; }
};
*/
class ObjWeapon : public Object
{
protected:
int dam_type;
int min_dam;
int max_dam;
public:
ObjWeapon()
: dam_type(0), min_dam(0), max_dam(0)
{ }
ObjWeapon( const ObjWeapon & x )
: Object( x ), dam_type(x.dam_type), min_dam(x.min_dam),
max_dam(x.max_dam)
{ }
virtual ~ObjWeapon() {}
virtual Object * clone() const { return new ObjWeapon(*this); }
virtual void reportVals( String & str ) const;
virtual char * setVals( const String & str );
virtual int readFromTypeSpecific( InFile & in );
virtual int writeToTypeSpecific( OutFile & out ) const;
virtual bool isWeapon() const { return true; }
virtual const char *typeName() const
{ return lookupObjTypeName(ITEM_WEAPON); }
virtual bool isType( int type )
{ return (type == ITEM_WEAPON ) ? true : Object::isType(type); }
int getDamType() const { return dam_type; }
void setDamType( int x ) { dam_type = x; }
int getMinDam() const { return min_dam; }
int getMaxDam() const { return max_dam; }
};
class ObjFood : public Object
{
protected:
int food_worth;
public:
ObjFood()
: food_worth(0)
{}
ObjFood( const ObjFood & x)
: Object(x), food_worth(x.food_worth)
{}
virtual ~ObjFood() {}
virtual Object * clone() const { return new ObjFood(*this); }
virtual int readFromTypeSpecific( InFile & in );
virtual int writeToTypeSpecific( OutFile & out ) const;
virtual void reportVals( String & str ) const;
virtual char * setVals( const String & str );
virtual bool isFood() const { return true; }
virtual const char *typeName() const
{ return lookupObjTypeName(ITEM_FOOD); }
virtual bool isType( int type )
{ return (type == ITEM_FOOD ) ? true : Object::isType(type); }
int getFoodWorth() { return food_worth; }
void setFoodWorth(int x) { food_worth = x; }
};
class ObjLiquidContainer : public Object
{
protected:
int amount;
public:
ObjLiquidContainer()
: amount(0)
{}
ObjLiquidContainer( const ObjLiquidContainer & x)
: Object(x), amount(x.amount)
{}
virtual ~ObjLiquidContainer() {}
virtual Object * clone() const { return new ObjLiquidContainer(*this); }
virtual int readFromTypeSpecific( InFile & in );
virtual int writeToTypeSpecific( OutFile & out ) const;
virtual void reportVals( String & str ) const;
virtual char * setVals( const String & str );
virtual bool isLiquidContainer() const { return true; }
virtual const char *typeName() const
{ return lookupObjTypeName(ITEM_LIQUID_CONTAINER); }
virtual bool isType( int type )
{ return (type == ITEM_LIQUID_CONTAINER ) ? true : Object::isType(type); }
int getAmount() { return amount; }
void setAmount(int x) { amount = x; }
};
class ObjCorpse : public Object
{
protected:
int values;
public:
ObjCorpse()
: values(0)
{}
ObjCorpse( const ObjCorpse & x)
: Object(x), values(x.values)
{}
virtual ~ObjCorpse() {}
virtual Object * clone() const { return new ObjCorpse(*this); }
virtual int readFromTypeSpecific( InFile & ) {return 0;}
virtual int writeToTypeSpecific( OutFile & ) const {return 0;}
virtual bool isCorpse() const { return true; }
virtual const char *typeName() const
{ return lookupObjTypeName(ITEM_CORPSE); }
virtual bool isType( int type )
{ return (type == ITEM_CORPSE ) ? true : Object::isType(type); }
int getValues() { return values; }
void setValues(int x) { values = x; }
};
class ObjGold : public Object
{
protected:
int values;
public:
ObjGold()
: values(0)
{}
ObjGold( const ObjGold & x)
: Object(x), values(x.values)
{}
virtual ~ObjGold() {}
virtual Object * clone() const { return new ObjGold(*this); }
virtual int readFromTypeSpecific( InFile & ) {return 0;}
virtual int writeToTypeSpecific( OutFile & ) const {return 0;}
virtual bool isGold() const { return true; }
virtual const char *typeName() const
{ return lookupObjTypeName(ITEM_GOLD); }
virtual bool isType( int type )
{ return (type == ITEM_GOLD ) ? true : Object::isType(type); }
int getValues() { return values; }
void setValues(int x) { values = x; }
};
class ObjArmor : public Object
{
protected:
int values;
public:
ObjArmor()
: values(0)
{}
ObjArmor( const ObjArmor & x)
: Object(x), values(x.values)
{}
virtual ~ObjArmor() {}
virtual Object * clone() const { return new ObjArmor(*this); }
virtual int readFromTypeSpecific( InFile & ) {return 0;}
virtual int writeToTypeSpecific( OutFile & ) const {return 0;}
virtual bool isArmor() const { return true; }
virtual const char *typeName() const
{ return lookupObjTypeName(ITEM_ARMOR); }
virtual bool isType( int type )
{ return (type == ITEM_ARMOR ) ? true : Object::isType(type); }
int getValues() { return values; }
void setValues(int x) { values = x; }
};
class ObjContainer : public Object
{
protected:
int values;
public:
ObjContainer()
: values(0)
{}
ObjContainer( const ObjContainer & x)
: Object(x), values(x.values)
{}
virtual ~ObjContainer() {}
virtual Object * clone() const { return new ObjContainer(*this); }
virtual int readFromTypeSpecific( InFile & ) {return 0;}
virtual int writeToTypeSpecific( OutFile & ) const {return 0;}
virtual bool isContainer() const { return true; }
virtual const char *typeName() const
{ return lookupObjTypeName(ITEM_CONTAINER); }
virtual bool isType( int type )
{ return (type == ITEM_CONTAINER ) ? true : Object::isType(type); }
int getValues() { return values; }
void setValues(int x) { values = x; }
};
#endif // OBJTYPES_H