Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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));
            }
        }