void CheckIdleUnits() { logfile.WriteLine("CheckIdleUnits()"); foreach (KeyValuePair <int, IUnitDef> kvp in UnitController.GetInstance().UnitDefByDeployedId) { // logfile.WriteLine("Checking " + kvp.Key); if (kvp.Value.canBuild) { if (!aicallback.UnitIsBusy(kvp.Key)) { logfile.WriteLine("Unit " + kvp.Value.humanName + " not busy, calling idle"); if (AssistingConstructors.ContainsKey(kvp.Key)) { logfile.WriteLine("removing from assistingconstructors"); AssistingConstructors.Remove(kvp.Key); } csai_UnitIdleEvent(kvp.Key); } if (!ActiveConstructors.Contains(kvp.Key)) { logfile.WriteLine("Unit " + kvp.Value.humanName + " not in active commanders, calling idle"); csai_UnitIdleEvent(kvp.Key); } } } }
void CheckIdleUnits() { logfile.WriteLine("constructor controller Checking idle units"); foreach (int unitid in UnitDefByUnitId.GetUnitIds()) { if (!aicallback.UnitIsBusy(unitid)) { logfile.WriteLine("Constructor " + unitid + " detected as idle, putting to work"); BuildSomething(unitid); } } }
public void VoiceCommandCommanderIsActive(string chatstring, string[] splitchatstring, int player) { aicallback.SendTextMsg("Commander UnitIsBusy: " + aicallback.UnitIsBusy(commanderid).ToString(), 0); }