Exemple #1
0
 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();
 }
Exemple #3
0
 public Game(RulesEngine rulesEngine)
 {
     this.rulesEngine = rulesEngine;
     allowMoves = true;
 }
Exemple #4
0
 public Game(RulesEngine rulesEngine)
 {
     this.rulesEngine = rulesEngine;
     allowMoves       = true;
 }