public static void Init(NounHolder nounHolder, VerbHolder verbHolder, AdjectiveHolder adjectiveHolder,
                                NounEndingHandler handler)
        {
            prefabs = new Dictionary <string, NounObject>();

            GrantPuzzlePrefabs();



            Dictionary <string, Func <NounObject, string> > tmp = new Dictionary <string, Func <NounObject, string> >();

            //{
            //    {
            //        "sight",
            //        (x) => $"The table is {x.properties["color"]}.  On the table there is:\n{x.FormattedChildren()}"
            //    }
            //};
            prefabs.Add("table", new NounObject(nounHolder.englishNounKey["Table"], "A table.", tmp, false, true));
            prefabs["table"].properties.Add("color", "white");

            //tmp = new Dictionary<string, Func<NounObject, string>>
            //{
            //    {"sight", (x) => $"The apple is {x.properties["color"]}."}
            //};
            prefabs.Add("apple", new NounObject(nounHolder.englishNounKey["Apple"], "An apple.", tmp));
            prefabs["apple"].properties.Add("color", "red");

            prefabs.Add("lever",
                        new NounObject(new Noun(null, "lever"), "A wooden vertical lever.",
                                       new Dictionary <string, Func <NounObject, string> >()
            {
                { "sight", (x) => "There is a plus above the lever and a minus below the lever." }
            }, false)
                        .AddProperty("switchStatus", "up")
                        .SetUseAction((x, isInInventory) =>
            {
                if (isInInventory)
                {
                    return("How did a lever get in your inventory lol");
                }
                if (!x.properties.ContainsKey("switchStatus"))
                {
                    Debug.WriteLine("Lever did not have switchStatus property");
                }
                if (x.properties["switchStatus"] == "up")
                {
                    x.properties["switchStatus"] = "down";
                    return("You flip the switch into the down position.");
                }
                else
                {
                    x.properties["switchStatus"] = "up";
                    return("You flip the switch into the up position.");
                }
            })
                        );

            #region Wands



            prefabs.Add("OrangeColorChangingWand",
                        new Wand(new Noun(null, "OrangeColorChangingWand"), "An orange wand").AddProperty("inscription",
                                                                                                          $"{nounHolder.englishNounKey["Apple"].Accusative(handler)} {adjectiveHolder.adjectives["orange"].word} {verbHolder.verbs["Change color"].verb}")
                        .AddProperty("color", "orange"));
            prefabs.Add("BlueColorChangingWand",
                        new Wand(new Noun(null, "BlueColorChangingWand"), "A blue wand").AddProperty("inscription",
                                                                                                     $"{nounHolder.englishNounKey["Apple"].Accusative(handler)} {adjectiveHolder.adjectives["blue"].word} {verbHolder.verbs["Change color"].verb}")
                        .AddProperty("color", "blue"));
            prefabs.Add("BlankWand",
                        new Wand(new Noun(null, "BlankWand"), "A plain white wand").AddProperty("color", "white"));

            #endregion


            prefabs.Add("blankPaper", new NounObject(new Noun(nounHolder.englishNounKey["Paper"].stem, "Paper"), "A piece of paper.", (x) => "A piece of paper.")
                        .AddProperty("color", "white")
                        .AddProperty("canBeWritten", true.ToString())
                        .SetUseAction
                            ((x, isInInv) => {
                if (!isInInv)
                {
                    return("The paper has to be in your inventory!");
                }
                if (Program.Instance._gameState.isEmpowered == false)
                {
                    return("You look at the paper.  Seems pretty ordinary.  Not very interesting though...");
                }
                if (x.properties.ContainsKey("writing"))
                {
                    Console.WriteLine(TextUtils.Pick("You let magic flow from your fingertips to the paper."));
                    var k = Program.Instance.SpellCast.CastSpell(x.properties["writing"]);
                    Program.Instance.RemoveObject(x);
                    Console.WriteLine(k);
                    return("The paper disappears!");
                }
                return("Yup.  That's a sheet of paper.  Seems like you could write on it or something.");
            }
                            ));
            prefabs.Add("pen", new NounObject(new Noun(null, "Pen"), "A pen", (x) => "A pen, used for writing.").AddProperty("color", "black").AddProperty("writing", null).SetUseAction(
                            (x, isInInv) =>
            {
                if (!isInInv)
                {
                    return("The pen has to be in your inventory to write with it!");
                }
                Console.WriteLine("What object will you write on?");
                Console.Write(">>");
                var objToWriteOn = Program.Instance.FindObject(Console.ReadLine(), true);
                if (objToWriteOn != null && objToWriteOn.Value.Value == null)
                {
                    return("I can't find that!");
                }
                if (objToWriteOn == null)
                {
                    return("I can't find that");
                }
                if (objToWriteOn.Value.Value.properties.ContainsKey("canBeWritten") &&
                    objToWriteOn.Value.Value.properties["canBeWritten"] == true.ToString())
                {
                    Console.WriteLine("What will you write down?");
                    Console.Write(">>");
                    var writing = Console.ReadLine();
                    objToWriteOn.Value.Value.properties["writing"] = writing;
                    return($"You write \"{writing}\" on the {objToWriteOn.Value.Key.ToLower()}");
                }
                return("You can't write on that!");
            }));
            #region Books

            prefabs.Add("empowermentBook",
                        new Book(new Noun(null, "Old Journal"), "A book containing arcane secrets.", new List <string>()
            {
                "The language of magic is very simple.  Nouns have four cases.  The first case is the nominative case.  This is used for the subject of the sentence.  In simple spells the nominative case doesn't come up much.",
                "Another case is the accusative case.  This is the object that has the action acted upon.",
                "Finally there is the topic of posession.  If the object is merely sitting in the room, then I can use the spell as usual.  But if the object is sitting on a table, in a chest, or even on my person, then I must qualify the spell with a noun in the genitive case, followed by the noun in the accusative case.",
                $"Verbs do not conjugate depending on the subject, instead the subject is determined by the case of the noun.  I have learned the word \"{Program.Instance._verbHolder.verbs["Change color"].verb}\".  This word allows me to change the color of a noun in the accusative.  The spells are comprised of the accusative noun that I want to change the color of, \"{Program.Instance._verbHolder.verbs["Change color"].verb}\", and the color in the magical language in any order.",
                "There are many different ways to activate spells, most involve inscribing the spell onto a magical object.",
                "[The rest of the pages are burnt.]"
            })
            {
                senses =
                    new Dictionary <string, Func <NounObject, string> >()
                {
                    { "sight", (x) => $"The book is a short journal." }
                },
                onReadAction = (x) =>
                {
                    if
                    (
                        Program.Instance._gameState.isEmpowered == false)
                    {
                        Console
                        .WriteLine
                            ("You feel energy rushing through you!  You can now use magical items!");
                        Program
                        .Instance
                        ._gameState
                        .isEmpowered
                            =
                                true;
                    }
                }
            });



            #endregion Books


            prefabs.Add("debug3_pedestal",
                        new NounObject(new Noun(null, "PinkPedestal"), "A pink pedestal",
                                       new Dictionary <string, Func <NounObject, string> >()
            {
                {
                    "sight",
                    (x) =>
                    $"Written at the bottom of the pedestal, you see the words \"Pink equals {Program.Instance._adjectiveHolder.adjectives["pink"].word}\""
                }
            }, false, true).AddProperty("color", "pink").SetOnUpdate(
                            (x) =>
            {
                if (x.nounChildren.Count != 0)
                {
                    foreach (var nounObject in x.nounChildren)
                    {
                        if (nounObject.Value.myNoun.stem == prefabs["apple"].myNoun.stem)
                        {
                            if (nounObject.Value.properties["color"] == "pink")
                            {
                                if (Program.Instance._gameState.currentRoom().roomKey == "Debug3")
                                {
                                    if (
                                        !Program.Instance._gameState.currentRoom()
                                        .adjoiningRooms.ContainsKey(RoomDirections.SOUTH))
                                    {
                                        Console.WriteLine("The exit door opens!");
                                        Program.Instance._gameState.roomHolder["Debug3"].adjoiningRooms.Add(
                                            RoomDirections.SOUTH, () => "Debug4");
                                    }
                                }
                            }
                        }
                    }
                }
            }));



            tmp = new Dictionary <string, Func <NounObject, string> >()
            {
                //TODO: Make more adventure-y
                { "sight", (x) => $"A machine used for inscription." }
            };
            prefabs.Add("inscriptionMachine",
                        new NounObject(new Noun(null, "inscriptionMachine"),
                                       "A machine used to inscribe new inscriptions to a wand.", tmp, false, false)
            {
                UseAction = (x, isInInv) =>
                {
                    if (isInInv)
                    {
                        Debug.WriteLine("Wow the inscription table is in the inventory, how'd that happen lol.");
                    }
                    Console.WriteLine("What wand will you inscribe?");
                    Console.Write(">>");
                    bool wandIsInInv;
                    var obj = Program.Instance.FindObject(Console.ReadLine(), out wandIsInInv, true);
                    if (obj == null)
                    {
                        return("I can't find that wand!");
                    }
                    if (!(obj.Value.Value is Wand))
                    {
                        return("You can only inscribe wands!");
                    }
                    if (wandIsInInv)
                    {
                        Console.WriteLine("What should the new inscription say?");
                        Console.Write(">>");
                        var inscription = Console.ReadLine();
                        obj.Value.Value.properties["inscription"] = inscription;
                        return($"You inscribe \"{inscription}\" onto the wand.");
                    }
                    else
                    {
                        return("The wand has to be in your inventory!");
                    }
                }
            })
            ;
            //   prefabs.Add();
        }
