Esempio n. 1
0
        protected override void OnDraw()
        {
            if (ImGui.BeginMenuBar())
            {
                if (ImGui.BeginMenu("Settings"))
                {
                    if (ImGui.MenuItem("Keep Aspect", "", keepAspect, true))
                    {
                        keepAspect = !keepAspect;
                    }

                    ImGui.EndMenu();
                }
                ImGui.EndMenuBar();
            }

            currSize = ImGui.GetContentRegionAvail();
            if (keepAspect)
            {
                currSize = GetAspectArea(currSize);
            }

            if (prevSize != currSize)
            {
                AppScreen.Resolution = (Vec2i)currSize;
            }
            prevSize = currSize;

            EntityIterator.PerformIteration(EntityWorld.Active, new RenderCamera()
            {
                imageSize = currSize
            }, new EntityQuery().Any(TypeCache.ReadType <C_Camera>()));
        }
Esempio n. 2
0
        public EntityIterator GetEnumerator()
        {
            var entityEnumerator = new EntityIterator();

            entityEnumerator.ApplyGroup(this);
            return(entityEnumerator);
        }
Esempio n. 3
0
 protected override void OnDraw()
 {
     ImGui.Text($"ID: {Context.id}");
     ImGui.SameLine();
     ImGui.Text($"Version: {Context.version}");
     ImGui.Separator();
     EntityIterator.PerformIteration(EntityWorld.Active, new DrawComponentsFromEntity()
     {
         entity = Context, drawers = drawers
     }, new EntityQuery());
 }
Esempio n. 4
0
 protected void IterateQuery(IQueryIterator iterator, EntityQuery query, bool onlyDirty = true)
 {
     if (onlyDirty)
     {
         EntityIterator.PerformIteration(World, iterator, query, LastVersionWorked);
     }
     else
     {
         EntityIterator.PerformIteration(World, iterator, query);
     }
 }
Esempio n. 5
0
        public void GetByEnumerator()
        {
            Group group = new Group();

            group.Chunks = chunks;
            ComponentArray <Component2> array = new ComponentArray <Component2>();

            array.UpdateChunks(ref chunks);
            var enumerator = new EntityIterator();

            enumerator.ApplyGroup(group);

            int entityCount = 0;

            while (enumerator.MoveNext())
            {
                var component = array.Get(enumerator);
                Assert.AreEqual(entityCount, component.Value);
                ++entityCount;
            }
        }
Esempio n. 6
0
 public ManyToManySystem(World myWorld, int SystemLevel = 3) : base(SystemLevel)
 {
     myIteratorOtherMany = new EntityIteratorDefault <ManyRight>(myWorld);
     myIteratorMany      = new EntityIteratorDefault <ManyLeft>(myWorld);
 }
Esempio n. 7
0
        public OneToManySystem(World myBase, int SystemLevel = 1) : base(SystemLevel)
        {
            myReferenceSingleton = SingletonComponent <T> .Get();

            myIterator = new EntityIteratorDefault <U>(myBase);
        }
 public SingletonToManySystem(World myWorld, int SystemLevel = 1) : base(SystemLevel)
 {
     myIterator = new EntityIteratorDefault <T>(myWorld);
 }
Esempio n. 9
0
 public SelfContainedEntitySystem(World myWorld, int SystemLevel) : base(SystemLevel)
 {
     myIterator = new EntityIteratorDefault <T>(myWorld);
 }
Esempio n. 10
0
 public ref T Get(EntityIterator f)
 {
     return(ref componentDatas[f.CurrentChunkIndex][f.CurrentIndex]);