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>())); }
public EntityIterator GetEnumerator() { var entityEnumerator = new EntityIterator(); entityEnumerator.ApplyGroup(this); return(entityEnumerator); }
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()); }
protected void IterateQuery(IQueryIterator iterator, EntityQuery query, bool onlyDirty = true) { if (onlyDirty) { EntityIterator.PerformIteration(World, iterator, query, LastVersionWorked); } else { EntityIterator.PerformIteration(World, iterator, query); } }
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; } }
public ManyToManySystem(World myWorld, int SystemLevel = 3) : base(SystemLevel) { myIteratorOtherMany = new EntityIteratorDefault <ManyRight>(myWorld); myIteratorMany = new EntityIteratorDefault <ManyLeft>(myWorld); }
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); }
public SelfContainedEntitySystem(World myWorld, int SystemLevel) : base(SystemLevel) { myIterator = new EntityIteratorDefault <T>(myWorld); }
public ref T Get(EntityIterator f) { return(ref componentDatas[f.CurrentChunkIndex][f.CurrentIndex]);