v0.3.1: heaps are now always visible after being first seen
This commit is contained in:
parent
a1e9b10358
commit
d007988701
|
@ -82,6 +82,7 @@ public class Heap implements Bundlable {
|
|||
public int pos = 0;
|
||||
|
||||
public ItemSprite sprite;
|
||||
public boolean seen = false;
|
||||
|
||||
public LinkedList<Item> items = new LinkedList<Item>();
|
||||
|
||||
|
@ -457,6 +458,7 @@ public class Heap implements Bundlable {
|
|||
}
|
||||
|
||||
private static final String POS = "pos";
|
||||
private static final String SEEN = "seen";
|
||||
private static final String TYPE = "type";
|
||||
private static final String ITEMS = "items";
|
||||
|
||||
|
@ -464,6 +466,7 @@ public class Heap implements Bundlable {
|
|||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
pos = bundle.getInt( POS );
|
||||
seen = bundle.getBoolean( SEEN );
|
||||
type = Type.valueOf( bundle.getString( TYPE ) );
|
||||
items = new LinkedList<Item>( (Collection<Item>) ((Collection<?>) bundle.getCollection( ITEMS )) );
|
||||
items.removeAll(Collections.singleton(null));
|
||||
|
@ -472,6 +475,7 @@ public class Heap implements Bundlable {
|
|||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
bundle.put( POS, pos );
|
||||
bundle.put( SEEN, seen );
|
||||
bundle.put( TYPE, type.toString() );
|
||||
bundle.put( ITEMS, items );
|
||||
}
|
||||
|
|
|
@ -953,6 +953,10 @@ public abstract class Level implements Bundlable {
|
|||
}
|
||||
}
|
||||
|
||||
for (Heap heap : heaps.values())
|
||||
if (!heap.seen && fieldOfView[heap.pos])
|
||||
heap.seen = true;
|
||||
|
||||
return fieldOfView;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user