Java Code Examples for com.watabou.utils.Bundle#getBoolean()

The following examples show how to use com.watabou.utils.Bundle#getBoolean() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Ghost.java    From remixed-dungeon with GNU General Public License v3.0 6 votes vote down vote up
public static void restoreFromBundle( Bundle bundle ) {
	
	Bundle node = bundle.getBundle( NODE );
	
	if (!node.isNull() && (spawned = node.getBoolean( SPAWNED ))) {
		
		alternative	=  node.getBoolean( ALTERNATIVE );
		if (!alternative) {
			left2kill = node.getInt( LEFT2KILL );
		}
		
		given	= node.getBoolean( GIVEN );
		depth	= node.getInt( DEPTH );
		processed	= node.getBoolean( PROCESSED );
		
		weapon	= (Item)node.get( WEAPON );
		armor	= (Item)node.get( ARMOR );
	} else {
		reset();
	}
}
 
Example 2
Source File: Ghost.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 6 votes vote down vote up
public static void restoreFromBundle( Bundle bundle ) {
	
	Bundle node = bundle.getBundle( NODE );

	if (!node.isNull() && (spawned = node.getBoolean( SPAWNED ))) {

		type = node.getInt(TYPE);
		given	= node.getBoolean( GIVEN );
		processed = node.getBoolean( PROCESSED );

		depth	= node.getInt( DEPTH );
		
		weapon	= (Weapon)node.get( WEAPON );
		armor	= (Armor)node.get( ARMOR );
	} else {
		reset();
	}
}
 
Example 3
Source File: Rankings.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 6 votes vote down vote up
@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 );
}
 
Example 4
Source File: Mob.java    From shattered-pixel-dungeon with GNU General Public License v3.0 6 votes vote down vote up
@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 );

	if (bundle.contains(MAX_LVL)) maxLvl = bundle.getInt(MAX_LVL);
}
 
Example 5
Source File: Necromancer.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void restoreFromBundle(Bundle bundle) {
	super.restoreFromBundle(bundle);
	summoning = bundle.getBoolean( SUMMONING );
	if (bundle.contains(FIRST_SUMMON)) firstSummon = bundle.getBoolean(FIRST_SUMMON);
	if (summoning){
		summoningPos = bundle.getInt( SUMMONING_POS );
	}
	if (bundle.contains( MY_SKELETON )){
		storedSkeletonID = bundle.getInt( MY_SKELETON );
	}
}
 
Example 6
Source File: Statistics.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public static void restoreFromBundle( Bundle bundle ) {
	goldCollected	= bundle.getInt( GOLD );
	deepestFloor	= bundle.getInt( DEEPEST );
	enemiesSlain	= bundle.getInt( SLAIN );
	foodEaten		= bundle.getInt( FOOD );
	potionsCooked	= bundle.getInt( ALCHEMY );
	piranhasKilled	= bundle.getInt( PIRANHAS );
	nightHunt		= bundle.getInt( NIGHT );
	ankhsUsed		= bundle.getInt( ANKHS );
	duration		= bundle.getFloat( DURATION );
	amuletObtained	= bundle.getBoolean( AMULET );

	qualifiedForNoKilling  = bundle.getBoolean(QUALIFIED_FOR_NO_KILLING);
	completedWithNoKilling = bundle.getBoolean(COMPLETED_WITH_NO_KILLING);
}
 
Example 7
Source File: QuickSlot.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 5 votes vote down vote up
public static void restore( Bundle bundle, Item item ) {
	if (bundle.getBoolean( QUICKSLOT1 )) {
           quickslotValue_1 = item;
	}
       if (bundle.getBoolean( QUICKSLOT2 )) {
           quickslotValue_2 = item;
       }
       if (bundle.getBoolean( QUICKSLOT3 )) {
           quickslotValue_3 = item;
       }
}
 
Example 8
Source File: CityBossLevel.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	arenaDoor = bundle.getInt( DOOR );
	enteredArena = bundle.getBoolean( ENTERED );
	keyDropped = bundle.getBoolean( DROPPED );
}
 
Example 9
Source File: Blacksmith.java    From pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public static void restoreFromBundle( Bundle bundle ) {

			Bundle node = bundle.getBundle( NODE );
			
			if (!node.isNull() && (spawned = node.getBoolean( SPAWNED ))) {
				alternative	=  node.getBoolean( ALTERNATIVE );
				given = node.getBoolean( GIVEN );
				completed = node.getBoolean( COMPLETED );
				reforged = node.getBoolean( REFORGED );
			} else {
				reset();
			}
		}
 
Example 10
Source File: CavesBossLevel.java    From pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	arenaDoor = bundle.getInt( DOOR );
	enteredArena = bundle.getBoolean( ENTERED );
	keyDropped = bundle.getBoolean( DROPPED );
}
 
Example 11
Source File: Wand.java    From pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	if ((usagesToKnow = bundle.getInt( UNFAMILIRIARITY )) == 0) {
		usagesToKnow = USAGES_TO_KNOW;
	}
	maxCharges = bundle.getInt( MAX_CHARGES );
	curCharges = bundle.getInt( CUR_CHARGES );
	curChargeKnown = bundle.getBoolean( CUR_CHARGE_KNOWN );
}
 
Example 12
Source File: PrisonBossLevel.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	roomExit = (Room)bundle.get( ARENA );
	arenaDoor = bundle.getInt( DOOR );
	enteredArena = bundle.getBoolean( ENTERED );
	keyDropped = bundle.getBoolean( DROPPED );
}
 
Example 13
Source File: HallsBossLevel.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	stairs = bundle.getInt( STAIRS );
	enteredArena = bundle.getBoolean( ENTERED );
	keyDropped = bundle.getBoolean( DROPPED );
}
 
Example 14
Source File: Rankings.java    From pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void restoreFromBundle( Bundle bundle ) {
	
	info	= bundle.getString( REASON );
	win		= bundle.getBoolean( WIN );
	score	= bundle.getInt( SCORE );
	
	heroClass	= HeroClass.restoreInBundle( bundle );
	armorTier	= bundle.getInt( TIER );
	
	gameFile	= bundle.getString( GAME );
}
 
Example 15
Source File: AlchemistsToolkit.java    From shattered-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void restoreFromBundle(Bundle bundle) {
	super.restoreFromBundle(bundle);
	alchemyReady = bundle.getBoolean(READY);
}
 
Example 16
Source File: Pickaxe.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	
	bloodStained = bundle.getBoolean( BLOODSTAINED );
}
 
Example 17
Source File: King.java    From pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void restoreFromBundle( Bundle bundle ) {
	super.restoreFromBundle( bundle );
	nextPedestal = bundle.getBoolean( PEDESTAL );
}
 
Example 18
Source File: Yog.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void restoreFromBundle( Bundle bundle ) {
    super.restoreFromBundle(bundle);
    warned = bundle.getBoolean( WARNED );
}
 
Example 19
Source File: RangedWeaponFlintlock.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void restoreFromBundle( Bundle bundle ) {
    super.restoreFromBundle( bundle );
    loaded = bundle.getBoolean( LOADED );
}
 
Example 20
Source File: Guard.java    From shattered-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void restoreFromBundle(Bundle bundle) {
	super.restoreFromBundle(bundle);
	chainsUsed = bundle.getBoolean(CHAINSUSED);
}