示例#1
0
        public void Talk()
        {
            Question talk = currentLocation.talk;
            int      choice;

            choice = talk.answerQuestion();
        }
示例#2
0
        public void Interact()
        {
            int     choice, exception = 0;
            string  action   = "";
            Boolean isAction = false;

            state = "place";
            System.Reflection.MemberInfo[] methods;

            Question interact = currentLocation.actions;

            while (!isAction)
            {
                choice = interact.answerQuestion(exception);

                action = interact.answers [choice - 1].Replace(" ", string.Empty);

                methods = this.GetType().GetMethods();

                if (this.GetType().GetMethod(action) != null)
                {
                    isAction = true;
                }
                else
                {
                    exception = 1;
                }
            }

            this.GetType().InvokeMember(action, BindingFlags.Default | BindingFlags.InvokeMethod, null, this, null);
        }
示例#3
0
        public void LookAround()
        {
            int choice;

            state = "room";
            Question lookAround = currentLocation.lookAround;

            choice = lookAround.answerQuestion();

            Search(choice - 1);
        }
示例#4
0
        public void Travel()
        {
            int choice;

            Question travel = currentLocation.range;

            choice = travel.answerQuestion();

            if (choice != 4)
            {
                currentLocation = new Place(travel.answers [choice - 1].Trim());
                Utility.TransitionHelper.travelTransition(0, travel.answers [choice - 1].Trim());
            }

            this.Interact();
        }