Example #1
0
        public override Handler DoOpen(ParsedInput input)
        {
            if (input.Words.Length == 1)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_WHAT, "Open".ToParagraph()));
            }
            if (IsDead)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_PLAYER_IS_DEAD));
            }

            ItemContainer container = ContainerSlots.GetContainer(input.Words[1]);

            if (container == null)
            {
                container = Hands.GetItem(input.Words[1], false, ITEM_TYPE.CONTAINER_ANY) as ItemContainer;
            }
            if (container == null)
            {
                container = CurrentRoom.Items.Find(input.Words[1], ITEM_TYPE.CONTAINER_ANY) as ItemContainer;
            }
            if (container == null)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_ITEM));
            }

            if (!container.Closed)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_CONTAINER_ALREADY_OPEN, container.NameAsParagraph));
            }

            container.Closed = false;
            return(Handler.HANDLED(MESSAGE_ENUM.PLAYER_OPEN, container.NameAsParagraph));
        }
Example #2
0
        public override Handler DoPrice(ParsedInput input)
        {
            if (input.Words.Length == 1)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_WHAT, "Price".ToParagraph()));
            }
            if (IsDead)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_PLAYER_IS_DEAD));
            }

            // verify that we're in a shop
            RoomShop shop = CurrentRoom as RoomShop;

            if (shop == null)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_NOT_A_SHOP));
            }

            Handler handler = new Handler(RETURN_CODE.HANDLED, MESSAGE_ENUM.ERROR_BAD_ITEM);

            foreach (EntityHand hand in Hands.Hands)
            {
                handler = shop.DoPriceItem(hand.Item, input.Words[1]);
                if (handler.MessageCode != MESSAGE_ENUM.ERROR_BAD_ITEM)
                {
                    break;
                }
            }

            return(handler);
        }
        public static ParsedInput Dequeue()
        {
            ParsedInput p = Queue.Dequeue();

            History.Add(p.String);
            return(p);
        }
Example #4
0
 public override Handler DoLook(ParsedInput input)
 {
     // "look"
     if (input == null || input.Words.Length < 2)
     {
         return(Handler.HANDLED(MESSAGE_ENUM.BASE_STRING, Coordinates.CurrentRoomDisplayParagraph));
     }
     // look <item|npc>
     else if (input.Words.Length == 2)
     {
         return(DoLook(input.Words[1]));
     }
     // look <at|in|my|ordinal> <item|npc>
     else if (input.Words.Length == 3)
     {
         return(DoLook(input.Words[1], input.Words[2]));
     }
     // look <at|in> <my|ordinal> <item|npc>
     else if (input.Words.Length == 4)
     {
         return(DoLook(input.Words[1], input.Words[2], input.Words[3]));
     }
     // handling a five-word phrase seems impractical
     return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
 }
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            await ItemTemplates.Load();

            await World.Load();

            await EntityNPCTemplates.Load();

            await Messages.Load();

            await EntityRelationshipTable.Load();

            // DEBUG
            // AppendParagraph(EntityRelationshipTable.DisplayString().ToParagraph());
            // END DEBUG

            // world update timer
            WorldUpdateTimer      = new Timer(Update, null, 1000, 50);
            CheckAppendQueueTimer = new Timer(CheckAppendQueue, null, 0, 100);

            // DEBUG
            AddDebug();
            // END DEBUG

            // initialize player
            Game.Initialize();
            ParsedInput input   = null;
            Handler     handler = Game.Player.DoLook(input);

            MessageQueue.Enqueue(handler.Message);
            // Messages.Display(handler.MessageCode, handler.ParagraphToAppend);

            //AppendParagraph(Game.Player.DoLook(input).ParagraphToAppend);
            txtInput.Focus(FocusState.Programmatic);
        }
