public static void dropToChasm( Item item ) { int depth = Dungeon.depth + 1; ArrayList<Item> dropped = (ArrayList<Item>)Dungeon.droppedItems.get( depth ); if (dropped == null) { Dungeon.droppedItems.put( depth, dropped = new ArrayList<Item>() ); } dropped.add( item ); }
public static void dropToChasm( Item item ) { int depth = Dungeon.depth + 1; ArrayList<Item> dropped = (ArrayList<Item>)Dungeon.droppedItems.get( depth ); if (dropped == null) { Dungeon.droppedItems.put( depth, dropped = new ArrayList<Item>() ); } dropped.add(item); }
public static void dropToChasm( Item item ) { int depth = Dungeon.depth + 1; ArrayList<Item> dropped = (ArrayList<Item>)Dungeon.droppedItems.get( depth ); if (dropped == null) { Dungeon.droppedItems.put( depth, dropped = new ArrayList<Item>() ); } dropped.add( item ); }
public static Emitter.Factory factory( final int type, final boolean lightMode ) { Emitter.Factory factory = factories.get( type ); if (factory == null) { factory = new Emitter.Factory() { @Override public void emit ( Emitter emitter, int index, float x, float y ) { Speck p = (Speck)emitter.recycle( Speck.class ); p.reset( index, x, y, type ); } @Override public boolean lightMode() { return lightMode; } }; factories.put( type, factory ); } return factory; } }
public static Emitter.Factory factory( final int type, final boolean lightMode ) { Emitter.Factory factory = factories.get( type ); if (factory == null) { factory = new Emitter.Factory() { @Override public void emit ( Emitter emitter, int index, float x, float y ) { Speck p = (Speck)emitter.recycle( Speck.class ); p.reset( index, x, y, type ); } @Override public boolean lightMode() { return lightMode; } }; factories.put( type, factory ); } return factory; } }
@Override protected void onItemSelected(Item item) { Item result = item.detachAll(curUser.belongings.backpack); int portDepth = 5 * (1 + Dungeon.depth/5); ArrayList<Item> ported = Dungeon.portedItems.get(portDepth); if (ported == null) { Dungeon.portedItems.put(portDepth, ported = new ArrayList<>()); } ported.add(result); }
@Override protected void onItemSelected(Item item) { Item result = item.detachAll(curUser.belongings.backpack); int portDepth = 5 * (1 + Dungeon.depth/5); ArrayList<Item> ported = Dungeon.portedItems.get(portDepth); if (ported == null) { Dungeon.portedItems.put(portDepth, ported = new ArrayList<>()); } ported.add(result); }
private static synchronized void add( Actor actor, float time ) { if (all.contains( actor )) { return; } ids.put( actor.id(), actor ); all.add( actor ); actor.time += time; actor.onAdd(); if (actor instanceof Char) { Char ch = (Char)actor; chars.add( ch ); for (Buff buff : ch.buffs()) { all.add( buff ); buff.onAdd(); } } }
if (stack == null) { stack = new ArrayList<FloatingText>(); stacks.put(key, stack);
private static void push( FloatingText txt, int key ) { txt.key = key; ArrayList<FloatingText> stack = stacks.get( key ); if (stack == null) { stack = new ArrayList<FloatingText>(); stacks.put( key, stack ); } if (stack.size() > 0) { FloatingText below = txt; int aboveIndex = stack.size() - 1; while (aboveIndex >= 0) { FloatingText above = stack.get( aboveIndex ); if (above.y + above.height() > below.y) { above.y = below.y - above.height(); below = above; aboveIndex--; } else { break; } } } stack.add( txt ); } }
private static synchronized void add( Actor actor, float time ) { if (all.contains( actor )) { return; } ids.put( actor.id(), actor ); all.add( actor ); actor.time += time; actor.onAdd(); if (actor instanceof Char) { Char ch = (Char)actor; chars.add( ch ); for (Buff buff : ch.buffs()) { all.add( buff ); buff.onAdd(); } } }
if (stack == null) { stack = new ArrayList<FloatingText>(); stacks.put(key, stack);
public Trap setTrap( Trap trap, int pos ){ Trap existingTrap = traps.get(pos); if (existingTrap != null){ traps.remove( pos ); } trap.set( pos ); traps.put( pos, trap ); GameScene.updateMap( pos ); return trap; }
public Plant plant( Plant.Seed seed, int pos ) { Plant plant = plants.get( pos ); if (plant != null) { plant.wither(); } plant = seed.couch( pos ); plants.put( pos, plant ); GameScene.add(plant); return plant; }
public Trap setTrap( Trap trap, int pos ){ Trap existingTrap = traps.get(pos); if (existingTrap != null){ traps.remove( pos ); } trap.set( pos ); traps.put( pos, trap ); GameScene.updateMap( pos ); return trap; }
public Plant plant( Plant.Seed seed, int pos ) { if (Dungeon.isChallenged(Challenges.NO_HERBALISM)){ return null; } Plant plant = plants.get( pos ); if (plant != null) { plant.wither(); } if (map[pos] == Terrain.HIGH_GRASS || map[pos] == Terrain.FURROWED_GRASS || map[pos] == Terrain.EMPTY || map[pos] == Terrain.EMBERS || map[pos] == Terrain.EMPTY_DECO) { set(pos, Terrain.GRASS, this); GameScene.updateMap(pos); } plant = seed.couch( pos, this ); plants.put( pos, plant ); GameScene.plantSeed( pos ); return plant; }
public Plant plant( Plant.Seed seed, int pos ) { if (Dungeon.isChallenged(Challenges.NO_HERBALISM)){ return null; } Plant plant = plants.get( pos ); if (plant != null) { plant.wither(); } if (map[pos] == Terrain.HIGH_GRASS || map[pos] == Terrain.FURROWED_GRASS || map[pos] == Terrain.EMPTY || map[pos] == Terrain.EMBERS || map[pos] == Terrain.EMPTY_DECO) { set(pos, Terrain.GRASS, this); GameScene.updateMap(pos); } plant = seed.couch( pos, this ); plants.put( pos, plant ); GameScene.plantSeed( pos ); return plant; }
GameScene.discard( heap ); } else { heaps.put( cell, heap ); GameScene.add( heap );
GameScene.discard( heap ); } else { heaps.put( cell, heap ); GameScene.add( heap );
newIcons.put( icon, img );