public MainPilesCP(IScoreData thisMod, CommandContainer command, IGamePackageResolver resolver, IEventAggregator aggregator) { _score = thisMod; DeckContents = resolver.Resolve <IRegularDeckInfo>(); //this is even better. Piles = new BasicMultiplePilesCP <SolitaireCard>(command, aggregator); //Piles.Visible = true; Piles.PileClickedAsync += Piles_PileClickedAsync; }
public StockPileVM(CommandContainer command, IEventAggregator aggregator) { StockFrame = new BasicMultiplePilesCP <D>(command, aggregator); StockFrame.Style = BasicMultiplePilesCP <D> .EnumStyleList.HasList; // for sure has a list StockFrame.Rows = 1; StockFrame.Columns = 1; StockFrame.HasText = true; StockFrame.HasFrame = true; StockFrame.LoadBoard(); StockFrame.PileList.Single().Text = TextToAppear; StockFrame.PileClickedAsync += StockFrame_PileClickedAsync; }
public void Init(HeapSolitaireMainViewModel thisMod, BasicPileInfo <HeapSolitaireCardInfo> thisPile) { _mainMod = thisMod.Waste1; _privateMod = thisPile; _cardList = _privateMod.ObjectList; var tempDeck = GetNewCard(new HeapSolitaireCardInfo()); _pixels = (int)tempDeck.ObjectSize.Width / 4; _cardList.CollectionChanged += CollectionChanged; Background = Brushes.Transparent; //learned from old version of belegured castle that if not set to transparent, clicking does not work. MouseUp += SinglePileUI_MouseUp; _privateMod.PropertyChanged += PropertyChanged; _thisGrid = new Grid(); Content = _thisGrid; PopulateControls(); }
public void Init(BasicMultiplePilesCP <CA> mod, string tagUsed) { _thisGrid = new Grid(); _parentGrid = new Grid(); _parentGrid.Children.Add(_thisGrid); _thisMod = mod; BindingContext = mod; // i think needs this as well. _tagUsed = tagUsed; GW tempCard = new GW(); tempCard.SendSize(tagUsed, new CA()); //for testing. SKSize size = tempCard.ObjectSize; if (_thisMod.PileList !.Count == 0) { throw new Exception("Must have at least one pile. Otherwise, not worth even using this"); } if (_thisMod.HasFrame) { GridHelper.AddAutoColumns(_thisGrid, _thisMod.Columns); GridHelper.AddAutoRows(_thisGrid, _thisMod.Rows); } else { _thisMod.Columns.Times(x => { GridHelper.AddPixelColumn(_thisGrid, size.Width); }); _thisMod.Rows.Times(x => { GridHelper.AddPixelRow(_thisGrid, size.Height); }); } _thisGrid.RowSpacing = Spacing; _thisGrid.ColumnSpacing = Spacing; foreach (var pileMod in _thisMod.PileList) { PrivateBasicIndividualPileXF <CA, GC, GW> pileG = new PrivateBasicIndividualPileXF <CA, GC, GW>(); pileG.MainMod = _thisMod; pileG.ThisPile = pileMod; GridHelper.AddControlToGrid(_thisGrid, pileG, pileMod.Row - 1, pileMod.Column - 1); pileG.Init(tagUsed); } Content = _parentGrid; }
public void UpdateLists(BasicMultiplePilesCP <CA> mod) { _thisMod = mod; DataContext = null; DataContext = _thisMod; _thisGrid !.Children.Clear(); //i think this is best. GridHelper.AddAutoColumns(_thisGrid, _thisMod.Columns); GridHelper.AddAutoRows(_thisGrid, _thisMod.Rows); foreach (var pileMod in _thisMod.PileList !) { PrivateBasicIndividualPileWPF <CA, GC, GW> PileG = new PrivateBasicIndividualPileWPF <CA, GC, GW>(); PileG.MainMod = _thisMod; PileG.ThisPile = pileMod; GridHelper.AddControlToGrid(_thisGrid, PileG, pileMod.Row - 1, pileMod.Column - 1); PileG.Margin = new Thickness(Spacing, Spacing, Spacing, Spacing); PileG.Init(_tagUsed); } }
public TeamCP(int team, MillebournesGameContainer gameContainer, MillebournesVMData model) { CardPiles = new BasicMultiplePilesCP <MillebournesCardInformation>(gameContainer.Command, gameContainer.Aggregator); CardPiles.Rows = 1; CardPiles.Columns = 3; CardPiles.HasFrame = true; CardPiles.Style = BasicMultiplePilesCP <MillebournesCardInformation> .EnumStyleList.HasList; CardPiles.HasText = true; CardPiles.LoadBoard(); TeamNumber = team; //i think has to be here. _gameContainer = gameContainer; _model = model; //risk without extra command. hopefully that works. if i am wrong, rethink. //could require controlcommand (hopefully i don't). CardPiles.PileClickedAsync += CardPiles_PileClickedAsync; Init(); MillebournesPlayerItem thisPlayer = _gameContainer.PlayerList !.GetSelf(); _selfPlayer = thisPlayer.Id; }
public void Init(HeapSolitaireMainViewModel thisMod, BasicPileInfo <HeapSolitaireCardInfo> thisPile) { _mainMod = thisMod.Waste1; _privateMod = thisPile; _cardList = _privateMod.ObjectList; var tempDeck = GetNewCard(new HeapSolitaireCardInfo()); _pixels = (int)tempDeck.ObjectSize.Width / 4; _cardList.CollectionChanged += CollectionChanged; _canvas = new SKCanvasView(); _canvas.EnableTouchEvents = true; _canvas.Touch += Touch; Grid grid = new Grid(); _privateMod.PropertyChanged += TempPropertyChanged; _thisGrid = new Grid(); _thisGrid.InputTransparent = true; grid.Children.Add(_thisGrid); grid.Children.Add(_canvas); Content = grid; PopulateControls(); }
public void LoadPiles(MilkRunMainGameClass mainGame, MilkRunGameContainer gameContainer) { _mainGame = mainGame; _gameContainer = gameContainer; StrawberryPiles = new BasicMultiplePilesCP <MilkRunCardInformation>(_gameContainer.Command, _mainGame.Aggregator); StrawberryPiles.PileClickedAsync += StrawberryPiles_PileClickedAsync; StrawberryPiles.Rows = 1; StrawberryPiles.Columns = 3; StrawberryPiles.HasText = true; StrawberryPiles.HasFrame = true; //i don't think we need to prove true anymore. StrawberryPiles.Style = BasicMultiplePilesCP <MilkRunCardInformation> .EnumStyleList.HasList; StrawberryPiles.LoadBoard(); //hopefully i don't have to send enables for true. int x = 0; StrawberryPiles.PileList !.ForEach(thisPile => { x++; thisPile.IsEnabled = true; if (x == 1) { thisPile.Text = "S. Limit"; } else if (x == 2) { thisPile.Text = "S. Go"; } else if (x == 3) { thisPile.Text = "S #."; if (PlayerCategory != EnumPlayerCategory.Self) { thisPile.IsEnabled = false; } } else { throw new BasicBlankException("There should only be 3 piles for strawberries"); } }); ChocolatePiles = new BasicMultiplePilesCP <MilkRunCardInformation>(_gameContainer.Command, _mainGame.Aggregator); ChocolatePiles.PileClickedAsync += ChocolatePiles_PileClickedAsync; x = 0; ChocolatePiles.Rows = 1; ChocolatePiles.Columns = 3; ChocolatePiles.HasText = true; ChocolatePiles.HasFrame = true; ChocolatePiles.Style = BasicMultiplePilesCP <MilkRunCardInformation> .EnumStyleList.HasList; ChocolatePiles.LoadBoard(); ChocolatePiles.PileList !.ForEach(thisPile => { x++; thisPile.IsEnabled = true; if (x == 1) { thisPile.Text = "C. Limit"; } else if (x == 2) { thisPile.Text = "C. Go"; } else if (x == 3) { thisPile.Text = "C #."; if (PlayerCategory != EnumPlayerCategory.Self) { thisPile.IsEnabled = false; } } else { throw new BasicBlankException("There should only be 3 piles for chocolate"); } }); _thisE = mainGame.MainContainer.Resolve <EventAggregator>(); }