예제 #1
0
 public WorldDictionary(IWatchContext parent, string relativePath, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(WorldDictionary)))
            )
 {
 }
예제 #2
0
 public GameObjectComponentDictionary(IWatchContext parent, string relativePath, GameObject go, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(GameObjectContext)))
            )
 {
     GO = go;
 }
예제 #3
0
 public GameObjectDictionary(IWatchContext parent, string relativePath, UnityEngine.SceneManagement.Scene scene, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(GameObjectDictionary)))
            )
 {
     Scene = scene;
 }
예제 #4
0
 public EntityDictionary(IWatchContext parent, string relativePath, Entities.World world, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(EntityDictionary)))
            )
 {
     World = world;
 }
예제 #5
0
 public GameObjectContext(IWatchContext parent, string relativePath, GameObject go, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(GameObjectContext)))
            )
 {
     GO = go;
     this.Variables.Add("Components", new GameObjectComponentDictionary(this, ".Components", go, ContextFieldInfo.Make("Components")));
 }
예제 #6
0
 public SceneContext(IWatchContext parent, string relativePath, UnityEngine.SceneManagement.Scene scene, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(SceneContext)))
            )
 {
     Scene = scene;
     Variables.Add("GameObject", new GameObjectDictionary(this, ParserUtils.MakePathRelative("GameObject"), Scene, ContextFieldInfo.Make("GameObject")));
 }
예제 #7
0
 public EntityContext(IWatchContext parent, string relativePath, Entity entity, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(WorldContext)))
            )
 {
     this.entity = entity;
     //Variables.Add("Components", new EntityDictionary(this, ".Entity", World, ContextFieldInfo.Make("Entity")));
 }
예제 #8
0
 // propPath
 public PropertyPathContext(IWatchContext parent, IWatchContext rootPathContext, string relativePath, TContainer container, PropertyPath propPath, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(TPropertyType)))
            )
 {
     Container       = container;
     PropPath        = propPath;
     RootPathContext = rootPathContext;
 }
예제 #9
0
 VisitStatus IPropertyVisitor.VisitProperty <TProperty2, TContainer2, TValue2>(TProperty2 property, ref TContainer2 container, ref ChangeTracker changeTracker)
 {
     if (Result)
     {
         var info = new ContextMemberInfo(
             ContextFieldInfo.Make(property.GetName()),
             ContextTypeInfo.MakeProperty(property)
             );
         Result = Visitor(info);
     }
     return(VisitStatus.Handled);
 }
예제 #10
0
        public override bool VisitAllMembers(Func <ContextMemberInfo, bool> visitor)
        {
            var comps = GO.GetComponents <Component>();

            for (int i = 0; i != comps.Length; ++i)
            {
                var info = new ContextMemberInfo(
                    ContextFieldInfo.MakeOperator($"[{i}]"),
                    ContextTypeInfo.Make(comps[i].GetType())
                    );
                if (!visitor(info))
                {
                    return(false);
                }
            }
            return(true);
        }
예제 #11
0
 protected ContextMemberInfo MakeMemberInfo <TMemberType>(string index)
 {
     return(new ContextMemberInfo(ContextFieldInfo.MakeOperator($"[{index}]"), ContextTypeInfo.Make(typeof(TMemberType))));
 }
예제 #12
0
 public override bool VisitAllMembers(Func <ContextMemberInfo, bool> visitor)
 {
     foreach (var e in World.EntityManager.GetAllEntities())
     {
         var info = new ContextMemberInfo(ContextFieldInfo.MakeOperator($"[{e.Index}]"), ContextTypeInfo.Make(typeof(PropertyPathContext <EntityContainer, EntityContainer>)));
         if (!visitor(info))
         {
             return(false);
         }
     }
     return(true);
 }