Exemplo n.º 1
0
        /// <summary>
        /// Pulls up the interaction menu, and handles that interaction
        /// </summary>
        private void HandleInteractionMenu()
        {
            int        interactionIndex = 0;
            GameObject gameObject       = view.DisplayInteractObject(universe, player.CurrentLocation);

            //
            // in case the location is empty
            //
            if (gameObject != null)
            {
                interactionIndex = view.DrawGetMenuOption(ActionMenu.GetEnumMenu(typeof(InteractionMenuAction)));
                InteractionMenuAction action = (InteractionMenuAction)Enum.GetValues(typeof(InteractionMenuAction)).GetValue(interactionIndex);
                HandleObjectInteraction(gameObject, action);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Processes a specific interaction on a specific object
        /// </summary>
        /// <param name="gameObject"></param>
        /// <param name="action"></param>
        private void HandleObjectInteraction(GameObject gameObject, InteractionMenuAction action)
        {
            switch (action)
            {
            case InteractionMenuAction.LookAt:
                view.DisplayObjectDescription(gameObject);
                break;

            case InteractionMenuAction.Analyze:
                view.DisplayObjectAnalysis(gameObject);
                gameObject.Analyze();
                break;

            case InteractionMenuAction.Back:
                break;

            default:
                break;
            }
        }