Exemplo n.º 1
0
 public WorldDictionary(IWatchContext parent, string relativePath, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(WorldDictionary)))
            )
 {
 }
Exemplo n.º 2
0
 public GameObjectComponentDictionary(IWatchContext parent, string relativePath, GameObject go, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(GameObjectContext)))
            )
 {
     GO = go;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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")));
 }
Exemplo n.º 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")));
 }
Exemplo n.º 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")));
 }
Exemplo n.º 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;
 }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
0
 protected ContextMemberInfo MakeMemberInfo <TMemberType>(string index)
 {
     return(new ContextMemberInfo(ContextFieldInfo.MakeOperator($"[{index}]"), ContextTypeInfo.Make(typeof(TMemberType))));
 }
Exemplo n.º 11
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);
 }