public static HeroSubClass restoreInBundle( Bundle bundle ) { String value = bundle.getString( SUBCLASS ); try { return valueOf( value ); } catch (Exception e) { return NONE; } }
public static HeroClass restoreInBundle( Bundle bundle ) { String value = bundle.getString( CLASS ); return value.length() > 0 ? valueOf( value ) : WARRIOR; } }
public static HeroClass restoreInBundle( Bundle bundle ) { String value = bundle.getString( CLASS ); return value.length() > 0 ? valueOf( value ) : ROGUE; } }
@Override public void restoreFromBundle(Bundle bundle) { super.restoreFromBundle(bundle); page = bundle.getString( PAGE ); } }
@Override public void restoreFromBundle(Bundle bundle) { super.restoreFromBundle(bundle); page = bundle.getString( PAGE ); } }
public static HeroClass restoreInBundle( Bundle bundle ) { String value = bundle.getString( CLASS ); return value.length() > 0 ? valueOf( value ) : ROGUE; } }
public static HeroSubClass restoreInBundle( Bundle bundle ) { String value = bundle.getString( SUBCLASS ); return valueOf( value ); }
public static HeroSubClass restoreInBundle( Bundle bundle ) { String value = bundle.getString( SUBCLASS ); return valueOf( value ); }
public Class getClass( String key ) { String clName = getString(key).replace("class ", "");; if (clName != null){ if (aliases.containsKey( clName )) { clName = aliases.get( clName ); } try { Class cl = Class.forName( clName ); return cl; } catch (ClassNotFoundException e) { Game.reportException(e); return null; } } return null; }
public Class getClass( String key ) { String clName = getString(key).replace("class ", "");; if (clName != null){ if (aliases.containsKey( clName )) { clName = aliases.get( clName ); } try { Class cl = Class.forName( clName ); return cl; } catch (ClassNotFoundException e) { Game.reportException(e); return null; } } return null; }
@Override public void restoreFromBundle(Bundle bundle) { super.restoreFromBundle(bundle); landmark = Landmark.valueOf(bundle.getString(LANDMARK)); }
@Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); String state = bundle.getString( STATE ); if (state.equals( Sleeping.TAG )) { this.state = SLEEPING; } else if (state.equals( Wandering.TAG )) { this.state = WANDERING; } else if (state.equals( Hunting.TAG )) { this.state = HUNTING; } else if (state.equals( Fleeing.TAG )) { this.state = FLEEING; } else if (state.equals( Passive.TAG )) { this.state = PASSIVE; } enemySeen = bundle.getBoolean( SEEN ); target = bundle.getInt( TARGET ); }
@Override public void restoreFromBundle( Bundle bundle ) { feature = Feature.valueOf( bundle.getString( FEATURE ) ); depth = bundle.getInt( DEPTH ); }
@Override public void restoreFromBundle(Bundle bundle) { super.restoreFromBundle(bundle); landmark = Landmark.valueOf(bundle.getString(LANDMARK)); }
@Override public void restoreFromBundle( Bundle bundle ) { version = bundle.getString( VERSION ); info = bundle.getString( REASON ); win = bundle.getBoolean( WIN ); score = bundle.getInt( SCORE ); level = bundle.getInt( LEVEL ); depth = bundle.getInt( DEPTH ); diff = bundle.getInt( DIFF ); heroClass = HeroClass.restoreInBundle( bundle ); armorTier = bundle.getInt( TIER ); gameFile = bundle.getString( GAME ); }
@SuppressWarnings("unchecked") @Override public void restoreFromBundle( Bundle bundle ) { hp = bundle.getInt( HP ); pos = bundle.getInt( POS ); type = Type.valueOf( bundle.getString( TYPE ) ); items = new LinkedList<Item>( (Collection<? extends Item>)(Object) bundle.getCollection( ITEMS ) ); }
@Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); hitsToKnow = bundle.getInt( UNFAMILIRIARITY ); enchantment = (Enchantment)bundle.get( ENCHANTMENT ); //pre-0.6.5 saves if (bundle.contains( "imbue" )){ String imbue = bundle.getString( "imbue" ); if (imbue.equals( "LIGHT" )) augment = Augment.SPEED; else if (imbue.equals( "HEAVY" )) augment = Augment.DAMAGE; else augment = Augment.NONE; } else { augment = bundle.getEnum(AUGMENT, Augment.class); } }
@Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); hitsToKnow = bundle.getInt( UNFAMILIRIARITY ); enchantment = (Enchantment)bundle.get( ENCHANTMENT ); //pre-0.6.5 saves if (bundle.contains( "imbue" )){ String imbue = bundle.getString( "imbue" ); if (imbue.equals( "LIGHT" )) augment = Augment.SPEED; else if (imbue.equals( "HEAVY" )) augment = Augment.DAMAGE; else augment = Augment.NONE; } else { augment = bundle.getEnum(AUGMENT, Augment.class); } }
@Override public void restoreFromBundle( Bundle bundle ) { left = bundle.getInt( "left" ); top = bundle.getInt( "top" ); right = bundle.getInt( "right" ); bottom = bundle.getInt( "bottom" ); type = Type.valueOf( bundle.getString( "type" ) ); }
@Override public void restoreFromBundle( Bundle bundle ) { if (bundle.contains( CAUSE )) { cause = bundle.getClass( CAUSE ); } else { cause = null; } win = bundle.getBoolean( WIN ); score = bundle.getInt( SCORE ); heroClass = HeroClass.restoreInBundle( bundle ); armorTier = bundle.getInt( TIER ); if (bundle.contains(DATA)) gameData = bundle.getBundle(DATA); if (bundle.contains(ID)) gameID = bundle.getString(ID); if (gameID == null) gameID = UUID.randomUUID().toString(); depth = bundle.getInt( DEPTH ); herolevel = bundle.getInt( LEVEL ); }