public bool CanAddToBuildQueue(ProductionButtonType buttonType) { if (UnderConstruction) { return(false); } // total build queue count including scheduled commands int queueCount = BuildQueue.Count + Player.Me.CountScheduledStructureCommands(this); return(queueCount < MAX_QUEUE_SIZE); }
public void AddToBuildQueue(ProductionButtonType buttonType, short id) { BuildQueue.Add(new BuildQueueItem(buttonType, id, buttonType.BuildTime)); if (BuildQueue.Count == 1) { BuildUnitButtonType unitButtonType = BuildQueue[0].Type as BuildUnitButtonType; if (unitButtonType != null) { if (Player.Players[Team].CurrentSupply + unitButtonType.UnitType.SupplyCost <= Player.Players[Team].MaxSupply) { Player.Players[Team].CurrentSupply += unitButtonType.UnitType.SupplyCost; BuildQueue[0].Started = true; } } } }
public BuildQueueItem(ProductionButtonType commandType, short id, int buildTime) { Type = commandType; ID = id; BuildTime = buildTime; }
public bool CanAddToBuildQueue(ProductionButtonType buttonType) { if (UnderConstruction) return false; // total build queue count including scheduled commands int queueCount = BuildQueue.Count + Player.Me.CountScheduledStructureCommands(this); if (queueCount < MAX_QUEUE_SIZE) { /*if (queueCount == 1) { BuildUnitButtonType unitButtonType = BuildQueue[0].Type as BuildUnitButtonType; if (unitButtonType != null) { //Player.Players[Team].CurrentSupply += unitButtonType.UnitType.SupplyCost; if (Player.Players[Team].CurrentSupply + unitButtonType.UnitType.SupplyCost <= Player.Players[Team].MaxSupply) { } } }*/ return true; } return false; }