/// <summary> /// The most common Quest /// </summary> /// <param name="questXML">XML that follows schema QuestSchema</param> public Quest(OpeningMode openingMode, string questXml, IGameServerCommunication gameServerCommunication) { this.gameServerCommunication = gameServerCommunication; this.openingMode = openingMode; wholeQuestXml = questXml; XmlDocument xmlDoc = new XmlDocument(); //* create an xml document object. XmlTextReader xmlTextReader = new XmlTextReader(new StringReader(questXml)); xmlDoc.Load(xmlTextReader); name = (xmlDoc.GetElementsByTagName("Name"))[0].InnerText; rounds = xmlDoc.GetElementsByTagName("Round"); }
public void Initialize(IUserInquirer userInquirer, IGameServerCommunication gameServerCommunication) { this.userInquirer = userInquirer; this.gameServerCommunication = gameServerCommunication; }
/// <summary> /// /// </summary> /// <param name="path">Absolute path to the directory with solvers</param> /// <param name="parentWindow">We need to display dialogs and the dialogs need to be bound to a window; main window reference is expected</param> public void Initialize(ISolverProvider solverProvider, Window parentWindow, IErrorMessagesPresenter errorPresenter, IUserInquirer userInquirer, IGameServerCommunication gameServerCommunication) { this.errorPresenter = errorPresenter; this.gameServerCommunication = gameServerCommunication; this.userInquirer = userInquirer; this.solverProvider = solverProvider; solversManager = new SolversManager(solverProvider, parentWindow); // Register callback solversManager.RegisterStatusChangeCallback(solverStatusChange); SolversList = new ObservableCollection<string>(solversManager.Solvers); // we want to notify CurrentSolver = solversManager.CurrentSolver; solverPainter = solverProvider as ISolverPainter; if (solverPainter == null) { throw new Exception("Reference `solverProvider' should also implement ISolverPainter."); } }