refactor, simplify common access names
This commit is contained in:
parent
f277a71087
commit
55a5adcd92
5 changed files with 30 additions and 20 deletions
|
@ -16,8 +16,8 @@ export function sys_render_world(center: Vec2, size: Vec2) {
|
|||
const result = Array.from(range(0, size.y())).map(() => Array.from(range(0, size.x())).map(() => " "));
|
||||
const min = center.sub(radius);
|
||||
const max = center.add(radius).sub(v2(1, 1));
|
||||
for (const [pos, display] of engine.query_all(query_in_rect(min, max).with(CompDisplay))) {
|
||||
const local_pos = pos.position.sub(min);
|
||||
for (const [pos, display] of engine.all(query_in_rect(min, max).with(CompDisplay))) {
|
||||
const local_pos = pos.pos.sub(min);
|
||||
result[local_pos.y()][local_pos.x()] = display.display;
|
||||
}
|
||||
return result.map((line) => line.join("")).toReversed().join("\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue