Esempio n. 1
0
        static partial void Init(ref ME.ECS.StructComponentsContainer structComponentsContainer)
        {
            WorldUtilities.ResetTypeIds();

            CoreComponentsInitializer.InitTypeId();


            WorldUtilities.InitComponentTypeId <Example.Features.Logic.DestroyByTime.Components.DestroyByTime>(false, false, false, false, false);
            WorldUtilities.InitComponentTypeId <Example.Features.Logic.ForceAtPoint.Components.AddForce>(false, false, false, false, false);
            WorldUtilities.InitComponentTypeId <Example.Features.Logic.ForceAtPoint.Components.Force>(false, false, false, false, false);
            WorldUtilities.InitComponentTypeId <Example.Features.Map.Components.IsMap>(true, false, false, false, false);
            WorldUtilities.InitComponentTypeId <Example.Features.PlayerFire.Components.BulletFly>(false, false, false, false, false);
            WorldUtilities.InitComponentTypeId <Example.Features.PlayerFire.Components.FireAction>(true, false, false, false, false);
            WorldUtilities.InitComponentTypeId <Example.Features.PlayerFire.Components.IsBullet>(false, false, false, false, false);
            WorldUtilities.InitComponentTypeId <Example.Features.PlayerMovement.Components.LastMovementDirection>(false, false, false, false, false);
            WorldUtilities.InitComponentTypeId <Example.Features.PlayerMovement.Components.MoveAction>(false, false, false, false, false);
            WorldUtilities.InitComponentTypeId <Example.Features.Players.Components.IsPlayer>(true, false, false, false, false);

            ComponentsInitializerWorld.Setup(ComponentsInitializerWorldGen.Init);
            CoreComponentsInitializer.Init(ref structComponentsContainer);


            structComponentsContainer.Validate <Example.Features.Logic.DestroyByTime.Components.DestroyByTime>(false);
            structComponentsContainer.Validate <Example.Features.Logic.ForceAtPoint.Components.AddForce>(false);
            structComponentsContainer.Validate <Example.Features.Logic.ForceAtPoint.Components.Force>(false);
            structComponentsContainer.Validate <Example.Features.Map.Components.IsMap>(true);
            structComponentsContainer.Validate <Example.Features.PlayerFire.Components.BulletFly>(false);
            structComponentsContainer.Validate <Example.Features.PlayerFire.Components.FireAction>(true);
            structComponentsContainer.Validate <Example.Features.PlayerFire.Components.IsBullet>(false);
            structComponentsContainer.Validate <Example.Features.PlayerMovement.Components.LastMovementDirection>(false);
            structComponentsContainer.Validate <Example.Features.PlayerMovement.Components.MoveAction>(false);
            structComponentsContainer.Validate <Example.Features.Players.Components.IsPlayer>(true);
        }
Esempio n. 2
0
        public static World PrepareWorld()
        {
            World world = null;

            WorldUtilities.CreateWorld <TestState>(ref world, 0.033f);
            {
                world.SetState <TestState>(WorldUtilities.CreateState <TestState>());
                world.SetSeed(1u);
                {
                    WorldUtilities.InitComponentTypeId <ME.ECS.Views.ViewComponent>(false);
                    WorldUtilities.InitComponentTypeId <ME.ECS.Name.Name>(false);
                    WorldUtilities.InitComponentTypeId <ME.ECS.Transform.Childs>(false);
                    WorldUtilities.InitComponentTypeId <ME.ECS.Collections.IntrusiveListNode>(false);
                    WorldUtilities.InitComponentTypeId <ME.ECS.Collections.IntrusiveHashSetBucket>(false);
                    world.GetStructComponents().Validate <ME.ECS.Views.ViewComponent>();
                    world.GetStructComponents().Validate <ME.ECS.Name.Name>();
                    world.GetStructComponents().Validate <ME.ECS.Transform.Childs>();
                    world.GetStructComponents().Validate <ME.ECS.Collections.IntrusiveListNode>();
                    world.GetStructComponents().Validate <ME.ECS.Collections.IntrusiveHashSetBucket>();
                    ComponentsInitializerWorld.Setup((e) => {
                        e.ValidateData <ME.ECS.Views.ViewComponent>();
                        e.ValidateData <ME.ECS.Name.Name>();
                        e.ValidateData <ME.ECS.Transform.Childs>();
                        e.ValidateData <ME.ECS.Collections.IntrusiveListNode>();
                        e.ValidateData <ME.ECS.Collections.IntrusiveHashSetBucket>();
                    });
                    //world.SetEntitiesCapacity(1000);
                }
            }

            WorldUtilities.SetWorld(world);

            return(world);
        }
 public static void InitTypeId()
 {
     WorldUtilities.InitComponentTypeId <ME.ECS.Features.PhysicsDeterministic.Components.PhysicsRigidbody>(true);
     WorldUtilities.InitComponentTypeId <ME.ECS.Features.PhysicsDeterministic.Components.PhysicsOnCollisionEnter>();
     WorldUtilities.InitComponentTypeId <ME.ECS.Features.PhysicsDeterministic.Components.PhysicsOnCollisionExit>();
     WorldUtilities.InitComponentTypeId <ME.ECS.Features.PhysicsDeterministic.Components.PhysicsOnCollisionStay>();
 }
