Пример #1
0
    /// <summary>
    /// Checks if the string is a regular command and forwards targetObject to ActionHandler.
    /// </summary>
    /// <param name="command">The first word in the user's input</param>
    /// <param name="targetObject">The object found in user's input</param>
    private void parseRegularCommands(string command, RoomObject targetObject)
    {
        switch (command)
        {
        // eat
        case "iss":
        case "esse":
        case "ess":
        case "essen":
        case "verzehre":
        case "friss":
            actionHandler.eatObject(targetObject);
            break;

        // drink
        case "trink":
            actionHandler.drinkObject(targetObject);
            break;

        // talk
        case "rede":
        case "sprich":
        case "sage":
            actionHandler.talkToPerson(targetObject);
            break;

        // kill
        case "kill":
        case "stab":
        case "cleave":
        case "murder":
            actionHandler.killPerson(targetObject);
            break;

        // break
        case "zerstöre":
        case "wirf":
        case "kaputt":
        case "zerschlage":
            actionHandler.BreakObject(targetObject);
            break;

        // sit
        case "sit":
        case "sitze":
        case "setz":
        case "setzen":
        case "hinsetzen":
            actionHandler.sitOnObject(targetObject);
            break;

        // use
        case "use":
        case "benutze":
        case "nutze":
        case "brauche":
        case "benutz":
        case "schließe":
        case "zumachen":
        case "schhließen":
            actionHandler.useObject(targetObject);
            break;

        // pickup
        case "pickup":
        case "nimm":
        case "nehme":
        case "take":
        case "greif":
            actionHandler.pickupObject(targetObject);
            break;

        // wear
        case "wear":
        case "trage":
        case "anziehen":
            actionHandler.wearObject(targetObject);
            break;

        // open
        case "open":
        case "öffne":
        case "öffnen":
            actionHandler.openObject(targetObject);
            break;

        // look at
        case "look":
        case "schau":
        case "schaue":
        case "anschauen":
            actionHandler.lookAtObject(targetObject);
            break;

        // unknown command
        default:
            textPrompt.printText(defaultValues.unknownCommand);
            break;
        }
    }
Пример #2
0
    /// <summary>
    /// Checks if the string is a regular command and forwards targetObject to ActionHandler.
    /// </summary>
    /// <param name="command">The first word in the user's input</param>
    /// <param name="targetObject">The object found in user's input</param>
    private void parseRegularCommands(string command, RoomObject targetObject)
    {
        switch (command)
        {
        // eat
        case "eat":
        case "devour":
        case "consume":
            actionHandler.eatObject(targetObject);
            break;

        // drink
        case "drink":
            actionHandler.drinkObject(targetObject);
            break;

        // talk
        case "talk":
        case "speak":
        case "say":
            actionHandler.talkToPerson(targetObject);
            break;

        // kill
        case "kill":
        case "stab":
        case "cleave":
        case "murder":
            actionHandler.killPerson(targetObject);
            break;

        // break
        case "break":
        case "smash":
        case "destroy":
            actionHandler.BreakObject(targetObject);
            break;

        // sit
        case "sit":
        case "seat":
            actionHandler.sitOnObject(targetObject);
            break;

        // use
        case "use":
        case "activate":
            actionHandler.useObject(targetObject);
            break;

        // pickup
        case "pickup":
        case "grab":
        case "pick":
        case "take":
        case "steal":
            actionHandler.pickupObject(targetObject);
            break;

        // wear
        case "wear":
        case "equip":
        case "put":
            actionHandler.wearObject(targetObject);
            break;

        // open
        case "open":
        case "unlock":
        case "reveal":
            actionHandler.openObject(targetObject);
            break;

        // look at
        case "look":
            actionHandler.lookAtObject(targetObject);
            break;

        // unknown command
        default:
            textPrompt.printText(defaultValues.unknownCommand);
            break;
        }
    }