public GameBoardVM(IGameDataClient dataClient) { DataClient = dataClient; RestartGame(); DataClient.Get(); DataClient.Start(); CmdSave = new DelegateCommand(CmdSave_HandleExecute); Task.Factory.StartNew(() => { while (true) { int x = X; ++x; x %= CurrentLevel.Lvl.Width; X = x; int y = Y; y += 2; y %= CurrentLevel.Lvl.Height; Y = y; Thread.Sleep(1000); } }); }
public GameBoard(IGameBoardVM vm, IGameDataClient dataClient) { InitializeComponent(); // Set important dependand properties DataContext = vm; ViewModel = vm; DataClient = dataClient; // Debug-mode - enables to draw a level IsDebug = true; // Draw elements Init(); }