Exemple #1
0
        public BuyTransaction Clone()
        {
            BuyTransaction clone = new BuyTransaction(Unit, Owner);

            int unitCount = (PreviewPlatoons.Count - 1) * MAX_PLATOON_SIZE + _smallestPlatoonSize;

            while (unitCount-- > 1)
            {
                clone.AddUnit();
            }

            return(clone);
        }
Exemple #2
0
        /// <summary>
        ///     Called when a unit card from the buy menu is pressed.
        /// </summary>
        /// <param name="unit"></param>
        public void BuyCallback(Unit unit)
        {
            bool paid = _session.LocalPlayer.TryPay(unit.Price);

            if (!paid)
            {
                return;
            }

            if (_currentBuyTransaction == null)
            {
                _currentBuyTransaction = new BuyTransaction(unit, _localPlayer);
            }
            else
            {
                _currentBuyTransaction.AddUnit();
            }

            //buildUnit(UnitType.Tank);
            CurMouseMode = MouseMode.PURCHASING;
        }