示例#1
0
            private IMyTerminalBlock GetBlockFromCache(string name)
            {
                IMyTerminalBlock blockToReturn;
                bool             found = _cache.TryGetValue(name, out blockToReturn);

                if (!found)
                {
                    _out.Log($"Block '{name}' does not exist in cache, adding...");
                    blockToReturn = FindBlockByName(name);

                    if (blockToReturn != null)
                    {
                        _cache.Add(name, blockToReturn);
                    }
                }
                else
                {
                    _out.Log($"{name} was found in the cache.");
                }

                return(blockToReturn);
            }
示例#2
0
            public void HandleException(Exception exception)
            {
                debugLCD.Log(exception);

                throw exception; //This is rethrown to prevent the script from resuming in space engineers.
            }