phantasmal_dgd_v1/
phantasmal_dgd_v1/bin/
phantasmal_dgd_v1/doc/
phantasmal_dgd_v1/mud/doc/
phantasmal_dgd_v1/mud/doc/api/
phantasmal_dgd_v1/mud/doc/kernel/
phantasmal_dgd_v1/mud/doc/kernel/hook/
phantasmal_dgd_v1/mud/doc/kernel/lfun/
phantasmal_dgd_v1/mud/include/
phantasmal_dgd_v1/mud/include/kernel/
phantasmal_dgd_v1/mud/kernel/lib/
phantasmal_dgd_v1/mud/kernel/lib/api/
phantasmal_dgd_v1/mud/kernel/obj/
phantasmal_dgd_v1/mud/kernel/sys/
phantasmal_dgd_v1/mud/tmp/
phantasmal_dgd_v1/mud/usr/System/
phantasmal_dgd_v1/mud/usr/System/keys/
phantasmal_dgd_v1/mud/usr/System/obj/
phantasmal_dgd_v1/mud/usr/System/open/lib/
phantasmal_dgd_v1/mud/usr/common/data/
phantasmal_dgd_v1/mud/usr/common/lib/parsed/
phantasmal_dgd_v1/mud/usr/common/obj/telopt/
phantasmal_dgd_v1/mud/usr/common/obj/ustate/
phantasmal_dgd_v1/mud/usr/game/
phantasmal_dgd_v1/mud/usr/game/include/
phantasmal_dgd_v1/mud/usr/game/obj/
phantasmal_dgd_v1/mud/usr/game/object/
phantasmal_dgd_v1/mud/usr/game/object/stuff/
phantasmal_dgd_v1/mud/usr/game/sys/
phantasmal_dgd_v1/mud/usr/game/text/
phantasmal_dgd_v1/mud/usr/game/users/
phantasmal_dgd_v1/src/host/
phantasmal_dgd_v1/src/host/beos/
phantasmal_dgd_v1/src/host/mac/
phantasmal_dgd_v1/src/host/unix/
phantasmal_dgd_v1/src/host/win32/res/
phantasmal_dgd_v1/src/kfun/
phantasmal_dgd_v1/src/lpc/
phantasmal_dgd_v1/src/parser/
#include <phantasmal/phrase.h>
#include <phantasmal/map.h>
#include <phantasmal/log.h>
#include <phantasmal/exit.h>
#include <phantasmal/lpc_names.h>

inherit unq DTD_UNQABLE;
inherit ext EXIT;

#define PHR(x) PHRASED->new_simple_english_phrase(x)

static void create(varargs int clone) {
  ext::create(clone);
  unq::create(clone);
  if(clone) {
    bdesc = nil;
    ldesc = nil;
    edesc = nil;
  }
}

void destructed(int clone, varargs int looped) {
  object exit, exit2, room;
  if(clone) {
    exit = this_object();
    room = exit->get_from_location();
    EXITD->remove_exit(room, exit);
    unq::destructed(clone);
    ext::destructed(clone);
  }
}

void upgraded(varargs int clone) {
  ext::upgraded(clone);
  unq::upgraded(clone);
}

string to_unq_text(void) {
  return "  ~newexit{\n" + to_unq_flags() + "}\n";
}

void from_dtd_unq(mixed* unq) {
  int ctr;

  if(unq[0] != "newexit")
    error("Doesn't look like exit data!");

  for (ctr = 0; ctr < sizeof(unq[1]); ctr++) {
    from_dtd_tag(unq[1][ctr][0], unq[1][ctr][1]);
  }
}

/* function which returns an appropriate error message if this object
 * isn't a container or isn't open
 */
private string is_open_cont() {
  if (!is_container()) {
    return "That object isn't a container!";
  }
  if (!is_open()) {
    return "That object isn't open!";
  }
  return nil;
}

/*
 * Overrides of OBJECT stuff
 */
object get_brief(void) {
  object desc;

  desc = ::get_brief();
  if(!desc)
    return PHRASED->new_simple_english_phrase("exit");

  return desc;
}

object get_look(void) {
  object desc;

  desc = ::get_brief();
  if(!desc)
    return EXITD->get_name_for_dir(direction);

  return desc;
}

string *get_nouns(int locale) {
  string *tmp, loc_str;
  object  dir;

  dir = EXITD->get_name_for_dir(direction);
  tmp = ::get_nouns(locale);

  loc_str = dir->get_content_by_lang(locale);
  if(loc_str)
    return (tmp ? tmp : ({ })) + ({ loc_str });

  return tmp;
}