public void LoadList(PlayerBoardObservable <TR> thisMod) { _thisMod = thisMod; _cardList = thisMod.CardList; _cardList.CollectionChanged += CardList_CollectionChanged; if (thisMod.Game == PlayerBoardObservable <TR> .EnumGameList.None) { throw new BasicBlankException("Must choose Skuck or Horseshoes"); } if (_cardList.Count == 0) { throw new BasicBlankException("Must have cardlist already"); } _thisGrid = new Grid(); GamePackageDIContainer thisC = Resolve <GamePackageDIContainer>(); IProportionImage thisImage = thisC.Resolve <IProportionImage>(ts.TagUsed); SKSize thisSize = _cardList.First().DefaultSize; SKSize usedSize = thisSize.GetSizeUsed(thisImage.Proportion); var pixels = usedSize.Height / 2; int x; var loopTo = _cardList.Count; for (x = 1; x <= loopTo; x++) { GridHelper.AddPixelRow(_thisGrid, (int)pixels); } GridHelper.AddPixelRow(_thisGrid, (int)pixels); pixels = usedSize.Width + 6; for (x = 1; x <= 4; x++) { GridHelper.AddPixelColumn(_thisGrid, (int)pixels); } PopulateControls(); Content = _thisGrid; }
public void SendDiceInfo(IStandardDice thisDice) //it did send dice { IGamePackageResolver thisR = (IGamePackageResolver)cons !; IProportionImage thisP = thisR.Resolve <IProportionImage>(GetDiceTag); _mains = new StandardDiceGraphicsCP(this); _mains.OriginalHeightWidth = thisDice.HeightWidth; HorizontalOptions = LayoutOptions.Start; VerticalOptions = LayoutOptions.Start; SetBinding(DiceStyleProperty, new Binding(nameof(IStandardDice.Style))); SetBinding(DotColorProperty, new Binding(nameof(IStandardDice.DotColor))); SetBinding(DiceValueProperty, new Binding(nameof(IStandardDice.Value))); SetBinding(FillColorProperty, new Binding(nameof(IStandardDice.FillColor))); SetBinding(HoldProperty, new Binding(nameof(IStandardDice.Hold))); SetBinding(IsSelectedProperty, new Binding(nameof(IStandardDice.IsSelected))); //maybe i forgot this too. BindingContext = thisDice; SKSize tempSize = new SKSize(thisDice.HeightWidth, thisDice.HeightWidth); DiceSize = tempSize.GetSizeUsed(thisP.Proportion); HeightRequest = DiceSize.Height; WidthRequest = DiceSize.Width; _thisDraw.HeightRequest = DiceSize.Height; _thisDraw.WidthRequest = DiceSize.Width; Init(); }
public void LoadList(RummyDiceHandVM thisMod, RummyDiceMainGameClass mainGame) { _thisMod = thisMod; _mainGame = mainGame; DataContext = thisMod; _handList = thisMod.HandList; _handList.CollectionChanged += HandList_CollectionChanged; Text = $"Temp Set {thisMod.Index}"; SetBinding(IsEnabledProperty, nameof(RummyDiceHandVM.IsEnabled)); RummyDiceInfo firstDice = new RummyDiceInfo(); if (firstDice.HeightWidth == 0) { throw new BasicBlankException("You must specify the height/width of the dice"); } IProportionImage thisI = new CustomProportionWPF(); SKSize firstSize = new SKSize(firstDice.HeightWidth, firstDice.HeightWidth); var sizeUsed = firstSize.GetSizeUsed(thisI.Proportion); Grid firstGrid = new Grid(); GridHelper.AddPixelRow(firstGrid, (int)sizeUsed.Height + 50); GridHelper.AddLeftOverRow(firstGrid, 1); Margin = new Thickness(3, 3, 3, 3); _thisStack = new StackPanel(); _thisStack.Orientation = Orientation.Horizontal; Button thisBut = GetGamingButton("Place Tiles", nameof(RummyDiceHandVM.BoardCommand)); //i think since its a different view model, has to do manually. thisBut.Name = ""; thisBut.Command = thisMod.BoardCommand; thisBut.Margin = new Thickness(5, 5, 5, 5); GridHelper.AddControlToGrid(firstGrid, _thisStack, 0, 0); GridHelper.AddControlToGrid(firstGrid, thisBut, 1, 0); _thisGrid = new Grid(); //hopefully does not need visible. if we need visible, rethink. //SetBinding(VisibilityProperty, GetVisibleBinding(nameof(RummyDiceHandVM.Visible))); _thisGrid.Children.Add(ThisDraw); _thisGrid.Children.Add(firstGrid); var thisRect = ThisFrame.GetControlArea(); _thisStack.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3); Width = 1520; //different on xamarin forms. Height = 250; PopulateControls(); //just in case there is something to start with. Content = _thisGrid; }
public void LoadList(RummyDiceHandVM thisMod, RummyDiceMainGameClass mainGame) { _thisMod = thisMod; _mainGame = mainGame; BindingContext = thisMod; HorizontalOptions = LayoutOptions.FillAndExpand; //hopefully this works too. _handList = thisMod.HandList; _handList.CollectionChanged += HandList_CollectionChanged; Text = $"Temp Set {thisMod.Index}"; SetBinding(IsEnabledProperty, new Binding(nameof(RummyDiceHandVM.IsEnabled))); RummyDiceInfo firstDice = new RummyDiceInfo(); if (firstDice.HeightWidth == 0) { throw new BasicBlankException("You must specify the height/width of the dice"); } IProportionImage thisI = new CustomProportionXF(); SKSize firstSize = new SKSize(firstDice.HeightWidth, firstDice.HeightWidth); var sizeUsed = firstSize.GetSizeUsed(thisI.Proportion); Margin = new Thickness(3, 3, 3, 3); _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; _thisStack.Spacing = 0; Button thisBut = GetSmallerButton("Place Tiles", ""); thisBut.Command = thisMod.BoardCommand; //i think this way this time. StackLayout finalStack = new StackLayout(); finalStack.Orientation = StackOrientation.Horizontal; finalStack.Children.Add(thisBut); finalStack.Spacing = 2; finalStack.Children.Add(_thisStack); thisBut.HorizontalOptions = LayoutOptions.Start; thisBut.VerticalOptions = LayoutOptions.Start; _thisStack.HorizontalOptions = LayoutOptions.FillAndExpand; thisBut.FontSize *= .7f; _thisGrid = new Grid(); _thisGrid.Children.Add(ThisDraw); _thisGrid.Children.Add(finalStack); var thisRect = ThisFrame.GetControlArea(); thisBut.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3); _thisStack.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3); PopulateControls(); //just in case there is something to start with. Content = _thisGrid; }
public static string GetDiceTag => "StandardDice"; //same as other dice. public void SendDiceInfo(Multiplier thisDice) //it did send dice { IGamePackageResolver thisR = (IGamePackageResolver)cons !; IProportionImage thisP = thisR.Resolve <IProportionImage>(GetDiceTag); _mains = new ButtonDiceGraphicsCP(); _mains.PaintUI = this; _mains.MinimumWidthHeight = thisDice.HeightWidth; SetBinding(TextProperty, nameof(Multiplier.Value)); SKSize tempSize = new SKSize(thisDice.HeightWidth, thisDice.HeightWidth); DiceSize = tempSize.GetSizeUsed(thisP.Proportion); Height = DiceSize.Height; Width = DiceSize.Width; DataContext = thisDice; Init(); }
public void SendDiceInfo(RummyDiceInfo thisDice, RummyBoardCP board) { _board = board; _mains = new RummyDiceGraphicsCP(this); _mains.MinimumWidthHeight = thisDice.HeightWidth; SetBinding(IsSelectedProperty, new Binding(nameof(RummyDiceInfo.IsSelected))); //maybe i forgot this too. SetBinding(IsVisibleProperty, new Binding(nameof(RummyDiceInfo.Visible))); //i think. SetBinding(ColorProperty, new Binding(nameof(RummyDiceInfo.Color))); SetBinding(ValueProperty, new Binding(nameof(RummyDiceInfo.Display))); //decided to bind to display now. SKSize tempSize = new SKSize(thisDice.HeightWidth, thisDice.HeightWidth); IProportionImage thisP = new CustomProportionXF(); SKSize diceSize = tempSize.GetSizeUsed(thisP.Proportion); BindingContext = thisDice; HeightRequest = diceSize.Height; WidthRequest = diceSize.Width; Init(); }
public void Init(XactikaVMData thisMod, IGamePackageResolver resolver) { SKSize firstSize = new SKSize(60, 138); IProportionImage thisP = resolver.Resolve <IProportionImage>(""); _sizeUsed = firstSize.GetSizeUsed(thisP.Proportion); _tempMod = thisMod.ShapeChoose1; _shapeList = _tempMod !.PieceList; Margin = new Thickness(10, 10, 10, 10); BindingContext = _tempMod; // i think var thisBind = new Binding(nameof(ChooseShapeObservable.Visible)); SetBinding(IsVisibleProperty, thisBind); // i think _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; // for this time, must be horizontal. _shapeList.CollectionChanged += ShapeList_CollectionChanged; Content = _thisStack; PopulateList(); }
public void SendDiceInfo(CategoriesDice thisDice, ThinkTwiceGameContainer gameContainer) //it did send dice { _gameContainer = gameContainer; IGamePackageResolver thisR = (IGamePackageResolver)cons !; IProportionImage thisP = thisR.Resolve <IProportionImage>(GetDiceTag); _mains = new ButtonDiceGraphicsCP(); _mains.PaintUI = this; _mains.MinimumWidthHeight = thisDice.HeightWidth; SetBinding(TextProperty, new Binding(nameof(CategoriesDice.Value))); SetBinding(HoldProperty, new Binding(nameof(CategoriesDice.Hold))); SetBinding(IsVisibleProperty, new Binding(nameof(CategoriesDice.Visible))); SKSize tempSize = new SKSize(thisDice.HeightWidth, thisDice.HeightWidth); DiceSize = tempSize.GetSizeUsed(thisP.Proportion * 1.3f); HeightRequest = DiceSize.Height; WidthRequest = DiceSize.Width; BindingContext = thisDice; Init(); }
public static string GetDiceTag => "StandardDice"; //same as other dice. //private ICommand? Command; public void SendDiceInfo(CategoriesDice thisDice, ThinkTwiceGameContainer gameContainer) //it did send dice { IGamePackageResolver thisR = (IGamePackageResolver)cons !; IProportionImage thisP = thisR.Resolve <IProportionImage>(GetDiceTag); _gameContainer = gameContainer; _mains = new ButtonDiceGraphicsCP(); _mains.PaintUI = this; _mains.MinimumWidthHeight = thisDice.HeightWidth; SetBinding(TextProperty, nameof(CategoriesDice.Value)); SetBinding(HoldProperty, nameof(CategoriesDice.Hold)); SetBinding(VisibilityProperty, GetVisibleBinding(nameof(CategoriesDice.Visible))); SKSize TempSize = new SKSize(thisDice.HeightWidth, thisDice.HeightWidth); DiceSize = TempSize.GetSizeUsed(thisP.Proportion); //Command = thisDice.CategoryClickCommand!; Height = DiceSize.Height; Width = DiceSize.Width; DataContext = thisDice; Init(); }