Beispiel #1
0
        public async Task EndRoundAsync(DominosMexicanTrainMainGameClass mainGame)
        {
            UpTo--;
            if (UpTo < 0)
            {
                await mainGame.GameOverAsync();

                return;
            }
            await mainGame.RoundOverNextAsync();
        }
Beispiel #2
0
 public void LoadPlayers(int highestDomino, DominosMexicanTrainMainGameClass mainGame)
 {
     //SetImage();
     _imageBoard !.FirstLoad();
     _saveRoot = mainGame.SaveRoot; //hopefully this simple.
     LoadBoard(mainGame.PlayerList.Count());
     if (Self == 0)
     {
         throw new BasicBlankException("Needs to know self");
     }
     if (UpTo == -1 && _test.DoubleCheck == false)
     {
         UpTo = highestDomino;
     }
     else if (_test.DoubleCheck == true)
     {
         UpTo = 0;
     }
     NewestTrain = 0;
 }
Beispiel #3
0
        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);
        }