public LINQ(RulesEngine rulesEngine) { //Starts the filesystemwatcher this.rulesEngine = rulesEngine; xdoc = XDocument.Load(@Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName + "\\board.xml"); watcher = new FileSystemWatcher(@Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName); watcher.NotifyFilter = NotifyFilters.LastWrite; watcher.Filter = "board.xml"; watcher.Changed += new FileSystemEventHandler(OnChanged); watcher.EnableRaisingEvents = true; }
public MainWindow() { InitializeComponent(); rulesEngine = new RulesEngine(); game = new Game(rulesEngine); rulesEngine._board.onBoardChange += onBoardChange; rulesEngine.onRoundFinished += game.changeCurrentPlayer; rulesEngine.onMoveFinished += game.allowMovesAgain; rulesEngine.onMoveFeedback += textChange; restartButton.Click += new RoutedEventHandler(restartGame); game.playerChange += textChange; rulesEngine.onWin += textChange; rulesEngine.onWinState += game.setWinState; rulesEngine.linq.onXMLChanged += onBoardChange; choosePlayers(); }
public Game(RulesEngine rulesEngine) { this.rulesEngine = rulesEngine; allowMoves = true; }