public PlayerPilesViewModel(CommandContainer commandContainer, SkipboGameContainer gameContainer, SkipboVMData model, SkipboMainGameClass mainGame) { gameContainer.SingleInfo = gameContainer.PlayerList !.GetWhoPlayer(); CommandContainer = commandContainer; _model = model; _mainGame = mainGame; _model.StockPile.ClearCards(); //model.StockPile = new Piles.StockViewModel(commandContainer, gameContainer.Aggregator); gameContainer.SingleInfo !.StockList.ForEach(x => { model.StockPile.AddCard(x); }); //model.StockPile.StockFrame.PileList!.ReplaceRange(gameContainer.SingleInfo!.StockList); _model.DiscardPiles = new DiscardPilesVM <SkipboCardInformation>(commandContainer, gameContainer.Aggregator); _model.DiscardPiles.Init(HowManyDiscards); if (gameContainer.SingleInfo !.DiscardList.Count > 0) { model.DiscardPiles !.PileList !.ReplaceRange(gameContainer.SingleInfo.DiscardList); } _model.DiscardPiles.PileClickedAsync += DiscardPiles_PileClickedAsync; _model.StockPile !.StockClickedAsync += StockPile_StockClickedAsync; }
public SkipboMainViewModel(CommandContainer commandContainer, SkipboMainGameClass mainGame, SkipboVMData viewModel, BasicData basicData, TestOptions test, IGamePackageResolver resolver, SkipboGameContainer gameContainer ) : base(commandContainer, mainGame, viewModel, basicData, test, resolver) { _mainGame = mainGame; _model = viewModel; _resolver = resolver; _gameContainer = gameContainer; _model.Deck1.NeverAutoDisable = true; _model.PlayerHand1.Maximum = 5; _gameContainer.LoadPlayerPilesAsync = LoadPlayerPilesAsync; }
public PlayerPilesView(SkipboVMData model, SkipboGameContainer gameContainer, IEventAggregator aggregator) { StackLayout stack = new StackLayout() { Orientation = StackOrientation.Horizontal }; var player = gameContainer.PlayerList !.GetWhoPlayer(); _discardGraphics = new BasicMultiplePilesXF <SkipboCardInformation, SkipboGraphicsCP, CardGraphicsXF>(); _discardGraphics.Init(model.DiscardPiles !, ""); _discardGraphics.StartAnimationListener("discard" + player.NickName); stack.Children.Add(_discardGraphics); _stockGraphics = new BasicMultiplePilesXF <SkipboCardInformation, SkipboGraphicsCP, CardGraphicsXF>(); _stockGraphics.Init(model.StockPile !.StockFrame, ""); // i think _stockGraphics.StartAnimationListener("stock" + player.NickName); stack.Children.Add(_stockGraphics); _aggregator = aggregator; Content = stack; }
} = new CustomBasicList <ComputerData>(); //the computer ai needs it. public SkipboMainGameClass(IGamePackageResolver mainContainer, IEventAggregator aggregator, BasicData basicData, TestOptions test, SkipboVMData currentMod, IMultiplayerSaveState state, IAsyncDelayer delay, ICardInfo <SkipboCardInformation> cardInfo, CommandContainer command, SkipboGameContainer gameContainer, SkipboComputerAI ai, SkipboDelegates delegates ) : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer) { _model = currentMod; _command = command; _gameContainer = gameContainer; _ai = ai; _model.PublicPiles.PileClickedAsync += PublicPiles_PileClickedAsync; _gameContainer.IsValidMove = IsValidMove; delegates.GetPlayerCount = (() => PlayerList.Count); }
public SkipboComputerAI(SkipboGameContainer gameContainer, SkipboVMData model) { _gameContainer = gameContainer; _model = model; }