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); }
/// <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; }