Example #6
0
        public override Handler DoSearch(ParsedInput input)
        {
            if (input.Words.Length == 1)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_WHAT, "Search".ToParagraph()));
            }

            int    nOrdinal = 0;
            string strNPC   = "";

            switch (input.Words.Length)
            {
            case 2:
                strNPC = input.Words[1];
                break;

            case 3:
                if (!Statics.OrdinalStringToInt.ContainsKey(input.Words[1]))
                {
                    return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
                }
                nOrdinal = Statics.OrdinalStringToInt[input.Words[1]];
                strNPC   = input.Words[2];
                break;

            default:
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
            }

            EntityNPCBase npc = CurrentRoom.NPCs.FindDead(strNPC, nOrdinal);

            if (npc == null)
            {
                npc = CurrentRoom.NPCs.Find(strNPC, nOrdinal);
            }
            if (npc == null)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
            }
            if (!npc.IsDead)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_NPC_NOT_DEAD, npc.NameAsParagraph));
            }

            // add npc inventory to room
            // TODO: messaging?
            // You search the goblin and remove its equipment. You find <x> gold.
            Gold += npc.Gold;
            npc.BeSearched();

            if (npc.Gold > 0)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.NPC_SEARCH_WITH_GOLD, npc.NameAsParagraph, npc.Gold.ToString().ToParagraph()));
            }
            else
            {
                return(Handler.HANDLED(MESSAGE_ENUM.NPC_SEARCH_NO_GOLD, npc.NameAsParagraph));
            }
        }
Example #7
0
 public override Handler DoLookHands(ParsedInput input)
 {
     if (input != null && input.Words.Length > 1)
     {
         return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
     }
     return(Handler.HANDLED(MESSAGE_ENUM.BASE_STRING, Hands.PlayerDisplayParagraph));
 }
Example #8
0
 public override Handler DoShowHealth(ParsedInput input)
 {
     if (input.Words.Length > 1)
     {
         return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
     }
     return(Handler.HANDLED(MESSAGE_ENUM.PLAYER_SHOW_HEALTH, Attributes.HealthString.ToParagraph(), Attributes.MagicString.ToParagraph()));
 }
Example #9
0
        //protected override Handler DoRemove(ITEM_SLOT itemSlot)
        //{
        //    if (Hands.Full) { return Handler.HANDLED(MESSAGE_ENUM.ERROR_HANDS_ARE_FULL); }
        //    ItemArmor item = Body.GetItem(itemSlot, true);

        //    Paragraph pRemovedItem = null;
        //    MESSAGE_ENUM message = MESSAGE_ENUM.PLAYER_REMOVE;

        //    switch (itemSlot)
        //    {
        //        case ITEM_SLOT.AMULET:
        //            if (RightHand == null) { RightHand = Amulet; }
        //            else if (LeftHand == null) { LeftHand = Amulet; }
        //            message = MESSAGE_ENUM.PLAYER_REMOVE_ARMOR_NECK;
        //            pRemovedItem = Amulet.NameAsParagraph;
        //            Amulet = null;
        //            break;
        //        case ITEM_SLOT.ARMOR_CHEST:
        //            if (RightHand == null) { RightHand = ArmorChest; }
        //            else if (LeftHand == null) { LeftHand = ArmorChest; }
        //            message = MESSAGE_ENUM.PLAYER_REMOVE_ARMOR_CHEST;
        //            DefensePower -= ArmorChest.ArmorFactor;
        //            pRemovedItem = ArmorChest.NameAsParagraph;
        //            ArmorChest = null;
        //            break;
        //        case ITEM_SLOT.ARMOR_FEET:
        //            if (RightHand == null) { RightHand = ArmorFeet; }
        //            else if (LeftHand == null) { LeftHand = ArmorFeet; }
        //            message = MESSAGE_ENUM.PLAYER_REMOVE_ARMOR_FEET;
        //            DefensePower -= ArmorFeet.ArmorFactor;
        //            pRemovedItem = ArmorFeet.NameAsParagraph;
        //            ArmorFeet = null;
        //            break;
        //        case ITEM_SLOT.ARMOR_HEAD:
        //            if (RightHand == null) { RightHand = ArmorHead; }
        //            else if (LeftHand == null) { LeftHand = ArmorHead; }
        //            message = MESSAGE_ENUM.PLAYER_REMOVE_ARMOR_HEAD;
        //            DefensePower -= ArmorHead.ArmorFactor;
        //            pRemovedItem = ArmorHead.NameAsParagraph;
        //            ArmorHead = null;
        //            break;
        //        case ITEM_SLOT.BACKPACK:
        //            if (RightHand == null) { RightHand = Backpack; }
        //            else if (LeftHand == null) { LeftHand = Backpack; }
        //            message = MESSAGE_ENUM.PLAYER_REMOVE_BACKPACK;
        //            pRemovedItem = Backpack.NameAsParagraph;
        //            Backpack = null;
        //            break;
        //        case ITEM_SLOT.RING_1:
        //            if (RightHand == null) { RightHand = Ring1; }
        //            else if (LeftHand == null) { LeftHand = Ring1; }
        //            message = MESSAGE_ENUM.PLAYER_REMOVE_ARMOR_FINGER;
        //            pRemovedItem = Ring1.NameAsParagraph;
        //            Ring1 = null;
        //            break;
        //        case ITEM_SLOT.RING_2:
        //            if (RightHand == null) { RightHand = Ring2; }
        //            else if (LeftHand == null) { LeftHand = Ring2; }
        //            message = MESSAGE_ENUM.PLAYER_REMOVE_ARMOR_FINGER;
        //            pRemovedItem = Ring2.NameAsParagraph;
        //            Ring2 = null;
        //            break;
        //    }

        //    return Handler.HANDLED(message, pRemovedItem);
        //}
        public override Handler DoShowInventory(ParsedInput input)
        {
            if (input.Words.Length > 1)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
            }
            return(Handler.HANDLED(MESSAGE_ENUM.BASE_STRING, InventoryParagraph));
        }
        public static Handler ProcessInput(ParsedInput input)
        {
            switch (input.Source)
            {
            case INPUT_SOURCE.PLAYER: return(Player.ProcessInput(input));

            default: return(Handler.UNHANDLED());
            }
        }