Beispiel #2
0
        public void RegisterCommands()
        {
            #region Movement Directions

            basicCommandMap.Add("s", () =>
            {
                if (program._gameState.currentRoom().adjoiningRooms.ContainsKey(RoomDirections.SOUTH))
                {
                    if (
                        !program._gameState.roomHolder.keyRoomMap.ContainsKey(program._gameState.currentRoom().adjoiningRooms[RoomDirections.SOUTH]()))
                    {
                        program._gameState.ChangeRoom("Debug1");
                    }
                    program._gameState.ChangeRoom(program._gameState.currentRoom().adjoiningRooms[RoomDirections.SOUTH]());
                    return("You move south.");
                }
                else
                {
                    return("You can't go that way!");
                }
            });
            basicCommandMap.Add("n", () =>
            {
                if (program._gameState.currentRoom().adjoiningRooms.ContainsKey(RoomDirections.NORTH))
                {
                    if (
                        !program._gameState.roomHolder.keyRoomMap.ContainsKey(program._gameState.currentRoom().adjoiningRooms[RoomDirections.NORTH]()))
                    {
                        program._gameState.ChangeRoom("Debug1");
                    }
                    program._gameState.ChangeRoom(program._gameState.currentRoom().adjoiningRooms[RoomDirections.NORTH]());
                    return("You move north.");
                }
                else
                {
                    return("You can't go that way!");
                }
            });
            basicCommandMap.Add("w", () =>
            {
                if (program._gameState.currentRoom().adjoiningRooms.ContainsKey(RoomDirections.WEST))
                {
                    if (
                        !program._gameState.roomHolder.keyRoomMap.ContainsKey(program._gameState.currentRoom().adjoiningRooms[RoomDirections.WEST]()))
                    {
                        program._gameState.ChangeRoom("Debug1");
                    }
                    program._gameState.ChangeRoom(program._gameState.currentRoom().adjoiningRooms[RoomDirections.WEST]());
                    return("You move west.");
                }
                else
                {
                    return("You can't go that way!");
                }
            });
            basicCommandMap.Add("e", () =>
            {
                if (program._gameState.currentRoom().adjoiningRooms.ContainsKey(RoomDirections.EAST))
                {
                    if (
                        !program._gameState.roomHolder.keyRoomMap.ContainsKey(program._gameState.currentRoom().adjoiningRooms[RoomDirections.EAST]()))
                    {
                        program._gameState.ChangeRoom("Debug1");
                    }
                    program._gameState.ChangeRoom(program._gameState.currentRoom().adjoiningRooms[RoomDirections.EAST]());
                    return("You move east.");
                }
                else
                {
                    return("You can't go that way!");
                }
            });

            #endregion Movement Directions

            basicCommandMap.Add("examine", () => program._gameState.currentRoom().FormattedRoomExamine());
            basicCommandMap.Add("x", basicCommandMap["examine"]);
            basicCommandMap.Add("l", basicCommandMap["examine"]);
            basicCommandMap.Add("look", basicCommandMap["examine"]);
            basicCommandMap.Add("cls", (() =>
            {
                Console.Clear();
                return(null);
            }));
            basicCommandMap.Add("clear", basicCommandMap["cls"]);
            basicCommandMap.Add("inventory", () =>
            {
                StringBuilder sb = new StringBuilder();
                if (program._gameState.inventory.objMap.Count > 0)
                {
                    sb.AppendLine("You are carrying:");
                    foreach (var nounObject in program._gameState.inventory.objMap)
                    {
                        sb.AppendLine($"-{nounObject.Key} : {nounObject.Value.shortDescription}");
                    }
                }
                else
                {
                    sb.AppendLine("You aren't carrying anything!");
                }
                return(sb.ToString());
            });
            basicCommandMap.Add("i", basicCommandMap["inventory"]);
            basicCommandMap.Add("quit", () =>
            {
                Environment.Exit(0);
                return(null);
            });
            basicCommandMap.Add("q", basicCommandMap["quit"]);
            complexCommandMap.Add("read", (s) =>
            {
                var obj = program.FindObject(s, true);
                if (((Book)obj?.Value)?.pages != null)
                {
                    Book book       = (Book)obj.Value.Value;
                    int currentPage = 0;
                    while (true)
                    {
                        Console.Write("\n");
                        if (book.pages.Count > currentPage)
                        {
                            Console.Write(book.pages[currentPage] + "\n");
                        }
                        else
                        {
                            currentPage -= 1;
                        }
                        Console.WriteLine($"Current Page: {currentPage + 1}");
                        Console.WriteLine("Next, Prev, Quit");
                        Console.Write(">>");
                        string cmd = Console.ReadLine();
                        switch (cmd.ToLower())
                        {
                        case "n":
                        case "next":
                            {
                                if (!(currentPage + 1 > book.pages.Count))
                                {
                                    currentPage += 1;
                                }
                                else
                                {
                                    Console.WriteLine("You've reached the end of the book.");
                                }
                                break;
                            }

                        case "p":
                        case "prev":
                            {
                                if (!(currentPage - 1 < 0))
                                {
                                    currentPage -= 1;
                                }
                                else
                                {
                                    Console.WriteLine("You've reached the beginning of the book.");
                                }
                            }
                            break;

                        case "q":
                        case "quit":
                            {
                                Console.WriteLine("You close the book.");
                                book.onReadAction(book);
                                return("");
                            }
                            break;

                        default:
                            Console.WriteLine("Please enter a valid command");
                            break;
                        }
                    }
                }
                return("You can't read that!");
            });
            complexCommandMap.Add("r", complexCommandMap["read"]);
            complexCommandMap.Add("eat", (s) => TextUtils.Pick("That doesn't seem prudent.", "I don't recommend that.", "This isn't a good idea."));
            complexCommandMap.Add("inscribe", (s) =>
            {
                //TODO:KILLAF
                //if (!s.ToLower().Contains("wand")) return "You can only inscribe on wands!";

                bool isInInventory = false;
                var obj            = program.FindObject(s, out isInInventory, true);
                if (obj != null && !(obj.Value.Value is Wand))
                {
                    return("You can only inscribe on wands!");
                }
                if (program.FindObject("Inscription Table") == null)
                {
                    return("You need to be near an inscription table to do that!");
                }
                if (isInInventory)
                {
                    Console.WriteLine("What should the new inscription say?");
                    Console.Write(">>");
                    string newInscription = Console.ReadLine();
                    obj.Value.Value.properties["inscription"] = newInscription;
                    return($"You inscribe \"{newInscription}\" onto the wand.");
                }

                return("The wand has to be in your inventory!");
            });

            complexCommandMap.Add("examine", (s =>
            {
                var obj = program.FindObject(s, true);
                StringBuilder sb = new StringBuilder();
                if (obj != null && obj.Value.Value.senses != null && obj.Value.Value.senses.ContainsKey("sight"))
                {
                    sb.AppendLine(obj.Value.Value.senses?["sight"](obj.Value.Value));
                }

                if (obj != null)
                {
                    foreach (var property in obj.Value.Value.properties)
                    {
                        if (PropertiesExaminer.propertiesMap.ContainsKey(property.Key))
                        {
                            sb.Append(PropertiesExaminer.propertiesMap[property.Key](obj.Value.Key, obj.Value.Value) + " ");
                        }
                    }
                    if (obj.Value.Value.canHoldItems)
                    {
                        if (obj.Value.Value.nounChildren.Count != 0)
                        {
                            sb.AppendLine($"\nThe {obj.Value.Key.ToLower()} has:");
                            sb.AppendLine(obj.Value.Value.FormattedChildren());
                        }
                    }
                }
                if (obj == null)
                {
                    return($"I can't find the {s}.");
                }
                if (sb.Length == 0)
                {
                    return("I don't know what to say!");
                }
                return(sb.ToString());
            }
                                              ));
            complexCommandMap.Add("x", complexCommandMap["examine"]);
            complexCommandMap.Add("look", complexCommandMap["examine"]);
            complexCommandMap.Add("l", complexCommandMap["examine"]);
            complexCommandMap.Add("zap", (s) =>
            {
                bool isInInventory;
                var obj = program.FindObject(s, out isInInventory, true);
                if (obj == null)
                {
                    return($"I can't find {s}!");
                }
                if (!isInInventory)
                {
                    return("The wand has to be in your inventory to use it!");
                }
                if (!program._gameState.isEmpowered)
                {
                    return($"You wave the wand around, but nothing happens.");
                }
                if (obj?.Value is Wand)
                {
                    if (obj.Value.Value.properties.ContainsKey("inscription"))
                    {
                        return(program.SpellCast.CastSpell(obj.Value.Value.properties["inscription"]));
                    }
                }
                return("That doesn't make any sense.");
            });
            complexCommandMap.Add("z", complexCommandMap["zap"]);

            complexCommandMap.Add("take", (s) =>
            {
                var obj = program.FindObject(s);
                if (obj != null && obj.Value.Value.canBePickedUp)
                {
                    program._gameState.inventory.AddItem(obj.Value.Key, obj.Value.Value);
                    program._gameState.currentRoom().RemoveNoun(obj.Value.Key);
                    return($"You take the {obj.Value.Key.ToLower()}.");
                }
                else
                {
                    return("You can't take that!");
                }
            });
            complexCommandMap.Add("t", complexCommandMap["take"]);
            complexCommandMap.Add("drop", (s) =>
            {
                bool isInInv;
                var obj = program.FindObject(s, out isInInv, true);
                if (obj != null && isInInv)
                {
                    program._gameState.inventory.RemoveItem(obj.Value.Key);
                    program._gameState.currentRoom().AddNoun(obj.Value.Key, obj.Value.Value);
                    return($"You drop the {s}.");
                }
                return("You can't drop that!");
            });
            complexCommandMap.Add("place", (s) =>
            {
                bool isInInv;
                if (!s.Contains(" on ") && !s.Contains(" in "))
                {
                    return("That doesn't make sense!");
                }
                bool inOn             = true;
                string invTarget      = null;
                string genitiveTarget = null;
                if (s.Contains(" on "))
                {
                    if (s.Split(new[] { " on " }, StringSplitOptions.None).Length != 2)
                    {
                        return("That doesn't make sense!");
                    }
                    invTarget      = s.Split(new[] { " on " }, StringSplitOptions.None)[0].Replace("the ", string.Empty);
                    genitiveTarget = s.Split(new[] { " on " }, StringSplitOptions.None)[1].Replace("the ", string.Empty);
                    inOn           = false;
                }
                if (s.Contains(" in "))
                {
                    if (s.Split(new[] { " in " }, StringSplitOptions.None).Length != 2)
                    {
                        return("That doesn't make sense!");
                    }

                    invTarget      = s.Split(new[] { " in " }, StringSplitOptions.None)[0].Replace("the ", string.Empty);
                    genitiveTarget = s.Split(new[] { " in " }, StringSplitOptions.None)[1].Replace("the ", string.Empty);
                    inOn           = true;
                }



                var objInvTarget      = program.FindObject(invTarget, out isInInv, true);
                var objGenitiveTarget = program.FindObject(genitiveTarget);
                if (objInvTarget != null && isInInv)
                {
                    if (objGenitiveTarget != null)
                    {
                        if (objGenitiveTarget.Value.Value.canHoldItems)
                        {
                            program._gameState.inventory.RemoveItem(objInvTarget.Value.Key);
                            //Console.WriteLine(_gameState.inventory.objMap.ContainsKey(invTarget).ToString());

                            objGenitiveTarget.Value.Value.nounChildren.Add(objInvTarget.Value.Key, objInvTarget.Value.Value);
                            program._gameState.currentRoom().RegisterNounInScene(objInvTarget.Value.Key, objInvTarget.Value.Value);
                            if (inOn)
                            {
                                return
                                ($"You place the {objInvTarget.Value.Key.ToLower()} in the {objGenitiveTarget.Value.Key.ToLower()}.");
                            }
                            else
                            {
                                return
                                ($"You place the {objInvTarget.Value.Key.ToLower()} on the {objGenitiveTarget.Value.Key.ToLower()}.");
                            }
                        }
                        return("You can't place things there!");
                    }
                    return($"What are you placing the {invTarget.ToLower()} on?");
                }
                return("What are you placing?");
            });
            complexCommandMap.Add("point", (s) =>
            {
                var obj = program.FindObject(s.Replace("at", string.Empty), true);

                if (obj == null)
                {
                    return($"I don't know what {s.Replace("at", string.Empty)} is.");
                }
                if (obj.Value.Value.myNoun.stem == null)
                {
                    return($"You point your finger at the {s.ToLower()}.  Nothing happens.");
                }
                if (program._gameState.isEmpowered)
                {
                    return($"You point your finger at the {s.ToLower()}.  The word \"{obj.Value.Value.myNoun.stem}\" {TextUtils.Pick("appears", "pops")} into your mind.");
                }
                return($"You point your finger at the {s.ToLower()}.  Doing this seems kinda /pointless/.");
            });
            complexCommandMap.Add("use", (s) =>
            {
                bool isInInventory = false;
                var obj            = program.FindObject(s, out isInInventory, true);
                if (obj == null)
                {
                    return($"I don't know what {s} is.");
                }
                if (obj.Value.Value.UseAction == null)
                {
                    return($"You can't use the {obj.Value.Key.ToLower()}.");
                }
                return(obj.Value.Value?.UseAction?.Invoke(obj.Value.Value, isInInventory));
            });
            complexCommandMap.Add("unlock", (s) =>
            {
                var k = program.FindObject(s);
                if (k == null)
                {
                    return("I can't find that!");
                }
                if (!(k.Value.Value is IUnlockable))
                {
                    return("That doesn't make sense!");
                }
                IUnlockable unlockable = (IUnlockable)k.Value.Value;

                if (unlockable.IsUnlocked)
                {
                    return("That is already unlocked!");
                }
                else
                {
                    Console.WriteLine($"Which key should be used to unlock the {k.Value.Key}?");
                    Console.Write(">>");
                    var findKey = program.FindObject(Console.ReadLine(), true);
                    if (findKey != null)
                    {
                        if (findKey.Value.Value is Key)
                        {
                            Key key = findKey.Value.Value as Key;
                            return(unlockable.Unlock(key));
                        }
                        else
                        {
                            return("That isn't a key!");
                        }
                    }
                    else
                    {
                        return("I can't find that key!");
                    }
                }
            });
        }
        private string ParseLine(string readLine)
        {
            if (CmdRegistration.basicCommandMap.ContainsKey(readLine.ToLower()))
            {
                return(CmdRegistration.basicCommandMap[readLine.ToLower()]());
            }
            if (CmdRegistration.complexCommandMap.Any(func => readLine.ToLower().Split(' ')[0] == func.Key) && readLine.ToLower().Split(' ').Length > 1)
            {
                return(CmdRegistration.complexCommandMap[readLine.ToLower().Split(' ')[0]](readLine.ToLower().Substring(readLine.ToLower().Split(' ')[0].Length + 1)));
            }


            #region debugging commands

            //Debug data
            if (readLine.ToLower().StartsWith("d:"))
            {
                switch (readLine.ToLower())
                {
                case "d:connectroom":
                    Console.WriteLine("What room should I connect to this one?");
                    Console.Write(">>");
                    string whatRoomShouldIConnectToThisOne = Console.ReadLine();
                    Console.WriteLine("What direction should I connect it with?");
                    Console.Write(">>");
                    bool           isWork = false;
                    RoomDirections direc;
                    isWork = Enum.TryParse(Console.ReadLine().ToUpper(), false, out direc);
                    if (isWork)
                    {
                        return("Connected rooms");
                    }
                    while (!isWork)
                    {
                        Console.WriteLine("I'm sorry, I didn't understand that, please enter \"north\" \"south\" \"east\" or \"west\".");
                        isWork = Enum.TryParse(Console.ReadLine(), false, out direc);
                    }
                    if (_gameState.currentRoom().adjoiningRooms.ContainsKey(direc))
                    {
                        return("Already have a room connected in that direction!");
                    }
                    _gameState.currentRoom().adjoiningRooms.Add(direc, () => whatRoomShouldIConnectToThisOne);
                    return("Connected rooms");

                case "d:empower":
                    _gameState.isEmpowered = true;
                    return("You are empowered now.");

                case "d:cast":
                    Console.Write(">>");
                    return(SpellCast.CastSpell(Console.ReadLine()).ToString());


                case "d:addnoun":
                    Console.WriteLine("What should I call this noun?");
                    Console.Write(">>");
                    string nounName = Console.ReadLine();
                    Console.WriteLine("What is the prefab of this noun called?");
                    Console.Write(">>");
                    string nounObjPossible = Console.ReadLine();
                    if (String.IsNullOrEmpty(nounObjPossible) || string.IsNullOrEmpty(nounName) | !NounPrefabs.prefabs.ContainsKey(nounObjPossible.ToLower()))
                    {
                        return("Not a valid noun.");
                    }
                    _gameState.currentRoom().Children.Add(nounName, NounPrefabs.prefabs[nounObjPossible.ToLower()]);
                    return("added");

                case "d:isnoun":
                    Console.Write(">>");
                    return(_nounHolder.GetIsNoun(Console.ReadLine(), _nounEndingHandler).ToString());

                case "d:generateallnouns":
                    _nounHolder = _stemGenerator.GenerateAllStems(true);
                    return("");

                case "d:parsenoun":
                    Console.Write(">>");
                    var parseInput = Console.ReadLine();
                    var returnedNounInformation = _nounHolder.GetNounFromInput(parseInput, _nounEndingHandler);
                    if (!_nounHolder.GetIsNoun(parseInput, _nounEndingHandler))
                    {
                        return("That's not a Noun!");
                    }
                    if (_nounHolder.EnglishDefinitionFromNoun(returnedNounInformation.Value.Word) == null)
                    {
                        return
                            ($"Stem : {returnedNounInformation.Value.Stem}\nCase : {returnedNounInformation.Value.NounCase}\nEnglish Definition : No definition found");
                    }
                    return
                        ($"Stem : {returnedNounInformation.Value.Stem}\nCase : {returnedNounInformation.Value.NounCase}\nEnglish Definition : {_nounHolder.EnglishDefinitionFromNoun(returnedNounInformation.Value.Word)}");

                case "d:regenerateendings":
                    _nounEndingHandler = new NounEndingHandler();
                    return("Regeneration Completed!");

                case "d:listendings":
                    return
                        ($"Nominative : {_nounEndingHandler.nominativeEnding}\nGenitive : {_nounEndingHandler.genitiveEnding}\nDative : {_nounEndingHandler.dativeEnding}\nAccusative : {_nounEndingHandler.accusativeEnding}");

                default:
                    return
                        ("No matching command\n Try:\nd:declineroot\nd:regenerateendings\nd:findtypeandstemfromword\nd:generatestem\nd:generateword");
                }
            }
            #endregion debugging commands

            return(TextUtils.Pick("Sorry, I missed that.", "I didn't understand that.", "That doesn't make sense!", "Huh?"));
        }