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