protected override void update_kits() { base.update_kits(); var queued = get_queued_ids(); foreach (var vsl in FlightGlobals.Vessels) { if (!vsl.loaded) { continue; } var containers = VesselKitInfo.GetKitContainers <IAssemblySpace>(vsl).Where(c => c.Valid); if (containers == null) { continue; } foreach (var vsl_kit in containers.SelectMany(c => c.GetKits())) { if (vsl_kit != null && vsl_kit.Valid && vsl_kit != CurrentTask.Kit && !queued.Contains(vsl_kit.id) && (vessel.vesselTransform.position - vsl.vesselTransform.position).magnitude < GLB.MaxDistanceToWorkshop) { sort_task(new AssemblyKitInfo(vsl_kit)); } } } }
protected override void update_kits() { base.update_kits(); var queued = get_queued_ids(); if (vessel.loaded) { var containers = VesselKitInfo .GetKitContainers <IConstructionSpace>(vessel) ?.Where(s => s.Valid); if (containers != null) { foreach (var vsl_kit in containers.SelectMany(c => c.GetKits())) { if (vsl_kit != null && vsl_kit.Valid && vsl_kit != CurrentTask.Kit && !queued.Contains(vsl_kit.id)) { sort_task(new ConstructionKitInfo(vsl_kit)); } } } } }
protected override void update_kits() { base.update_kits(); if (vessel.loaded) { update_kits(VesselKitInfo.GetKitContainers <IAssemblySpace>(vessel)); } }
protected override List <IAssemblySpace> get_assembly_spaces() { var spaces = new List <IAssemblySpace>(); foreach (var vsl in FlightGlobals.Vessels) { if (!vsl.loaded) { continue; } var vsl_spaces = VesselKitInfo.GetKitContainers <IAssemblySpace>(vsl).Where(s => s.Valid); if (vsl_spaces != null) { spaces.AddRange(vsl_spaces); } } return(spaces); }
protected float dist2kit(VesselKitInfo kit) => (kit.Kit.Host.vessel.transform.position - vessel.transform.position).magnitude;
protected IAssemblySpace find_best_assembly_space(VesselKit kit, Vessel vsl) => find_best_assembly_space(kit, VesselKitInfo.GetKitContainers <IAssemblySpace>(vsl));
protected override List <IAssemblySpace> get_assembly_spaces() => VesselKitInfo.GetKitContainers <IAssemblySpace>(vessel)?.Where(s => s.Valid).ToList();