public static ITerminalProperty GetVirtualProperty(this Sandbox.ModAPI.Ingame.IMyTerminalBlock block, string id, bool copy = false) { var key = block.GetVirtualBlockKey(); if (key > 0) { SEASessionManager.IVirtualTerminalProperty property = virtualPropertis[key].FirstOrDefault(x => string.Equals(x.Id, id, StringComparison.OrdinalIgnoreCase)); return(property == null ? null : (copy ? property.Copy(block) : property)); } return(null); }
public static void GetVirtualProperties(this Sandbox.ModAPI.Ingame.IMyTerminalBlock block, List <ITerminalProperty> resultList, Func <ITerminalProperty, bool> collect = null) { if (resultList == null) { resultList = new List <ITerminalProperty>(); } var key = block.GetVirtualBlockKey(); if (key > 0) { resultList.AddRange(virtualPropertis[key].Where(collect)); } }