當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。