v0.3.0e: refactored the new findChars() function and re-added a collection of chars to Actor. Better readability and (trivially) better performance.

This commit is contained in:
Evan Debenham
2015-06-17 10:57:01 -04:00
committed by Evan Debenham
parent c55e38a86a
commit 2aee4fe3c6
4 changed files with 19 additions and 21 deletions
@@ -717,12 +717,9 @@ public class Dungeon {
System.arraycopy( pass, 0, passable, 0, Level.LENGTH );
}
for (Actor actor : Actor.all()) {
if (actor instanceof Char) {
int pos = ((Char)actor).pos;
if (visible[pos]) {
passable[pos] = false;
}
for (Char c : Actor.chars()) {
if (visible[c.pos]) {
passable[c.pos] = false;
}
}
@@ -738,12 +735,9 @@ public class Dungeon {
System.arraycopy( pass, 0, passable, 0, Level.LENGTH );
}
for (Actor actor : Actor.all()) {
if (actor instanceof Char) {
int pos = ((Char)actor).pos;
if (visible[pos]) {
passable[pos] = false;
}
for (Char c : Actor.chars()) {
if (visible[c.pos]) {
passable[c.pos] = false;
}
}
passable[cur] = true;