protected async override Task ComputerTurnAsync() { if (_test !.NoAnimations == false) { await Delay !.DelaySeconds(.3); } Vector space = _ai !.ComputerMove(); FieldInfoCP ThisField = GameBoard1 !.ComputerList ![space];
//private bool _disableDrawing = true; public SpaceXF(FieldInfoCP field) { //return; BindingContext = field; // needs to be this way so if somethign changes,can act accordingly _space = field.Vector; CommandParameter = _space; _gameBoard1 = Resolve <GameBoardCP>(); ThisDraw.PaintSurface += ThisDraw_PaintSurface; this.SetName(nameof(BattleshipMainViewModel.MakeMoveAsync)); GamePackageViewModelBinder.ManuelElements.Add(this); WidthRequest = _gameBoard1.SpaceSize; HeightRequest = _gameBoard1.SpaceSize; // used the idea from tic tac toe. }
public SpaceWPF(FieldInfoCP field) { DataContext = field; // needs to be this way so if somethign changes,can act accordingly _thisDraw = new SKElement(); _space = field.Vector; CommandParameter = _space; _gameBoard1 = Resolve <GameBoardCP>(); _thisDraw.PaintSurface += ThisDraw_PaintSurface; Name = nameof(BattleshipMainViewModel.MakeMoveAsync); GamePackageViewModelBinder.ManuelElements.Add(this); //just in case. because i have seen patterns where ones i get later never get picked up. Width = _gameBoard1.SpaceSize; Height = _gameBoard1.SpaceSize; // used the idea from tic tac toe. Content = _thisDraw; }