public async Task LoadSavedDataAsync(DominosMexicanTrainSaveInfo saveRoot) { _saveRoot = saveRoot; if (_basicData.IsXamarinForms) { RepaintBoard(); await _delayer.DelaySeconds(1); } SavedTrain output = _saveRoot.TrainData !; Satisfy = output.Satisfy; CenterDomino = output.CenterDomino !; TrainList = output.TrainList; int x = 0; //SetImage(); foreach (var thisTrain in TrainList.Values) { x++; var tempList = thisTrain.DominoList.ToRegularDeckDict(); thisTrain.DominoList.Clear(); tempList.ForEach(thisDomino => { thisTrain.DominoList.Add(thisDomino); }); } RepaintBoard(); }
public async Task ShowDominoAsync(int deck) { SimpleDominoInfo thisDomino = ObjectList.GetSpecificItem(deck); thisDomino.IsUnknown = false; await _delayer.DelaySeconds(2); thisDomino.IsUnknown = true; }
public async Task ShowPlayCardAsync(FluxxCardInformation card) { if (card.Deck != CardDetail !.CurrentCard.Deck) { CardDetail.ShowCard(card); if (_test.NoAnimations == false) { await _delayer.DelaySeconds(1); } } CardDetail.ResetCard(); }
//the player should clear everything out period now. //public void ClearBoard() //{ // foreach (var thisPlayer in _mainGame.PlayerList!) // thisPlayer.SpaceNumber = 0;// this means it won't even appear anymore //} public async Task MakeMoveAsync(int space) { SpaceInfo thisSpace; var loopTo = space; int x; if (CurrentPlayer == null) { throw new BasicBlankException("No current player was set. Rethink"); } for (x = _currentSpace + 1; x <= loopTo; x++) { CurrentPlayer.Invoke().SpaceNumber = x; if (_basicData.IsXamarinForms) { _aggregator.RepaintBoard(); //hopefully this simple. } if (_test.NoAnimations == false) { if (_basicData.IsXamarinForms == false) { await _delay.DelaySeconds(0.1); } else { await _delay.DelayMilli(200); } } } _currentSpace = space; thisSpace = _spaceList[space]; if (thisSpace.JumpTo != space) { CurrentPlayer.Invoke().SpaceNumber = thisSpace.JumpTo; } if (_basicData.IsXamarinForms) { _aggregator.RepaintBoard(); } }