当前位置: 首页>>代码示例>>Java>>正文


Java Preferences.getBoolean方法代码示例

本文整理汇总了Java中com.badlogic.gdx.Preferences.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java Preferences.getBoolean方法的具体用法?Java Preferences.getBoolean怎么用?Java Preferences.getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.Preferences的用法示例。


在下文中一共展示了Preferences.getBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: applyPrefs

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public void applyPrefs(Preferences prefs) {
    turn = prefs.getInteger("save_turn");
    playersNumber = prefs.getInteger("save_player_number");
    colorNumber = prefs.getInteger("save_color_number");
    if (colorNumber > FieldController.NEUTRAL_LANDS_INDEX) {
        colorNumber = FieldController.NEUTRAL_LANDS_INDEX;
    }
    levelSize = prefs.getInteger("save_level_size");
    difficulty = prefs.getInteger("save_difficulty");
    GameRules.campaignMode = prefs.getBoolean("save_campaign_mode");
    campaignLevelIndex = prefs.getInteger("save_current_level");
    colorOffset = prefs.getInteger("save_color_offset", 0);
    slayRules = prefs.getBoolean("slay_rules", true);
    fogOfWar = prefs.getBoolean("fog_of_war", false);
    diplomacy = prefs.getBoolean("diplomacy", false);
}
 
开发者ID:yiotro,项目名称:Antiyoy,代码行数:17,代码来源:LoadingParameters.java

示例2: loadConfiguration

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public static void loadConfiguration() {
    Preferences prefs = Gdx.app.getPreferences("ss_train_config");
    offset = prefs.getInteger("offset", 0);
    inputOffset = prefs.getInteger("input_offset", 0);
    songVolume = prefs.getInteger("song_vol", 100);
    feedbackVolume = prefs.getInteger("feedback_vol", 100);
    pathToBeatmaps = prefs.getString("path_to_beatmaps", Gdx.files.getExternalStoragePath() + "sstrain");
    playHintSounds = prefs.getBoolean("play_hint_sounds", false);
    noteSpeed = prefs.getInteger("note_speed", 6);
    overallDifficulty = prefs.getInteger("overall_difficulty", 7);
    displayLine = prefs.getBoolean("display_line", true);
    // default to song name sorting
    sortMode = prefs.getInteger("sorting_mode", SongUtils.SORTING_MODE_SONG_NAME);
    // default ascending order
    sortOrder = prefs.getInteger("sorting_order", SongUtils.SORTING_MODE_ASCENDING);
    // sync mode
    syncMode = prefs.getInteger("sync_mode", SongUtils.SYNC_MODE_1);

}
 
开发者ID:kbz,项目名称:SSTrain,代码行数:20,代码来源:GlobalConfiguration.java

示例3: UCIEngineInterface

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
UCIEngineInterface(String PATH) {
	mProcessBuilder = new ProcessBuilder(PATH);
	mService = Executors.newFixedThreadPool(1);
	startEngine();
	mTask = null;

	Preferences pref = Gdx.app.getPreferences(GameCore.TITLE);
	if (pref.getBoolean(PreferenceStrings.DEPTH_SEARCH)) {
		mSearchType = "depth";
		mSearchValue = pref.getInteger(PreferenceStrings.SEARCH_VALUE);
	} else {
		mSearchType = "movetime";
		// seconds to milliseconds
		mSearchValue = pref.getInteger(PreferenceStrings.SEARCH_VALUE) * 1000;
	}
}
 
开发者ID:nkarasch,项目名称:ChessGDX,代码行数:17,代码来源:UCIEngineInterface.java

示例4: loadConfiguration

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public static void loadConfiguration() {
    Preferences prefs = Gdx.app.getPreferences("sif_train_config");
    offset = prefs.getInteger("offset", 0);
    inputOffset = prefs.getInteger("input_offset", 0);
    songVolume = prefs.getInteger("song_vol", 100);
    feedbackVolume = prefs.getInteger("feedback_vol", 100);
    pathToBeatmaps = prefs.getString("path_to_beatmaps", Gdx.files.getExternalStoragePath() + "beatmaps");
    playHintSounds = prefs.getBoolean("play_hint_sounds", false);
    noteSpeed = prefs.getInteger("note_speed", 6);
    overallDifficulty = prefs.getInteger("overall_difficulty", 7);
    // default to song name sorting
    sortMode = prefs.getInteger("sorting_mode", SongUtils.SORTING_MODE_SONG_NAME);
    sortOrder = prefs.getInteger("sorting_order", SongUtils.SORTING_MODE_ASCENDING);
    // default to the new mode
    randomMode = prefs.getInteger("random_mode", SongUtils.RANDOM_MODE_NEW);
    // sync mode
    syncMode = prefs.getInteger("sync_mode", SongUtils.SYNC_MODE_1);

}
 