Example #11
0
        public override Handler DoPut(ParsedInput input)
        {
            // TODO: put <item> on <surface>
            //// put <item> in <container>

            if (input.Words.Length < 4)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
            }
            if (input.Words[2] != "in")
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
            }
            if (IsDead)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_PLAYER_IS_DEAD));
            }

            // TODO: put <item> in MY <container>
            // if (input.Words.Length == 5 && input.Words[3] == "my") { return Handler.HANDLED(MESSAGE_ENUM.ERROR_NEED_TO_IMPLEMENT); }

            // must be holding item
            // don't remove item here
            Item item = Hands.GetItem(input.Words[1], false);

            if (item == null)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_NOT_CARRYING_ITEM));
            }

            MESSAGE_ENUM  message   = MESSAGE_ENUM.PLAYER_PUT_IN_PLAYER_CONTAINER;
            ItemContainer container = ContainerSlots.GetContainer(input.Words[3]);

            if (container == null)
            {
                container = Hands.GetItem(input.Words[3], false, ITEM_TYPE.CONTAINER_ANY) as ItemContainer;
            }
            if (container == null || container.Equals(item))
            {
                message   = MESSAGE_ENUM.PLAYER_PUT_IN_GROUND_CONTAINER;
                container = CurrentRoom.Items.Find(input.Words[3], ITEM_TYPE.CONTAINER_ANY) as ItemContainer;
            }
            if (container == null)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
            }

            if (container.Closed)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_CONTAINER_CLOSED, container.NameAsParagraph));
            }

            item = Hands.GetItem(input.Words[1], true);
            container.Items.Add(item);
            return(Handler.HANDLED(message, item.NameAsParagraph, container.NameAsParagraph));
        }
 public void HandleInput()
 {
     while (Input.Count > 0)
     {
         ParsedInput input = Input.Dequeue();
         AppendParagraph(("> " + input.String + "\n").ToParagraph());
         Handler handler = Game.ProcessInput(input);
         MessageQueue.Enqueue(handler.Message);
     }
 }
