Exemplo n.º 1
0
        /// <summary>
        /// Processes a specific interaction on a specific npc
        /// </summary>
        /// <param name="gameObject"></param>
        /// <param name="action"></param>
        private void HandleNpcInteraction(Npc npc, NpcMenuAction action)
        {
            switch (action)
            {
            case NpcMenuAction.TalkTo:
                view.DisplayTalkToNpc(npc);
                break;

            case NpcMenuAction.Battle:
                if (npc is IBattle)
                {
                    HandleNpcBattle(npc);
                }
                else
                {
                    view.DisplayBattleNpc(npc, "");
                }
                break;

            case NpcMenuAction.Back:
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Pulls up the entity menu, and handles that interaction
        /// </summary>
        private void HandleEntityMenu()
        {
            int entityIndex = 0;
            Npc entity      = view.DisplayInteractNpc(universe, player.CurrentLocation);

            //
            // in case the location is empty
            //
            if (entity != null)
            {
                entityIndex = view.DrawGetMenuOption(ActionMenu.GetEnumMenu(typeof(NpcMenuAction)));
                NpcMenuAction action = (NpcMenuAction)Enum.GetValues(typeof(NpcMenuAction)).GetValue(entityIndex);
                HandleNpcInteraction(entity, action);
            }
        }