开发者ID:kbz,项目名称:SIFTrain,代码行数:20,代码来源:GlobalConfiguration.java

示例5: updateApplication

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@Override
public void updateApplication( Preferences pref )
{
	int width = pref.getInteger( "resolutionX" );
	int height = pref.getInteger( "resolutionY" );

	Global.TargetResolution[0] = width;
	Global.TargetResolution[1] = height;
	Global.FPS = pref.getInteger( "fps" );
	Global.AnimationSpeed = 1.0f / pref.getFloat( "animspeed" );

	Global.MovementTypePathfind = pref.getBoolean( "pathfindMovement" );
	Global.MusicVolume = pref.getFloat( "musicVolume" );
	Global.AmbientVolume = pref.getFloat( "ambientVolume" );
	Global.EffectVolume = pref.getFloat( "effectVolume" );
	Global.updateVolume();
}
 
开发者ID:infinity8,项目名称:Roguelike,代码行数:18,代码来源:AndroidApplicationChanger.java

示例6: GameManager

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public GameManager() {
	isPlayerAlive = false;
	topScore = 0;
	currentScore = 0;
	//load top score, etc
	Preferences prefs = Gdx.app.getPreferences(GameSaves);
	topScore = prefs.getInteger("topscore");
	isSoundOn = prefs.getBoolean("sound_on", true);
	totalGamesPlayed = prefs.getInteger("total_games_played", 0);
	totalScoreSum = prefs.getInteger("total_score_sum", 0);
	
	// add all needed assets to queue
	assetManager.load("fonts/arial64.fnt", BitmapFont.class);
	assetManager.load("atlases/game.atlas", TextureAtlas.class);
	assetManager.load("atlases/widgets.atlas", TextureAtlas.class);
	assetManager.load("sounds/coin.wav", Sound.class);
	assetManager.load("sounds/move.wav", Sound.class);
	assetManager.load("sounds/die.wav", Sound.class);
	assetManager.load("sounds/intro.ogg", Music.class);
}
 
开发者ID:igorcrevar,项目名称:GoingUnder,代码行数:21,代码来源:GameManager.java

示例7: StatusScreen

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public StatusScreen(CaramelosGame game, boolean victory,int level)
{
    this.game = game;
    this.victory = victory;
    this.level = level;

    Preferences prefs = Gdx.app.getPreferences("My Preferences");
    flagSound = prefs.getBoolean("sound");
    if(victory)
        mp3Music = Gdx.audio.newMusic(Gdx.files.internal("Music/Victory.mp3"));
    else{
        mp3Music = Gdx.audio.newMusic(Gdx.files.internal("Music/GameOver.mp3"));
    }
    mp3Music.setLooping(true);
    if(flagSound){
        mp3Music.play();
    }

    FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("Vollkorn/Vollkorn-Regular.ttf"));
    FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
    parameter.size = 24;
    font12 = generator.generateFont(parameter); // font size 12 pixels
    generator.dispose(); // don't forget to dispose to avoid memory leaks!

    FileHandle baseFileHandle = Gdx.files.internal("Messages/menus");
    String localeLanguage =java.util.Locale.getDefault().toString();
    Locale locale = new Locale(localeLanguage);
    I18NBundle myBundle = I18NBundle.createBundle(baseFileHandle, locale,"UTF-8");
    menulevel = myBundle.get("menulevel");
    menuvictory = myBundle.get("menuvictory");
    menuchampion = myBundle.get("menuchampion");
    menucontinue = myBundle.get("menucontinue");
    menugameover = myBundle.get("menugameover");
}
 
开发者ID:luarca84,项目名称:Caramelos,代码行数:35,代码来源:StatusScreen.java

