public void Execute() { for (var x = 0; x < Helper.Width; ++x) { var y = 0; while (y < Helper.Height - 1) { var currIndex = Helper.GetI(x, y); var currEntity = CachedEntities[currIndex]; if (currEntity != Entity.Null) { y += 1; continue; } var topY = y + 1; while (topY < Helper.Height) { var topIndex = Helper.GetI(x, topY); var topEntity = CachedEntities[topIndex]; if (topEntity == Entity.Null) { topY += 1; continue; } Position[topEntity] = new CellPositionComponent { x = x, y = y }; CachedEntities[topIndex] = Entity.Null; CachedEntities[currIndex] = topEntity; break; } y += 1; } } }
public void Execute() { var count = ClickedComponents.Length; for (var i = 0; i < count; ++i) { var destroyPos = ClickedComponents[i]; var clickedEntity = CachedEntities[Helper.GetI(destroyPos.x, destroyPos.y)]; if (clickedEntity == Entity.Null) { continue; } var groupSize = 0; if (groupSize < MinGroupSize) { continue; } } }
public void Execute(int index) { var position = Positions[index]; CachedEntities[Helper.GetI(position.x, position.y)] = Entities[index]; }