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;
 }
Ejemplo n.º 2
0
        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 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>();
        }