private void LoadEventExpressionsForTypes(IReadOnlyCollection <KeyValuePair <string, SkriptType> > nonPluralTypes) { foreach (var skriptEvent in Workspace.AddonDocumentations.SelectMany(c => c.Events)) { var types = nonPluralTypes .Select(cc => (Type: cc.Value.ClassName, Expressions: KnownExpressionsFromAddons .OfType <SyntaxSkriptEventValueExpression>() .Where(c => c.Parent == skriptEvent) .Where(c => c.ReturnType == cc.Value.ClassName || CheckClassExtendsAnother(c.ReturnType, cc.Value.ClassName)).ToList())) .Where(c => c.Expressions.Count > 0) .Select(c => new KeyValuePair <string, IReadOnlyList <SyntaxSkriptExpression> >(c.Type, c.Expressions)) .ToList(); EventExpressionsForType.TryAdd(skriptEvent, new ConcurrentDictionary <string, IReadOnlyList <SyntaxSkriptExpression> >(types)); } }
public ConcurrentDictionary <string, IReadOnlyList <SyntaxSkriptExpression> > GetEventExpressionsForEvent( SkriptEvent @event) { return(EventExpressionsForType.GetValue(@event)); }