about summary refs log tree commit diff stats
path: root/data/maps/the_ancient/connections.txtpb
blob: 23989ab1fcb40dc7dadaeb66a89cb7154a372ecc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
connections {
  from_room: "Outside"
  to_room: "Inside"
  door { name: "Front Door" }
}
connections {
  from_room: "Inside"
  to_room: "Ending"
  door { name: "End Door" }
}
/* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#ifndef PART_H_FB54F361
#define PART_H_FB54F361

#include <string>
#include <set>
#include "../lib/enums.h"

namespace verbly {

  namespace generator {

    class part {
    public:

      using type = part_type;

      // Static factories

      static part createNounPhrase(std::string role, std::set<std::string> selrestrs, std::set<std::string> synrestrs);

      static part createVerb();

      static part createPreposition(std::set<std::string> choices, bool literal);

      static part createAdjective();

      static part createAdverb();

      static part createLiteral(std::string value);

      // Duplication

      static part duplicate(const part& other);

      // Copy and move constructors

      part(const part& other);

      part(part&& other);

      // Assignment

      part& operator=(part other);

      // Swap

      friend void swap(part& first, part& second);

      // Destructor

      ~part();

      // General accessors

      int getId() const
      {
        return id_;
      }

      type getType() const
      {
        return type_;
      }

      // Noun phrase accessors

      std::string getNounRole() const;

      std::set<std::string> getNounSelrestrs() const;

      std::set<std::string> getNounSynrestrs() const;

      // Preposition accessors

      std::set<std::string> getPrepositionChoices() const;

      bool isPrepositionLiteral() const;

      // Literal accessors

      std::string getLiteralValue() const;

    private:

      static int nextId_;

      int id_;

      // Private constructors

      part()
      {
      }

      part(type t) :
        id_(nextId_++),
        type_(t)
      {
      }

      // Data

      union {
        struct {
          std::string role;
          std::set<std::string> selrestrs;
          std::set<std::string> synrestrs;
        } noun_phrase_;
        struct {
          std::set<std::string> choices;
          bool literal;
        } preposition_;
        std::string literal_;
      };

      type type_ = type::invalid;

    };

  };
};

#endif /* end of include guard: PART_H_FB54F361 */