Example #13
0
        public override Handler DoGold(ParsedInput input)
        {
            if (input.Words.Length > 1)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
            }
            if (Gold > 0)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.PLAYER_CARRYING_GOLD, Gold.ToString().ToParagraph()));
            }

            return(Handler.HANDLED(MESSAGE_ENUM.PLAYER_CARRYING_NO_GOLD));
        }
Example #14
0
 public override Handler DoSit(ParsedInput input)
 {
     if (IsDead)
     {
         return(Handler.HANDLED(MESSAGE_ENUM.ERROR_PLAYER_IS_DEAD));
     }
     if (Posture == ENTITY_POSTURE.SITTING)
     {
         return(Handler.HANDLED(MESSAGE_ENUM.ERROR_ALREADY_SITTING));
     }
     Posture = ENTITY_POSTURE.SITTING;
     return(Handler.HANDLED(MESSAGE_ENUM.PLAYER_SIT));
 }
Example #15
0
        public override Handler DoMoveConnection(ParsedInput input)
        {
            // TODO: since a Connection can have ANY action verb, consider trying to process any fall-through input
            if (input.Words.Length == 1)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_GO_WHERE));
            }
            if (input.Words.Length > 2)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
            }

            if (IsDead)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_PLAYER_IS_DEAD));
            }
            if (Posture == ENTITY_POSTURE.SITTING)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_SITTING));
            }
            if (Posture == ENTITY_POSTURE.KNEELING)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_KNEELING));
            }

            // go <direction>
            if (Statics.DirectionToInt(input.Words[1]) != -1)
            {
                return(DoMoveBasic(input));
            }

            // go <connection>
            Connection connection = CurrentRoom.Connections.Find(input.Words[0], input.Words[1]);

            if (connection != null)
            {
                Coordinates.Set(connection);
                input = null;
                return(DoLook(input));
            }

            return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
        }
Example #16
0
        public override Handler DoClose(ParsedInput input)
        {
            if (input.Words.Length == 1)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_WHAT, "Close".ToParagraph()));
            }
            if (IsDead)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_PLAYER_IS_DEAD));
            }

            // TODO: close MY <container>
            //if (input.Words.Length == 3 && input.Words[1] == "my") { return Handler.HANDLED(MESSAGE_ENUM.ERROR_NEED_TO_IMPLEMENT); }

            ItemContainer container = ContainerSlots.GetContainer(input.Words[1]);

            if (container == null)
            {
                container = Hands.GetItem(input.Words[1], false, ITEM_TYPE.CONTAINER_ANY) as ItemContainer;
            }
            if (container == null)
            {
                container = CurrentRoom.Items.Find(input.Words[1], ITEM_TYPE.CONTAINER_ANY) as ItemContainer;
            }
            if (container == null)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_ITEM));
            }

            if (container.Closed)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_CONTAINER_ALREADY_CLOSED, container.NameAsParagraph));
            }
            if (!container.Closable)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_CONTAINER_NOT_CLOSABLE, container.NameAsParagraph));
            }

            container.Closed = true;
            return(Handler.HANDLED(MESSAGE_ENUM.PLAYER_CLOSE, container.NameAsParagraph));
        }
Example #17
0
        public override Handler DoDrop(ParsedInput input)
        {
            if (input.Words.Length == 1)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_WHAT, "Drop".ToParagraph()));
            }
            if (IsDead)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_PLAYER_IS_DEAD));
            }

            Item item = Hands.GetItem(input.Words[1], true);

            if (item == null)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_NOT_CARRYING_ITEM));
            }

            CurrentRoom.Items.Add(item);
            return(Handler.HANDLED(MESSAGE_ENUM.PLAYER_DROP, item.NameAsParagraph));
        }
