Пример #1
0
        public async Task Apply(IScriptHost context)
        {
            foreach (var script in Scripts)
            {
                switch (script.Type)
                {
                case ScriptType.CSharp:
                    await context.ExecuteCSharp(script.Value).ConfigureAwait(false);

                    break;

                case ScriptType.Lua:
                    context.ExecuteLua(script.Value);
                    break;

                default:
                    throw new InvalidOperationException("Unsupported script type: " + script.Type.ToString("f"));
                }
            }
        }