⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gamesthread.java

📁 初期JAVA学习非常有用的资料。帮助深入了解API。特别是Applet。
💻 JAVA
字号:
package bingo.game;import bingo.shared.*;class GamesThread extends Thread {    private RingMaster ringMaster;    private boolean moreGames = true;    GamesThread(RingMaster ringMaster) {	super("Bingo GamesThread");	this.ringMaster = ringMaster;    }    public void run() {	long now, startGameAt;	int timeRemaining;	while (moreGames) {	    ringMaster.waitForFirstPlayer();	    now = System.currentTimeMillis();	    startGameAt = now + ringMaster.getGameParameters().getCountDown();	    while (ringMaster.isCountingDown()) {	        timeRemaining = (int)(Math.ceil((double)(startGameAt - now)/Constants.ONE_SECOND));	        ringMaster.sendTimeRemainingMessage(timeRemaining);	        try {	            Thread.currentThread().sleep(Constants.FIVE_SECONDS);	        } catch (InterruptedException e) {	        }	        now = System.currentTimeMillis();	        if (now > startGameAt) { 		    ringMaster.startGame();		}	    }            new BallAnnouncer(ringMaster).start();	    ringMaster.waitForGameToEnd();	}    }    void noMoreGames() {	moreGames = false;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -