musicmud-2.1.6/data/
musicmud-2.1.6/data/help/
musicmud-2.1.6/data/policy/
musicmud-2.1.6/data/wild/
musicmud-2.1.6/data/world/
musicmud-2.1.6/doc/
musicmud-2.1.6/src/ident/
musicmud-2.1.6/src/lua/
musicmud-2.1.6/src/lua/include/
musicmud-2.1.6/src/lua/src/lib/
musicmud-2.1.6/src/lua/src/lua/
musicmud-2.1.6/src/lua/src/luac/
#ifndef VERB_H
#define VERB_H

#include "pflags.h"

enum VFlag {
  VFL_NONE = 0,
  VFL_DENYEXISTS = 1,
  VFL_MAGICSPACE = 2,
  VFL_OKNOOWNER  = 4,
};

inline VFlag operator|(VFlag a, VFlag b) {
  return VFlag(int(a)|int(b));
}

//! a verb - a command that can be executed by a mudobject and cause some code to run
class Verb : public Object {
 public :
    unsigned int minlen;
    int privneeded;
    PFlag pflag;
    bool disabled;
    int vflags;
    Verb(const char *_id, int _minlen, int _privneeded, PFlag _pflag, VFlag vflag=VFL_NONE);
    virtual bool invoke(MudObject *invoker, int argc, const char*argv[]) = 0;
    bool matches(const char *what) const;
    bool has_privs(MudObject *) const;
    virtual Verb *drill() { return this; };
};

//! a verb which acts as an alias for another verb.
class AliasVerb : public Verb {
 public:
  Verb *aliasof;
  Verb *drill() { return aliasof; }
  bool invoke(MudObject *invoker, int argc, const char **argv) {
    return aliasof->invoke(invoker, argc, argv);
  }
  AliasVerb(const char *_id, Verb *_what) 
    : Verb(_id, strlen(_id), 10000, PFL_NONE) {
    aliasof = _what;
  };
};

#endif