public Book(Noun myNoun, string shortDescription, List <string> pages)
 {
     this.canBePickedUp    = true;
     this.myNoun           = myNoun;
     this.shortDescription = shortDescription;
     this.pages            = pages;
 }
 public NounObject(Noun myNoun, string shortDescription, Dictionary <string, Func <NounObject, string> > senses, bool canBePickedUp = true, bool canHoldItems = false)
 {
     this.myNoun           = myNoun;
     this.shortDescription = shortDescription;
     this.senses           = senses;
     this.canBePickedUp    = canBePickedUp;
     this.canHoldItems     = canHoldItems;
     nounObjects.Add(this);
 }
 public NounObject GetNounObjectFromSceneUsingStem(Noun nounsearch)
 {
     foreach (var nounObject in Children)
     {
         if (nounObject.Value.myNoun.stem == nounsearch.stem)
         {
             return(nounObject.Value);
         }
     }
     return(null);
     //return Children.FirstOrDefault(o => o.Value.myNoun.stem == nounsearch.stem);
 }
 //public string KeyId;
 public Key(Noun myNoun, string shortDescription, Dictionary <string, Func <NounObject, string> > senses, bool canBePickedUp = true, bool canHoldItems = false, int isKey = 99) : base(myNoun, shortDescription, senses, canBePickedUp, canHoldItems)
 {
     this.isKey     = isKey;
     this.UseAction = (x, isInInv) =>
     {
         if (!isInInv)
         {
             return("The key has to be in your inventory!");
         }
         Console.WriteLine("What will you unlock?");
         Console.Write(">>");
         var door = Program.Instance.FindObject(Console.ReadLine())?.Value;
         if (door != null && door is IUnlockable)
         {
             return(((IUnlockable)door).Unlock(this));
         }
         else
         {
             return("I can't find that door.");
         }
     };
 }
 public Wand(Noun myNoun, string shortDescription)
 {
     this.canBePickedUp    = true;
     this.myNoun           = myNoun;
     this.shortDescription = shortDescription;
     this.senses           = new Dictionary <string, Func <NounObject, string> >();
     this.UseAction        = (x, isInInventory) =>
     {
         if (!isInInventory)
         {
             return("The wand must be in your inventory to use it!");
         }
         if (Program.Instance._gameState.isEmpowered == false)
         {
             return("You wave the wand around, but nothing happens!");
         }
         if (x.properties.ContainsKey("inscription"))
         {
             return(Program.Instance.SpellCast.CastSpell(x.properties["inscription"]));
         }
         return(null);
     };
 }
 public Door(Noun myNoun, string shortDescription, Dictionary <string, Func <NounObject, string> > senses, RoomDirections direction, Func <string> newRoomF, bool canBePickedUp = true, bool canHoldItems = false) : base(myNoun, shortDescription, senses, canBePickedUp, canHoldItems)
 {
     newDirection = direction;
     newRoom      = newRoomF;
 }
Example #7
0
 public NounReturn(NounCases nounCase, string stem, Noun word)
 {
     NounCase = nounCase;
     Stem     = stem;
     Word     = word;
 }
Example #8
0
 public string EnglishDefinitionFromNoun(Noun noun)
 {
     return(englishNounKey.Where(word1 => Equals(word1.Value, noun)).Select(word1 => word1.Key).FirstOrDefault());
 }