Exemplo n.º 1
0
 // Constructor...
 public CAvailableSource(int ab1, AvailableController fAvail1)  //, CLineupCard lineupCard1) {
 // ----------------------------------------------------------
 {
     abThis     = ab1;
     fAvail     = fAvail1;
     gm         = fAvail.g;
     lineupCard = fAvail1.lineupCard;
 }
Exemplo n.º 2
0
//      public int SelectedRow = -1;
//      public CBatter SelectedBatter = null;



        // Constructor...
        public CLineupCardSource(int ab1, LineupCardController fLineup1)
        {
            // ----------------------------------------------------------
            abThis     = ab1;
            fLineup    = fLineup1;
            gm         = fLineup1.g;
            lineupCard = fLineup1.lineupCard;
        }
Exemplo n.º 3
0
        public void UpdateCell(CGame gm1, int ab, CLineupCard lu1, NSIndexPath ixp)
        {
            // --------------------------------------------------
            //int bx = gm1.bat[ab, ixp.Row+1].bx;
            if (ixp.Row > lu1.Available.Count - 1)
            {
                return;
            }
            int     bx   = lu1.Available[ixp.Row].bx;
            CBatter bat1 = gm1.t[ab].bat[bx];

            lblName.Text  = bat1.DisplayName;
            lblSkill.Text = bat1.DisplaySkill;
        }
Exemplo n.º 4
0
        public void UpdateCell(CGame gm1, int ab, CLineupCard lu1, NSIndexPath ixp)
        {
            // --------------------------------------------------
            //int bx = gm1.bat[ab, ixp.Row+1].bx;
            int     bx   = lu1.CurrentLineup[ixp.Row].bx;
            CBatter bat1 = gm1.t[ab].bat[bx];


            lblSlot.Text  = bat1.DisplaySlot;
            lblName.Text  = bat1.DisplayName;
            lblPos.Text   = bat1.DisplayPos;
            lblBase.Text  = bat1.DisplayBase;
            lblSkill.Text = bat1.DisplaySkill;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Sets the attributes of the buttons, etc., and their eneablement a/o visibility,.
        /// </summary>
        ///
        private void SetupCard()
        {
            // ----------------------------

            abGame = (side)g.ab;

            if (g.PlayState == PLAY_STATE.START || g.PlayState == PLAY_STATE.NONE)
            {
                gameState = EGameState.PreGame;
            }
            else
            {
                if (abGame == abMng)
                {
                    gameState = EGameState.Offense;
                }
                else
                {
                    gameState = EGameState.Defense;
                }
            }

            lineupCard           = new CLineupCard(g, abMng);
            dgvLineupCard.Source = new CLineupCardSource((int)abMng, this);

            EnableControl(cmdEditFielding, false);
            EnableControl(cmdSaveLineup, false);

            cmdEditFielding.Hidden = true;
            cmdSaveLineup.Hidden   = true;

            SetButtonColors(cmdMoveUp);
            SetButtonColors(cmdMoveDown);
            SetButtonColors(cmdPinchHit);
            SetButtonColors(cmdPinchRun);
            SetButtonColors(cmdReplace);
            SetButtonColors(cmdChangePos);
            SetButtonColors(cmdEditFielding);
            SetButtonColors(cmdSaveLineup);
            SetButtonColors(cmdDoIt);
            SetButtonColors(cmdDone);

            if (this.SelectedRow < 0)
            {
                EnableControl(cmdMoveUp, false);
                EnableControl(cmdMoveDown, false);
                EnableControl(cmdPinchHit, false);
                EnableControl(cmdPinchRun, false);
                EnableControl(cmdReplace, false);
                EnableControl(cmdDoIt, false);
                EnableControl(cmdChangePos, false);
                return;
            }

            SetLabelBorder(lblAction, UIColor.Brown, 1);

            switch (gameState)
            {
            case EGameState.PreGame:
                EnableControl(cmdMoveUp, true);
                EnableControl(cmdMoveDown, true);
                EnableControl(cmdPinchHit, false);
                EnableControl(cmdPinchRun, false);
                EnableControl(cmdReplace, true);
                EnableControl(cmdChangePos, true);
                EnableControl(cmdDoIt, false);
                break;

            case EGameState.Offense:
                EnableControl(cmdMoveUp, false);
                EnableControl(cmdMoveDown, false);
                EnableControl(cmdPinchHit, false);
                EnableControl(cmdPinchRun, false);
                EnableControl(cmdReplace, false);
                EnableControl(cmdChangePos, false);
                EnableControl(cmdDoIt, false);
                break;

            case EGameState.Defense:
                EnableControl(cmdMoveUp, false);
                EnableControl(cmdMoveDown, false);
                EnableControl(cmdPinchHit, false);
                EnableControl(cmdPinchRun, false);
                EnableControl(cmdReplace, true);
                EnableControl(cmdChangePos, true);
                EnableControl(cmdDoIt, false);
                break;

            default:
                break;
            }
        }