Example #18
0
        public override Handler DoMoveBasic(ParsedInput input)
        {
            if (IsDead)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_PLAYER_IS_DEAD));
            }
            if (Posture == ENTITY_POSTURE.SITTING)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_SITTING));
            }
            if (Posture == ENTITY_POSTURE.KNEELING)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_KNEELING));
            }

            // basic direction
            // if "go <direction>"
            int nDirection;

            if (input.Words[0] == "go" || input.Words[0] == "move")
            {
                nDirection = Statics.DirectionToInt(input.Words[1]);
            }
            // see TranslatedInput constructor; hack job replaces first word with integer direction
            else
            {
                nDirection = int.Parse(input.Words[0]);
            }

            Exit exit = CurrentRoom.Exits.Get(nDirection);

            if (exit.Region == -1)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_WRONG_DIRECTION));
            }

            Coordinates.Set(exit.Region, exit.Subregion, exit.Room);

            return(Handler.HANDLED(MESSAGE_ENUM.BASE_STRING, Coordinates.CurrentRoomDisplayParagraph));
        }
Example #19
0
        public override Handler DoSell(ParsedInput input)
        {
            if (input.Words.Length == 1)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_WHAT, "Sell".ToParagraph()));
            }
            if (IsDead)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_PLAYER_IS_DEAD));
            }

            // verify that we're in a shop
            RoomShop shop = CurrentRoom as RoomShop;

            if (shop == null)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_NOT_A_SHOP));
            }

            // attempt to sell item
            // TODO: find player item first, THEN attempt to sell to shop
            return(shop.DoBuyFromEntity(this, input.Words[1]));
        }
Example #20
0
        public override Handler DoRemove(ParsedInput input)
        {
            if (input.Words.Length == 1)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_WHAT, "Remove".ToParagraph()));
            }
            if (input.Words.Length > 2)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
            }
            if (IsDead)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_PLAYER_IS_DEAD));
            }

            EntityHand hand = Hands.GetEmptyHand();

            if (hand == null)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_HANDS_ARE_FULL));
            }

            REMOVE_RESULT result = Body.DoRemove(input.Words[1], hand);

            if (result == REMOVE_RESULT.NOT_REMOVED)
            {
                result = ContainerSlots.DoRemove(input.Words[1], hand);
            }
            if (result == REMOVE_RESULT.NOT_REMOVED)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
            }

            MESSAGE_ENUM message = Statics.ItemTypeToRemoveMessage[hand.Item.Type];

            return(Handler.HANDLED(message, hand.Item.NameAsParagraph));
        }
Example #21
0
        public override Handler DoGetExtended(ParsedInput input)
        {
            //// take <item> from <container>
            //if (input.Words[2] != "from") { return Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT); }

            //ItemContainer container = null;
            //MESSAGE_ENUM message = MESSAGE_ENUM.PLAYER_GET_FROM_CONTAINER;

            //// holding container?
            //if (LeftHand != null && LeftHand.IsKeyword(input.Words[3]) && LeftHand.Type == ITEM_TYPE.CONTAINER) { container = LeftHand as ItemContainer; }
            //else if (RightHand != null && RightHand.IsKeyword(input.Words[3]) && RightHand.Type == ITEM_TYPE.CONTAINER) { container = RightHand as ItemContainer; }
            //// equipped container?
            //else if (Backpack != null && Backpack.IsKeyword(input.Words[2])) { container = Backpack; }
            //// container on ground?
            //else
            //{
            //    container = CurrentRoom.Items.Find(input.Words[3], ITEM_TYPE.CONTAINER) as ItemContainer;
            //    message = MESSAGE_ENUM.PLAYER_GET_FROM_ROOM_CONTAINER;
            //}

            //if (container == null) { return Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT); }

            //// valid container; find item
            //Item item = container.Items.Find(input.Words[1]);
            //if (item == null) { return Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_ITEM); }

            //// item found; attempt to put in hands
            //if (HandsAreFull) { return Handler.HANDLED(MESSAGE_ENUM.ERROR_HANDS_ARE_FULL); }

            //PutItemInHand(item);
            //container.Items.RemoveItem(item);
            //return Handler.HANDLED(message, item.NameAsParagraph, container.NameAsParagraph);

            // TODO: fix this
            throw new NotImplementedException();
        }
