mirror of
				https://github.com/Ukendio/jecs.git
				synced 2025-11-03 18:39:19 +00:00 
			
		
		
		
	Update query.md - formatting
	
		
			
	
		
	
	
		
	
		
			Some checks are pending
		
		
	
	
	
				
					
				
			
		
			Some checks are pending
		
		
	
	
This commit is contained in:
		
							parent
							
								
									0606bf70f0
								
							
						
					
					
						commit
						998b1d3528
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -13,6 +13,8 @@ function Query:cached(): Query -- Returns the cached Query
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
Example:
 | 
					Example:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					::: code-group
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```luau [luau]
 | 
					```luau [luau]
 | 
				
			||||||
local lerps = world:query(Lerp):cached() -- Ensure that you cache this outside a system so you do not create a new cache for a query every frame
 | 
					local lerps = world:query(Lerp):cached() -- Ensure that you cache this outside a system so you do not create a new cache for a query every frame
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,6 +33,9 @@ function system(dt) {
 | 
				
			||||||
		// Do something
 | 
							// Do something
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					:::
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## with
 | 
					## with
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -142,4 +147,4 @@ local iterator = query:iter()
 | 
				
			||||||
for entity, position, velocity in iterator do
 | 
					for entity, position, velocity in iterator do
 | 
				
			||||||
    -- Process entity
 | 
					    -- Process entity
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue