Exemple #1
0
 public WorldContext(IWatchContext parent, string relativePath, Entities.World world, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(WorldContext)))
            )
 {
     World = world;
     Variables.Add("Entity", new EntityDictionary(this, ".Entity", World, ContextFieldInfo.Make("Entity")));
 }
Exemple #2
0
        void UpdateAutoComplete()
        {
            AutoCompleteSuggestions.Clear();
            RangeInt cursor = addWatchText.Range();

            if (AutoCompleteGlobalContext.TryParseDeepest(addWatchText, ref cursor, out AutoCompleteDeepestContext))
            {
                if (AutoCompleteDeepestContext != AutoCompleteGlobalContext)
                {
                    AutoCompleteSuggestions.Add(new ContextMemberInfo(ContextFieldInfo.Make(".."), ContextTypeInfo.Make(AutoCompleteDeepestContext.GetType())));
                }
                AutoCompleteValidString = addWatchText.Substring(0, cursor.start);
                AutoCompleteDeepestContext.VisitAllMembers((ContextMemberInfo info) =>
                {
                    AutoCompleteSuggestions.Add(info);
                    return(true);
                });
                //ParserUtils.TryParseAt(addWatchText, ref cursor, ".");
                //if (ctx.TryCreateWatch(addWatchText, cursor, out var w))
                //{
                //    WatchRegistry.AddWatch(w);
                //}
            }
        }
 public static ContextMemberInfo MakeNotImplemented()
 {
     return(new ContextMemberInfo(ContextFieldInfo.Make("Not Implemented"), ContextTypeInfo.MakeUnknown()));
 }
 public ContextMemberInfo(ContextFieldInfo fieldInfo, ContextTypeInfo typeInfo)
 {
     FieldInfo = fieldInfo;
     TypeInfo  = typeInfo;
 }
Exemple #5
0
 public GlobalContext()
     : base(null, "", new ContextMemberInfo(ContextFieldInfo.Make(""), ContextTypeInfo.Make(typeof(GlobalContext))))
 {
     Variables.Add("World", new WorldDictionary(this, "World", ContextFieldInfo.Make("World")));
     Variables.Add("Scene", new SceneDictionary(this, "Scene", ContextFieldInfo.Make("Scene")));
 }