亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? score.java

?? 名稱:games
?? JAVA
字號:
/* * * Copyright ? 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */package example.pushpuzzle;import javax.microedition.rms.*;/** * Keep track of the last level played. * For each level keep track of the number of moves. * <p> * The scores are kept in a RecordStore named PushPuzzleScores. * There are two types of records: * - Last level * - Level history *   Name of level (either resource name "/..." or...) */class Score {    private static final int LEVEL_LEN = 9;    private static final byte LEVEL_TAG = 1;    private static final int SCORE_LEN = 13;    private static final byte SCORE_TAG = 2;    // Current level record = {byte LEVEL_TAG; int level;}    private int levelId; // The record Id of the level record    private byte[] levelRec; // Byte array holding the level    // Score for level = {byte SCORE_TAG; int level, int pushes; int moves;}    private int scoreId; // The record Id of the current level    private byte[] scoreRec; // scores for the current level.    private RecordStore store; // Record store, null if not open    /*     * Construct a new Score handler.     */    Score() {        store = null;        levelId = 0;        levelRec = new byte[LEVEL_LEN];        levelRec[0] = LEVEL_TAG;        putInt(levelRec, 1, 0);        putInt(levelRec, 5, 0);        scoreId = 0;        scoreRec = new byte[SCORE_LEN];        scoreRec[0] = SCORE_TAG;        putInt(scoreRec, 1, 0);    }    /**     * Open the record store and locate     * the record with the level number in it.     */    boolean open() {        try {            store = RecordStore.openRecordStore("PushPuzzleScores", true);        } catch (RecordStoreException ex) {        }        if (store == null) {            return false;        }        try {            /*             * Locate the record containing the level.             */            levelId = 0;            RecordEnumeration enm = store.enumerateRecords(null, null, false);            while (enm.hasNextElement()) {                int ndx = enm.nextRecordId();                if (store.getRecordSize(ndx) == LEVEL_LEN) {                    int l = store.getRecord(ndx, levelRec, 0);                    if ((l == LEVEL_LEN) && (levelRec[0] == LEVEL_TAG)) {                        levelId = ndx;                        break;                    }                }            }        } catch (RecordStoreException ex) {            ex.printStackTrace();            return false;        }        return true;    }    /**     * Get the current Theme number.     */    int getTheme() {        return getInt(levelRec, 5);    }    /**     * Retrieve the level from the level record.  It should     * have already been read from the store or created.     * The first byte is a tag, the second byte the level.     */    int getLevel() {        return getInt(levelRec, 1);    }    /**     * Set the level and theme into the RecordStore.     * @param level the current level     * @param theme the current theme     */    boolean setLevel(int level, int theme) {        putInt(levelRec, 1, level);        putInt(levelRec, 5, theme);        putInt(scoreRec, 1, level);        if (store == null) {            return false;        }        try {            if (levelId == 0) {                levelId = store.addRecord(levelRec, 0, levelRec.length);            } else {                store.setRecord(levelId, levelRec, 0, levelRec.length);            }        } catch (RecordStoreException ex) {            System.out.println("RecordStoreException");            ex.printStackTrace();            return false;        }        readScore(level); // get the score for the level        return true;    }    /**     * Get the number of pushes on the current level.     */    int getPushes() {        return getInt(scoreRec, 5);    }    /**     * Get the number of moved on the current level.     */    int getMoves() {        return getInt(scoreRec, 9);    }    /**     * Read the score for the current level.     * Read through the records looking for the one for this level.     */    boolean readScore(int level) {        try {            scoreId = 0;            // Locate the matching record            RecordEnumeration enm = store.enumerateRecords(null, null, false);            while (enm.hasNextElement()) {                int ndx = enm.nextRecordId();                if (store.getRecordSize(ndx) == SCORE_LEN) {                    int l = store.getRecord(ndx, scoreRec, 0);                    if ((l == SCORE_LEN) && (scoreRec[0] == SCORE_TAG) &&                            (getInt(scoreRec, 1) == level)) {                        scoreId = ndx;                        return true;                    }                }            }        } catch (RecordStoreException ex) {            ex.printStackTrace();            return false;        }        // No record found, start fresh        scoreRec[0] = SCORE_TAG;        putInt(scoreRec, 1, level);        putInt(scoreRec, 5, 0);        putInt(scoreRec, 9, 0);        return true;    }    /**     * Set the updated score to the RecordStore.     */    boolean setLevelScore(int pushes, int moves) {        // Update the scores in the buffer.        putInt(scoreRec, 5, pushes);        putInt(scoreRec, 9, moves);        try {            // Write/Add the record to the  store            if (scoreId == 0) {                scoreId = store.addRecord(scoreRec, 0, scoreRec.length);            } else {                store.setRecord(scoreId, scoreRec, 0, scoreRec.length);            }        } catch (RecordStoreException ex) {            ex.printStackTrace();            return false;        }        return true;    }    /**     * Get an integer from an array.     */    private int getInt(byte[] buf, int offset) {        return ((buf[offset + 0] & 0xff) << 24) | ((buf[offset + 1] & 0xff) << 16) |        ((buf[offset + 2] & 0xff) << 8) | (buf[offset + 3] & 0xff);    }    /**     * Put an integer to an array     */    private void putInt(byte[] buf, int offset, int value) {        buf[offset + 0] = (byte)((value >> 24) & 0xff);        buf[offset + 1] = (byte)((value >> 16) & 0xff);        buf[offset + 2] = (byte)((value >> 8) & 0xff);        buf[offset + 3] = (byte)((value >> 0) & 0xff);    }    /**     * Close the store.     */    void close() {        try {            if (store != null) {                store.closeRecordStore();            }        } catch (RecordStoreException ex) {            ex.printStackTrace();        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精彩视频一区二区三区| 欧美日韩在线播放| 欧美在线999| 久久久久久久久久电影| 亚洲国产精品久久人人爱蜜臀| 国模少妇一区二区三区| av不卡免费电影| 日韩欧美一区二区三区在线| 国产精品乱码人人做人人爱| 污片在线观看一区二区| 色综合夜色一区| 国产亚洲精品bt天堂精选| 免费欧美在线视频| 欧美日韩国产小视频在线观看| 中文字幕在线不卡国产视频| 国产九色sp调教91| 欧美成人r级一区二区三区| 日韩电影在线免费看| 欧美影视一区二区三区| 18欧美亚洲精品| 99热99精品| 中文字幕日本不卡| 成人教育av在线| 国产精品麻豆网站| 日韩精品一区二区三区在线| 日日嗨av一区二区三区四区| 在线观看不卡一区| 高清不卡一二三区| 欧美成人免费网站| 激情伊人五月天久久综合| 欧美日韩精品二区第二页| 亚洲综合久久久| 欧美三级日韩在线| 亚洲第一精品在线| 欧美巨大另类极品videosbest | 国产乱色国产精品免费视频| 欧美精品日日鲁夜夜添| 亚洲午夜久久久久久久久电影网| 色婷婷综合激情| 亚洲成人免费看| 欧美巨大另类极品videosbest| 香蕉av福利精品导航| 另类欧美日韩国产在线| 欧美精选在线播放| 亚洲五码中文字幕| 欧美欧美欧美欧美| a美女胸又www黄视频久久| 国产清纯美女被跳蛋高潮一区二区久久w| 蜜臀精品一区二区三区在线观看| 欧美一激情一区二区三区| 精品在线亚洲视频| 国产日本欧美一区二区| 色综合网站在线| 婷婷亚洲久悠悠色悠在线播放| 3d成人h动漫网站入口| 国产综合色视频| 国产精品久久久久7777按摩 | 欧美羞羞免费网站| 日本vs亚洲vs韩国一区三区二区| 日韩欧美成人激情| 成人白浆超碰人人人人| 亚洲愉拍自拍另类高清精品| 久久久久久久综合色一本| 波多野结衣一区二区三区| 亚洲国产欧美另类丝袜| 精品久久久网站| 在线视频综合导航| 麻豆精品国产91久久久久久| 亚洲国产精品激情在线观看| 日本道色综合久久| 精品一区二区三区av| 国产一区二区三区久久久| 亚洲人123区| 欧美成人bangbros| 在线观看国产日韩| 粉嫩aⅴ一区二区三区四区五区| 一区精品在线播放| 精品va天堂亚洲国产| 99精品国产一区二区三区不卡| 无吗不卡中文字幕| 亚洲色图视频网站| 久久看人人爽人人| 欧美精品日韩一区| 色欧美88888久久久久久影院| 精品一区二区三区av| 一区二区三区色| 国产欧美日韩综合精品一区二区| 欧美日韩国产bt| 91美女视频网站| 国产精品一区在线| 日本怡春院一区二区| 夜夜夜精品看看| 国产精品亲子乱子伦xxxx裸| 欧美岛国在线观看| 欧美精品日韩精品| 欧洲一区二区三区免费视频| 国产精品1024久久| 国产在线不卡一区| 麻豆国产欧美一区二区三区| 亚洲福利视频三区| 一区二区在线观看免费| 国产精品网站在线播放| 国产亚洲欧洲997久久综合| 日韩亚洲欧美中文三级| 欧美日韩精品一区二区在线播放 | 精品中文字幕一区二区| 丝袜美腿亚洲色图| 性久久久久久久久久久久| 亚洲制服丝袜av| 一区二区三区四区五区视频在线观看| 国产亚洲一二三区| 国产性色一区二区| 国产亚洲欧美日韩俺去了| 精品国产一区二区三区久久影院 | 久久99国产精品免费| 日本视频中文字幕一区二区三区| 亚洲a一区二区| 日韩精品视频网站| 免费成人在线视频观看| 精品一区二区三区久久久| 精品一区二区三区免费播放| 国产一区高清在线| 国产成人在线视频播放| 99这里只有精品| 色婷婷国产精品| 欧美性受xxxx黑人xyx性爽| 欧美日韩精品欧美日韩精品| 欧美美女bb生活片| 亚洲男人的天堂av| 亚洲一区二区四区蜜桃| 日韩精品电影一区亚洲| 久久99国产精品免费| 成人丝袜高跟foot| 一本一道综合狠狠老| 精品视频资源站| 欧美tickling挠脚心丨vk| 久久免费午夜影院| 自拍偷拍亚洲综合| 午夜国产不卡在线观看视频| 激情文学综合插| 粉嫩av一区二区三区| 欧美在线观看视频在线| 日韩小视频在线观看专区| 国产欧美日韩不卡| 一区二区在线观看免费| 韩国精品一区二区| 97se亚洲国产综合自在线观| 欧美日韩一卡二卡| 国产亚洲欧美日韩俺去了| 亚洲国产精品久久不卡毛片 | 91在线高清观看| 91精品黄色片免费大全| 国产精品美女一区二区三区| 亚洲国产一区二区视频| 国产精品77777| 欧美制服丝袜第一页| 久久亚洲欧美国产精品乐播| 一区二区三区四区精品在线视频| 麻豆成人av在线| 色欧美片视频在线观看| 久久精子c满五个校花| 亚洲午夜久久久久中文字幕久| 国产激情一区二区三区桃花岛亚洲| 日本高清视频一区二区| 日韩欧美亚洲国产另类| 一区二区在线观看免费| 国产成人免费视频精品含羞草妖精| 欧美少妇bbb| 综合激情成人伊人| 国产精品一区在线观看你懂的| 欧美日韩免费电影| 亚洲免费在线观看视频| 国产资源在线一区| 欧美日韩成人在线| 亚洲女同ⅹxx女同tv| 国产成人综合在线观看| 欧美电视剧在线看免费| 亚洲成人av一区二区三区| 韩国av一区二区| 日韩欧美你懂的| 亚洲r级在线视频| 91福利小视频| 一区二区三区不卡视频| 成人免费va视频| 久久精品亚洲乱码伦伦中文| 老司机精品视频一区二区三区| 欧美日韩精品免费观看视频| 洋洋成人永久网站入口| 一本色道久久综合亚洲aⅴ蜜桃| 日本一区二区三区国色天香| 国产在线精品免费| 欧美成人精品高清在线播放| 日本午夜一区二区| 欧美一级夜夜爽| 日日噜噜夜夜狠狠视频欧美人| 欧美精品一卡二卡| 亚洲午夜精品17c| 精品国产一区二区三区不卡 | 亚洲综合色丁香婷婷六月图片| 成人激情免费视频|