• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java Rankings类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.watabou.pixeldungeon.Rankings的典型用法代码示例。如果您正苦于以下问题:Java Rankings类的具体用法?Java Rankings怎么用?Java Rankings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

Rankings类属于com.watabou.pixeldungeon包,在下文中一共展示了Rankings类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: Record

点赞 2

import com.watabou.pixeldungeon.Rankings; //导入依赖的package包/类
public Record( int pos, boolean latest, Rankings.Record rec ) {
	super();
	
	this.rec = rec;
	
	if (latest) {
		flare = new Flare( 6, 24 );
		flare.angularSpeed = 90;
		flare.color( rec.win ? FLARE_WIN : FLARE_LOSE );
		addToBack( flare );
	}
	
	position.text( Integer.toString( pos+1 ) );
	position.measure();

	Gdx.app.log("DEBUG","rec.info  = "+rec.info );
	desc.text( rec.info );
	desc.measure();
	
	if (rec.win) {
		shield.view( ItemSpriteSheet.AMULET, null );
		position.hardlight( TEXT_WIN );
		desc.hardlight( TEXT_WIN );
	} else {
		position.hardlight( TEXT_LOSE );
		desc.hardlight( TEXT_LOSE );
	}
	
	classIcon.copy( Icons.get( rec.heroClass ) );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:31,
代码来源:RankingsScene.java

示例2: Record

点赞 2

import com.watabou.pixeldungeon.Rankings; //导入依赖的package包/类
public Record( int pos, boolean latest, Rankings.Record rec ) {
	super();
	
	this.rec = rec;
	
	if (latest) {
		flare = new Flare( 6, 24 );
		flare.angularSpeed = 90;
		flare.color( rec.win ? FLARE_WIN : FLARE_LOSE );
		addToBack( flare );
	}
	
	position.text( Integer.toString( pos+1 ) );
	position.measure();
	
	desc.text( rec.info );
	desc.measure();
	
	if (rec.win) {
		shield.view( ItemSpriteSheet.AMULET, null );
		position.hardlight( TEXT_WIN );
		desc.hardlight( TEXT_WIN );
	} else {
		position.hardlight( TEXT_LOSE );
		desc.hardlight( TEXT_LOSE );
	}
	
	classIcon.copy( Icons.get( rec.heroClass ) );
}
 

开发者ID:HalcyonFish,
项目名称:OHSCompSciClubPixelDungeon,
代码行数:30,
代码来源:RankingsScene.java

示例3: Record

点赞 2

import com.watabou.pixeldungeon.Rankings; //导入依赖的package包/类
public Record(int pos, boolean latest, Rankings.Record rec) {
    super();

    this.rec = rec;

    if (latest) {
        flare = new Flare(6, 24);
        flare.angularSpeed = 90;
        flare.color(rec.win ? FLARE_WIN : FLARE_LOSE);
        addToBack(flare);
    }

    position.text(Integer.toString(pos + 1));
    position.measure();

    desc.text(rec.info);
    desc.measure();

    if (rec.win) {
        shield.view(ItemSpriteSheet.AMULET, null);
        position.hardlight(TEXT_WIN);
        desc.hardlight(TEXT_WIN);
    } else {
        position.hardlight(TEXT_LOSE);
        desc.hardlight(TEXT_LOSE);
    }

    classIcon.copy(Icons.get(rec.heroClass));
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:30,
代码来源:RankingsScene.java

示例4: backupProgress

点赞 2

import com.watabou.pixeldungeon.Rankings; //导入依赖的package包/类
public void backupProgress(final IResult resultCallback) {
	if (!isConnected()) {
		resultCallback.status(false);
		return;
	}

	Game.instance().executor.execute(new Runnable() {
		@Override
		public void run() {
			boolean res = packFilesToSnapshot(PlayGames.PROGRESS, FileSystem.getInternalStorageFile(""), new FileFilter() {
				@Override
				public boolean accept(File pathname) {
					String filename = pathname.getName();
					if (filename.equals(Badges.BADGES_FILE)) {
						return true;
					}

					if (filename.equals(Library.getLibraryFile())) {
						return true;
					}

					if (filename.equals(Rankings.RANKINGS_FILE)) {
						return true;
					}

					if (filename.startsWith("game_") && filename.endsWith(".dat")) {
						return true;
					}
					return false;
				}
			});
			resultCallback.status(res);
		}
	});
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:36,
代码来源:PlayGames.java

示例5: Record

点赞 2

import com.watabou.pixeldungeon.Rankings; //导入依赖的package包/类
public Record(int pos, boolean latest, Rankings.Record rec) {
    super();

    this.rec = rec;

    if (latest) {
        flare = new Flare(6, 24);
        flare.angularSpeed = 90;
        flare.color(rec.win ? FLARE_WIN : FLARE_LOSE);
        addToBack(flare);
    }

    position.text(Integer.toString(pos + 1));
    position.measure();

    desc.text(rec.mod + ": " + rec.info);
    desc.measure();

    if (rec.win) {
        shield.view(Assets.ITEMS, ItemSpriteSheet.AMULET, null);
        position.hardlight(TEXT_WIN);
        desc.hardlight(TEXT_WIN);
    } else {
        position.hardlight(TEXT_LOSE);
        desc.hardlight(TEXT_LOSE);
    }

    classIcon.copy(Icons.get(rec.heroClass));
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:30,
代码来源:RankingsScene.java

示例6: WndResurrect

点赞 2

import com.watabou.pixeldungeon.Rankings; //导入依赖的package包/类
public WndResurrect( final Ankh ankh, Object causeOfDeath ) {
	
	super();
	
	instance = this;
	WndResurrect.causeOfDeath = causeOfDeath;
	
	IconTitle titlebar = new IconTitle();
	titlebar.icon( new ItemSprite( ankh.image(), null ) );
	titlebar.label( ankh.name() );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	BitmapTextMultiline message = PixelScene.createMultiline( TXT_MESSAGE, 6 );
	message.maxWidth = WIDTH;
	message.measure();
	message.y = titlebar.bottom() + GAP;
	add( message );
	
	RedButton btnYes = new RedButton( TXT_YES ) {
		@Override
		protected void onClick() {
			hide();
			
			Statistics.ankhsUsed++;
			
			InterlevelScene.mode = InterlevelScene.Mode.RESURRECT;
			Game.switchScene( InterlevelScene.class );
		}
	};
	btnYes.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
	add( btnYes );
	
	RedButton btnNo = new RedButton( TXT_NO ) {
		@Override
		protected void onClick() {
			hide();
			
			Rankings.INSTANCE.submit( false );
			Hero.reallyDie( WndResurrect.causeOfDeath );
		}
	};
	btnNo.setRect( 0, btnYes.bottom() + GAP, WIDTH, BTN_HEIGHT );
	add( btnNo );
	
	resize( WIDTH, (int)btnNo.bottom() );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:48,
代码来源:WndResurrect.java

示例7: actAscend

点赞 2

import com.watabou.pixeldungeon.Rankings; //导入依赖的package包/类
private boolean actAscend(HeroAction.Ascend action) {
	refreshPets();

	int stairs = action.dst;
	if (getPos() == stairs && getPos() == Dungeon.level.entrance) {

		Position nextLevel = DungeonGenerator.ascend(Dungeon.currentPosition());

		if (nextLevel.levelId.equals("0")) {

			if (belongings.getItem(Amulet.class) == null) {
				GameScene.show(new WndMessage(TXT_LEAVE));
				ready();
			} else {
				Dungeon.win(ResultDescriptions.WIN, Rankings.gameOver.WIN_HAPPY);

				Dungeon.gameOver();

				Game.switchScene(SurfaceScene.class);
			}

		} else {

			clearActions();

			Hunger hunger = buff(Hunger.class);
			if (hunger != null && !hunger.isStarving() && !Dungeon.level.isSafe()) {
				hunger.satisfy(-Hunger.STARVING / 10);
			}

			InterlevelScene.mode = InterlevelScene.Mode.ASCEND;
			Game.switchScene(InterlevelScene.class);
		}

		return false;

	} else if (getCloser(stairs)) {

		return true;

	} else {
		ready();
		return false;
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:46,
代码来源:Hero.java

示例8: create

点赞 2

import com.watabou.pixeldungeon.Rankings; //导入依赖的package包/类
@Override
public void create() {
	super.create();
	
	Text text = null;
	if (!noText) {
		text = createMultiline( TXT, GuiProperties.regularFontSize() );
		text.maxWidth(WIDTH);
		text.measure();
		add( text );
	}
	
	amulet = new Image( Assets.AMULET );
	add( amulet );
	
	RedButton btnExit = new RedButton( TXT_EXIT ) {
		@Override
		protected void onClick() {
			Dungeon.win( ResultDescriptions.WIN, Rankings.gameOver.WIN_AMULET );
			Dungeon.gameOver();
			Game.switchScene( noText ? TitleScene.class : RankingsScene.class );
		}
	};
	btnExit.setSize( WIDTH, BTN_HEIGHT );
	add( btnExit );
	
	RedButton btnStay = new RedButton( TXT_STAY ) {
		@Override
		protected void onClick() {
			onBackPressed();
		}
	};
	btnStay.setSize( WIDTH, BTN_HEIGHT );
	add( btnStay );
	
	float height;
	if (noText) {
		height = amulet.height + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();
		
		amulet.x = align( (Camera.main.width - amulet.width) / 2 );
		amulet.y = align( (Camera.main.height - height) / 2 );
		
		btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, amulet.y + amulet.height + LARGE_GAP );
		btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
		
	} else {
		height = amulet.height + LARGE_GAP + text.height() + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();
		
		amulet.x = align( (Camera.main.width - amulet.width) / 2 );
		amulet.y = align( (Camera.main.height - height) / 2 );
		
		text.x =  align( (Camera.main.width - text.width()) / 2 );
		text.y = amulet.y + amulet.height + LARGE_GAP;
		
		btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.y + text.height() + LARGE_GAP );
		btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
	}

	new Flare( 8, 48 ).color( 0xFFDDBB, true ).show( amulet, 0 ).angularSpeed = +30;
	
	fadeIn();
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:63,
代码来源:AmuletScene.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)