Esempio n. 4
0
        public static void InitTypeId()
        {
            WorldUtilities.InitComponentTypeId <ME.ECS.Transform.Childs>();
            WorldUtilities.InitComponentTypeId <ME.ECS.Transform.Container>();

            Transform2DComponentsInitializer.InitTypeId();
            Transform3DComponentsInitializer.InitTypeId();
        }
        public static void InitTypeId()
        {
            WorldUtilities.InitComponentTypeId <ME.ECS.Transform.Nodes>(isVersioned: true, isSimple: true);
            WorldUtilities.InitComponentTypeId <ME.ECS.Transform.Container>(isVersioned: true, isSimple: true);

            Transform2DComponentsInitializer.InitTypeId();
            Transform3DComponentsInitializer.InitTypeId();
        }
        public static void Init(ref ME.ECS.StructComponentsContainer structComponentsContainer)
        {
            WorldUtilities.InitComponentTypeId <ME.ECS.Views.ViewComponent>(false);
            WorldUtilities.InitComponentTypeId <ME.ECS.Views.IViewComponent>(false);

            TransformComponentsInitializer.Init(ref structComponentsContainer);
            NameComponentsInitializer.Init(ref structComponentsContainer);
            CameraComponentsInitializer.Init(ref structComponentsContainer);
            PhysicsComponentsInitializer.Init(ref structComponentsContainer);
        }
Esempio n. 7
0
        public static void InitTypeId()
        {
            WorldUtilities.InitComponentTypeId <ME.ECS.Views.ViewComponent>(false);
            WorldUtilities.InitComponentTypeId <ME.ECS.Views.IViewComponent>(false);

            TransformComponentsInitializer.InitTypeId();
            NameComponentsInitializer.InitTypeId();
            CameraComponentsInitializer.InitTypeId();
            PhysicsComponentsInitializer.InitTypeId();
        }
        public static void InitTypeId()
        {
            WorldUtilities.InitComponentTypeId <ME.ECS.Views.ViewComponent>(false);
            WorldUtilities.InitComponentTypeId <ME.ECS.Collections.IntrusiveListNode>(false);
            WorldUtilities.InitComponentTypeId <ME.ECS.Collections.IntrusiveHashSetBucket>(false);

            ME.ECS.DataConfigs.DataConfig.InitTypeId();
            TransformComponentsInitializer.InitTypeId();
            NameComponentsInitializer.InitTypeId();
            CameraComponentsInitializer.InitTypeId();
        }
        static partial void InitTypeIdPartial()
        {
            WorldUtilities.ResetTypeIds();
            CoreComponentsInitializer.InitTypeId();


            WorldUtilities.InitComponentTypeId <Example.Features.Players.Components.IsPlayer>(true);
            WorldUtilities.InitComponentTypeId <Example.Features.Map.Components.IsMap>(true);
            WorldUtilities.InitComponentTypeId <Example.Features.PlayerMovement.Components.LastMovementDirection>(false);
            WorldUtilities.InitComponentTypeId <Example.Features.PlayerMovement.Components.MoveAction>(false);
            WorldUtilities.InitComponentTypeId <Example.Features.PlayerFire.Components.FireAction>(true);
            WorldUtilities.InitComponentTypeId <Example.Features.PlayerFire.Components.IsBullet>(false);
            WorldUtilities.InitComponentTypeId <Example.Features.PlayerFire.Components.BulletFly>(false);
            WorldUtilities.InitComponentTypeId <Example.Features.Logic.ForceAtPoint.Components.AddForce>(false);
            WorldUtilities.InitComponentTypeId <Example.Features.Logic.ForceAtPoint.Components.Force>(false);
            WorldUtilities.InitComponentTypeId <Example.Features.Logic.DestroyByTime.Components.DestroyByTime>(false);
        }