示例8: checkToImportOldProgress

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
private void checkToImportOldProgress(Preferences preferences) {
    boolean imported_old_progress;
    imported_old_progress = preferences.getBoolean("imported_old_progress", false);
    if (imported_old_progress) return;

    importOldProgress();
    preferences.putBoolean("imported_old_progress", true);
}
 
开发者ID:yiotro,项目名称:Antiyoy,代码行数:9,代码来源:CampaignProgressManager.java

示例9: load

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public void load() {
    Preferences preferences = Gdx.app.getPreferences(key);

    campaignMode = preferences.getBoolean("campaign");
    numberOfHumans = preferences.getInteger("players");
    date = preferences.getString("date", "-");
    levelIndex = preferences.getInteger("level_index", -1);
}
 
开发者ID:yiotro,项目名称:Antiyoy,代码行数:9,代码来源:RepSlot.java

示例10: loadFromPreferences

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public void loadFromPreferences(String prefsKey) {
    Preferences preferences = Gdx.app.getPreferences(prefsKey);

    initialLevelString = preferences.getString("initial");
    tempSlayRules = preferences.getBoolean("slay_rules");
    tempColorOffset = preferences.getInteger("color_offset", 0);
    realNumberOfHumans = preferences.getInteger("real_human_number", 0);

    stringActions = preferences.getString("actions");
}
 
开发者ID:yiotro,项目名称:Antiyoy,代码行数:11,代码来源:Replay.java

示例11: loadLanguage

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public static void loadLanguage() {
    Preferences preferences = Gdx.app.getPreferences(prefs);

    autoDetect = preferences.getBoolean("auto", true);

    if (!autoDetect) {
        langName = preferences.getString("lang_name");
        LanguagesManager.getInstance().setLanguage(langName);
    }
}
 
开发者ID:yiotro,项目名称:Antiyoy,代码行数:11,代码来源:CustomLanguageLoader.java

示例12: checkToImportOldSaves

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
private void checkToImportOldSaves() {
    Preferences preferences = getPreferences(SAVE_SLOT_PREFS);
    boolean importedOldSaves = preferences.getBoolean("imported_old_saves", false);
    if (importedOldSaves) return;

    preferences.putBoolean("imported_old_saves", true);
    preferences.flush();

    performImportOldSaves();
}
 
开发者ID:yiotro,项目名称:Antiyoy,代码行数:11,代码来源:SaveSystem.java

示例13: getNameString

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public static String getNameString(Preferences slotPrefs) {
    String multiMode = "";
    if (slotPrefs.getInteger("save_player_number") > 1) {
        multiMode = " [" + slotPrefs.getInteger("save_player_number") + "x]";
    }

    if (slotPrefs.getBoolean("save_campaign_mode")) {
        return LanguagesManager.getInstance().getString("choose_game_mode_campaign") + " " + slotPrefs.getInteger("save_current_level");
    } else {
        return LanguagesManager.getInstance().getString("choose_game_mode_skirmish") + multiMode;
    }
}
 
开发者ID:yiotro,项目名称:Antiyoy,代码行数:13,代码来源:SaveSystem.java

示例14: readSound

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
void readSound()
{
	Preferences prefs = Gdx.app.getPreferences("My Preferences");
	sound=prefs.getBoolean("sound",true);
	
	prefs.flush();
}
 
开发者ID:yassir-ouali,项目名称:Freaking-Math,代码行数:8,代码来源:MyGame.java

示例15: DicePreferences

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public DicePreferences(Preferences preferences, App app) {
    this.preferences = preferences;
    this.app = app;
    volume = preferences.getFloat("volume", 0.5f);
    language = preferences.getString("language", Locale.getDefault().getLanguage());
    scale = preferences.getInteger("scale", (int) ScreenHelper.scaleFor(Gdx.graphics.getWidth(), Gdx.app.getType() == Application.ApplicationType.Desktop));
    rated = preferences.getBoolean("rated");
    music = preferences.getBoolean("music", true);
    servicesPaneShownByDefault = preferences.getBoolean("services-pane", false);
    applyVolume();
    applyMusic();
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:13,代码来源:DicePreferences.java


注:本文中的com.badlogic.gdx.Preferences.getBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。