Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// inflect.js

(function () {
  /* global adventurejs A */

  var p = adventurejs.Dictionary.prototype;

  /**
   * Takes a plural pronoun token ("we", "we're", etc)
   * and converts to the equivalent pronoun according
   * to game.settings.prounouns, unless another set of
   * pronouns is provided.
   * @memberOf adventurejs.Dictionary
   * @method adventurejs.Dictionary#inflect
   * @kind function
   * @param {String} pronoun
   * @ajsinternal
   */
  p.inflect = function Dictionary_inflect(
    pronoun,
    pronouns = this.game.settings.pronouns
  ) {
    if ("undefined" === typeof this.inflections[pronouns]) return ""; //pronoun;
    if ("undefined" === typeof this.inflections[pronouns][pronoun]) return ""; //pronoun;
    return this.inflections[pronouns][pronoun];
  };
})();