Example #22
0
        public override Handler DoEquip(ParsedInput input)
        {
            if (input.Words.Length == 1)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_WHAT, "Equip".ToParagraph()));
            }
            if (IsDead)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_PLAYER_IS_DEAD));
            }

            string strItemToEquip = input.Words[1];

            // equip my <item>; strip 'my'
            if (input.Words.Length == 3 && input.Words[1] == "my")
            {
                strItemToEquip = input.Words[2];
            }

            EntityHand hand = Hands.GetHandWithItem(strItemToEquip);

            if (hand == null)
            {
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));
            }
            if ((hand.Item.Type & ITEM_TYPE.ARMOR_ANY) == hand.Item.Type)
            {
                return(Body.DoEquip(hand));
            }
            if ((hand.Item.Type & ITEM_TYPE.CONTAINER_ANY) == hand.Item.Type)
            {
                return(ContainerSlots.DoEquip(hand));
            }

            return(Handler.HANDLED(MESSAGE_ENUM.ERROR_ITEM_NOT_EQUIPPABLE));
        }
 public virtual Handler DoRemove(ParsedInput input)
 {
     return(Handler.UNHANDLED());
 }
 public virtual Handler DoAttack(ParsedInput input)
 {
     return(Handler.UNHANDLED());
 }
 public virtual Handler DoShowInventory(ParsedInput input)
 {
     return(Handler.UNHANDLED());
 }
        public Handler ProcessInput(ParsedInput input)
        {
            switch (input.Action)
            {
            case ACTION_ENUM.NONE:
                return(Handler.HANDLED(MESSAGE_ENUM.ERROR_BAD_INPUT));

            case ACTION_ENUM.MOVE_BASIC:
                return(DoMoveBasic(input));

            case ACTION_ENUM.MOVE_CONNECTION:
                return(DoMoveConnection(input));

            case ACTION_ENUM.LOOK:
                return(DoLook(input));

            case ACTION_ENUM.OPEN_CONTAINER:
                return(DoOpen(input));

            case ACTION_ENUM.CLOSE_CONTAINER:
                return(DoClose(input));

            case ACTION_ENUM.BUY_ITEM:
                return(DoBuy(input));

            case ACTION_ENUM.SELL_ITEM:
                return(DoSell(input));

            case ACTION_ENUM.PRICE_ITEM:
                return(DoPrice(input));

            case ACTION_ENUM.SHOW_GOLD:
                return(DoGold(input));

            case ACTION_ENUM.GET_ITEM:
                return(DoGet(input));

            case ACTION_ENUM.PUT_ITEM:
                return(DoPut(input));

            case ACTION_ENUM.REMOVE_EQUIPMENT:
                return(DoRemove(input));

            case ACTION_ENUM.EQUIP_ITEM:
                return(DoEquip(input));

            case ACTION_ENUM.DROP_ITEM:
                return(DoDrop(input));

            case ACTION_ENUM.DRINK:
                return(DoDrink(input));

            case ACTION_ENUM.EAT:
                return(DoEat(input));

            case ACTION_ENUM.SHOW_INVENTORY:
                return(DoShowInventory(input));

            case ACTION_ENUM.SHOW_HANDS:
                return(DoLookHands(input));

            case ACTION_ENUM.SIT:
                return(DoSit(input));

            case ACTION_ENUM.STAND:
                return(DoStand(input));

            case ACTION_ENUM.KNEEL:
                return(DoKneel(input));

            case ACTION_ENUM.ATTACK:
                return(DoAttack(input));

            case ACTION_ENUM.SHOW_HEALTH:
                return(DoShowHealth(input));

            case ACTION_ENUM.SEARCH:
                return(DoSearch(input));

            default:
                return(Handler.UNHANDLED());
            }
        }
 public virtual Handler DoSearch(ParsedInput input)
 {
     return(Handler.UNHANDLED());
 }
 public virtual Handler DoShowHealth(ParsedInput input)
 {
     return(Handler.UNHANDLED());
 }
 public virtual Handler DoKneel(ParsedInput input)
 {
     return(Handler.UNHANDLED());
 }
 public virtual Handler DoGetExtended(ParsedInput input)
 {
     return(Handler.UNHANDLED());
 }