public async Task AnimateShowSelectedDominoAsync(int player, MexicanDomino thisDomino, DominosMexicanTrainMainGameClass mainGame) { thisDomino.IsSelected = false; thisDomino.Drew = false; thisDomino.IsUnknown = false; RotateDomino(player, thisDomino); var imageDomino = _thisGlobal.GetDominoPiece(thisDomino); imageDomino.MainGraphics !.Location = new SKPoint(5, 5); //try here. _thisGlobal.MovingDomino = imageDomino; _thisGlobal.Animates !.LocationFrom = imageDomino.MainGraphics.Location; _thisGlobal.Animates.LocationTo = _imageBoard !.DominoLocationNeeded(player, thisDomino.CurrentFirst, thisDomino.CurrentSecond); await _thisGlobal.Animates.DoAnimateAsync(); thisDomino.Location = _thisGlobal.Animates.LocationTo; AddDomino(player, thisDomino); if (thisDomino.FirstNum == thisDomino.SecondNum) { mainGame.SaveRoot !.CurrentPlayerDouble = true; if (mainGame.SingleInfo !.ObjectCount == 0) { await mainGame.EndTurnAsync(true); return; } _thisGlobal.BoneYard !.NewTurn(); await mainGame.ContinueTurnAsync(); return; } RemoveTrain(mainGame.WhoTurn, mainGame.PlayerList); await mainGame.EndTurnAsync(true); }
protected override void DrawBoard(SKCanvas canvas) { canvas.Clear(); var bounds = GetBounds(); canvas.DrawRect(bounds, _borderPaint); var tempSize = GetActualSize(200, 200); var tempPoint = GetActualPoint(new SKPoint(150, 155)); var thisRect = SKRect.Create(tempPoint, tempSize); canvas.DrawRect(thisRect, _fillPaint); if (PrivateList.Count == 0) { return; } var tempDomino = _thisGlobal.TrainStation1 !.CenterDomino; var thisCenter = _thisGlobal.GetDominoPiece(tempDomino); thisCenter.MainGraphics !.Location = GetActualPoint(new SKPoint(203, 239)); thisCenter.MainGraphics.DrawImage(canvas); int x = 0; tempSize = GetActualSize(45, 28); foreach (var thisTrain in _thisGlobal.TrainStation1.TrainList.Values) { x++; var thisPrivate = PrivateList[thisTrain.Index]; var bottomPoint = GetActualPoint(new SKPoint(0, 28)); var thisPoint = GetActualPoint(thisPrivate.TrainArea.Location); if (thisPrivate.IsBottom == false && thisPrivate.IsRotated == false) { thisPoint.Y += 5; } else if (thisPrivate.IsBottom) { thisPoint.Y += tempSize.Width - bottomPoint.Y; } var tempRect = SKRect.Create(thisPoint, tempSize); if (x == _thisGlobal.TrainStation1.Self) { canvas.DrawRect(tempRect, _redPaint); } if (thisTrain.TrainUp || x == _thisGlobal.TrainStation1.Satisfy) { if (thisTrain.IsPublic) { canvas.DrawBitmap(_publicBit, tempRect, _bitPaint); } else { canvas.DrawBitmap(_playerBit, tempRect, _bitPaint); } } int y = 0; thisTrain.DominoList.ForEach(thisDomino => { y++; bool isDoubles = thisDomino.CurrentFirst == thisDomino.CurrentSecond; var finalDomino = _thisGlobal.GetDominoPiece(thisDomino); finalDomino.MainGraphics !.DrawImage(canvas); }); if (x == _thisGlobal.TrainStation1.TrainList.Count && thisTrain.TrainUp == false) { throw new BasicBlankException("The public train must always be up. Find out what happened"); } } if (_thisGlobal.Animates !.AnimationGoing) { _thisGlobal.MovingDomino !.MainGraphics !.Location = _thisGlobal.Animates.CurrentLocation; _thisGlobal.MovingDomino.MainGraphics.DrawImage(canvas); } }