v0.7.5: fixed casting errors with sparsearray
This commit is contained in:
parent
19a0f25414
commit
f0a44e8578
|
@ -32,10 +32,6 @@ public class SparseArray<T> extends IntMap<T> {
|
|||
return keys().toArray().toArray();
|
||||
}
|
||||
|
||||
public T[] valueArray(){
|
||||
return values().toArray().toArray();
|
||||
}
|
||||
|
||||
public List<T> valueList() {
|
||||
return Arrays.asList(values().toArray().toArray());
|
||||
}
|
||||
|
|
|
@ -772,7 +772,7 @@ public class Dungeon {
|
|||
}
|
||||
|
||||
if (hero.buff(Awareness.class) != null){
|
||||
for (Heap h : level.heaps.valueArray()){
|
||||
for (Heap h : level.heaps.valueList()){
|
||||
BArray.or( level.visited, level.heroFOV, h.pos - 1 - level.width(), 3, level.visited );
|
||||
BArray.or( level.visited, level.heroFOV, h.pos - 1, 3, level.visited );
|
||||
BArray.or( level.visited, level.heroFOV, h.pos - 1 + level.width(), 3, level.visited );
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ImpShopkeeper extends Shopkeeper {
|
|||
|
||||
@Override
|
||||
public void flee() {
|
||||
for (Heap heap: Dungeon.level.heaps.valueArray()) {
|
||||
for (Heap heap: Dungeon.level.heaps.valueList()) {
|
||||
if (heap.type == Heap.Type.FOR_SALE) {
|
||||
CellEmitter.get( heap.pos ).burst( ElmoParticle.FACTORY, 4 );
|
||||
heap.destroy();
|
||||
|
|
|
@ -71,7 +71,7 @@ public class Shopkeeper extends NPC {
|
|||
@Override
|
||||
public void destroy() {
|
||||
super.destroy();
|
||||
for (Heap heap: Dungeon.level.heaps.valueArray()) {
|
||||
for (Heap heap: Dungeon.level.heaps.valueList()) {
|
||||
if (heap.type == Heap.Type.FOR_SALE) {
|
||||
CellEmitter.get( heap.pos ).burst( ElmoParticle.FACTORY, 4 );
|
||||
heap.destroy();
|
||||
|
|
|
@ -273,7 +273,7 @@ public class Bomb extends Item {
|
|||
}
|
||||
|
||||
//look for our bomb, remove it from its heap, and blow it up.
|
||||
for (Heap heap : Dungeon.level.heaps.valueArray()) {
|
||||
for (Heap heap : Dungeon.level.heaps.valueList()) {
|
||||
if (heap.items.contains(bomb)) {
|
||||
|
||||
//FIXME this is a bit hacky, might want to generalize the functionality
|
||||
|
|
|
@ -52,7 +52,7 @@ public class Noisemaker extends Bomb {
|
|||
mob.beckon( cell );
|
||||
}
|
||||
|
||||
for (Heap heap : Dungeon.level.heaps.valueArray()) {
|
||||
for (Heap heap : Dungeon.level.heaps.valueList()) {
|
||||
if (heap.type == Heap.Type.MIMIC) {
|
||||
Mimic m = Mimic.spawnAt( heap.pos, heap.items );
|
||||
if (m != null) {
|
||||
|
|
|
@ -51,7 +51,7 @@ public class ScrollOfRage extends Scroll {
|
|||
}
|
||||
}
|
||||
|
||||
for (Heap heap : Dungeon.level.heaps.valueArray()) {
|
||||
for (Heap heap : Dungeon.level.heaps.valueList()) {
|
||||
if (heap.type == Heap.Type.MIMIC) {
|
||||
Mimic m = Mimic.spawnAt( heap.pos, heap.items );
|
||||
if (m != null) {
|
||||
|
|
|
@ -980,7 +980,7 @@ public abstract class Level implements Bundlable {
|
|||
}
|
||||
|
||||
if (c.buff( Awareness.class ) != null) {
|
||||
for (Heap heap : heaps.valueArray()) {
|
||||
for (Heap heap : heaps.valueList()) {
|
||||
int p = heap.pos;
|
||||
for (int i : PathFinder.NEIGHBOURS9)
|
||||
fieldOfView[p+i] = true;
|
||||
|
@ -1005,7 +1005,7 @@ public abstract class Level implements Bundlable {
|
|||
}
|
||||
|
||||
if (c == Dungeon.hero) {
|
||||
for (Heap heap : heaps.valueArray())
|
||||
for (Heap heap : heaps.valueList())
|
||||
if (!heap.seen && fieldOfView[heap.pos])
|
||||
heap.seen = true;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ public class CellSelector extends PointerArea {
|
|||
}
|
||||
}
|
||||
|
||||
for (Heap heap : Dungeon.level.heaps.valueArray()){
|
||||
for (Heap heap : Dungeon.level.heaps.valueList()){
|
||||
if (heap.sprite != null && heap.sprite.overlapsPoint( p.x, p.y)){
|
||||
select( heap.pos );
|
||||
return;
|
||||
|
|
|
@ -229,7 +229,7 @@ public class GameScene extends PixelScene {
|
|||
heaps = new Group();
|
||||
add( heaps );
|
||||
|
||||
for ( Heap heap : Dungeon.level.heaps.valueArray() ) {
|
||||
for ( Heap heap : Dungeon.level.heaps.valueList() ) {
|
||||
addHeapSprite( heap );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user