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"))); }
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 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"))); }