interpret.h
cowmud-0.11/src/interpret.h · 844 B
From the archive cowmud-0.11.tar.gz
Download the archive « Back to the archive contents
#ifndef _INTERPRET_H_
#define _INTERPRET_H_
#include <string>
#include "character.h"
//
// Base Interpret class
//
class BaseInterpret {
public:
virtual ~ BaseInterpret();
virtual void action(Character & ch, string parameters);
string getCommand();
int getLevelRequired();
protected:
string command;
int levelrequired;
};
#define DECLARE_INTERPRET(A) class A:public BaseInterpret { public: A(); void action(Character & ch, string parameters); }
// If you couldn't tell, I really don't like rewriting code.
// Please try to keep these in alphabetical order.
DECLARE_INTERPRET(InterpretHelp);
DECLARE_INTERPRET(InterpretPassword);
DECLARE_INTERPRET(InterpretQuit);
DECLARE_INTERPRET(InterpretSave);
DECLARE_INTERPRET(InterpretSay);
DECLARE_INTERPRET(InterpretShutdown);
DECLARE_INTERPRET(InterpretWho);
#endif