public void Talk() { Question talk = currentLocation.talk; int choice; choice = talk.answerQuestion(); }
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); }
public void LookAround() { int choice; state = "room"; Question lookAround = currentLocation.lookAround; choice = lookAround.answerQuestion(); Search(choice - 1); }
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(); }