Esempio n. 10
0
        public void Initialize()
        {
            ME.ECS.Pools.current = new ME.ECS.PoolImplementation(isNull: false);
            var reg = new UnmanagedComponentsStorage();

            reg.Initialize();
            try {
                WorldUtilities.InitComponentTypeId <TestComponent>();
                reg.Validate <TestComponent>();
                for (int i = 0; i < 100; ++i)
                {
                    reg.Validate <TestComponent>(i);
                }
            } finally {
                reg.Dispose();
            }
        }
        public static void Init(ref ME.ECS.StructComponentsContainer structComponentsContainer)
        {
            WorldUtilities.InitComponentTypeId <ME.ECS.Pathfinding.Features.Pathfinding.Components.PathfindingInstance>(false, true, false, false);
            WorldUtilities.InitComponentTypeId <ME.ECS.Pathfinding.Features.Pathfinding.Components.CalculatePath>(false, false, false, false);
            WorldUtilities.InitComponentTypeId <ME.ECS.Pathfinding.Features.PathfindingAstar.Components.Path>(false, true, false, false);
            WorldUtilities.InitComponentTypeId <ME.ECS.Pathfinding.Features.PathfindingFlowField.Components.PathFlowField>(false, true, false, false);
            WorldUtilities.InitComponentTypeId <ME.ECS.Pathfinding.Features.Pathfinding.Components.IsPathfinding>(true, false, false, false);
            WorldUtilities.InitComponentTypeId <ME.ECS.Pathfinding.Features.Pathfinding.Components.BuildAllGraphs>(true, false, false, false);
            WorldUtilities.InitComponentTypeId <ME.ECS.Pathfinding.Features.Pathfinding.Components.IsAllGraphsBuilt>(true, false, false, false);
            WorldUtilities.InitComponentTypeId <ME.ECS.Pathfinding.Features.Pathfinding.Components.HasPathfindingInstance>(true, false, false, false);
            WorldUtilities.InitComponentTypeId <ME.ECS.Pathfinding.Features.Pathfinding.Components.IsPathBuilt>(true, false, false, false);

            structComponentsContainer.ValidateCopyable <ME.ECS.Pathfinding.Features.Pathfinding.Components.PathfindingInstance>(false);
            structComponentsContainer.Validate <ME.ECS.Pathfinding.Features.Pathfinding.Components.CalculatePath>();
            structComponentsContainer.ValidateCopyable <ME.ECS.Pathfinding.Features.PathfindingAstar.Components.Path>();
            structComponentsContainer.ValidateCopyable <ME.ECS.Pathfinding.Features.PathfindingFlowField.Components.PathFlowField>();
            structComponentsContainer.Validate <ME.ECS.Pathfinding.Features.Pathfinding.Components.IsPathfinding>(true);
            structComponentsContainer.Validate <ME.ECS.Pathfinding.Features.Pathfinding.Components.BuildAllGraphs>(true);
            structComponentsContainer.Validate <ME.ECS.Pathfinding.Features.Pathfinding.Components.IsAllGraphsBuilt>(true);
            structComponentsContainer.Validate <ME.ECS.Pathfinding.Features.Pathfinding.Components.HasPathfindingInstance>(true);
            structComponentsContainer.Validate <ME.ECS.Pathfinding.Features.Pathfinding.Components.IsPathBuilt>(true);
        }
Esempio n. 12
0
        public void Get()
        {
            ME.ECS.Pools.current = new ME.ECS.PoolImplementation(isNull: false);
            var reg = new UnmanagedComponentsStorage();

            reg.Initialize();
            try {
                WorldUtilities.InitComponentTypeId <TestComponent>();
                reg.Validate <TestComponent>();
                for (int i = 0; i < 100; ++i)
                {
                    reg.Validate <TestComponent>(i);
                }

                ref var data = ref reg.Get <TestComponent>(1);
                NUnit.Framework.Assert.AreEqual(data.value, 0);
                var data2 = reg.Read <TestComponent>(2);
                NUnit.Framework.Assert.AreEqual(data2.value, 0);
                data.value = 123;
                var data3 = reg.Read <TestComponent>(1);
                NUnit.Framework.Assert.AreEqual(data3.value, 123);
            } finally {
 public static void InitTypeId()
 {
     WorldUtilities.InitComponentTypeId <ME.ECS.Name.Name>(isVersioned: false, isSimple: true);
 }
Esempio n. 14
0
 public static void InitTypeId()
 {
     WorldUtilities.InitComponentTypeId <ME.ECS.Camera.Camera>(isVersioned: true, isSimple: true);
 }
 public static void InitTypeId()
 {
     WorldUtilities.InitComponentTypeId <ME.ECS.Transform.Position2D>();
     WorldUtilities.InitComponentTypeId <ME.ECS.Transform.Rotation2D>();
     WorldUtilities.InitComponentTypeId <ME.ECS.Transform.Scale2D>();
 }
 public static void InitTypeId()
 {
     WorldUtilities.InitComponentTypeId <SourceConfig>();
 }
Esempio n. 17
0
 public static void InitTypeId()
 {
     WorldUtilities.InitComponentTypeId <ME.ECS.Transform.Position2D>(isVersioned: true, isSimple: true);
     WorldUtilities.InitComponentTypeId <ME.ECS.Transform.Rotation2D>(isVersioned: true, isSimple: true);
     WorldUtilities.InitComponentTypeId <ME.ECS.Transform.Scale2D>(isVersioned: true, isSimple: true);
 }
Esempio n. 18
0
 public static void InitTypeId()
 {
     WorldUtilities.InitComponentTypeId <ME.ECS.Camera.Camera>();
 }