starshipbattle.java

来自「StarShip Battle 2004 game The Developing」· Java 代码 · 共 64 行

JAVA
64
字号
/**
 * @(#)StarShipBattle.java
 *
 *
 * @author 
 * @version 1.00 2008/7/16
 */

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class StarShipBattle extends MIDlet{
	
	private final String profileVersion = "MIDP-2.0";
	private final String configVersion = "CLDC-1.1";

    public StarShipBattle() {
    	String pv = getAppProperty("MicroEdition-Profile");
    	String cv = getAppProperty("MicroEdition-Configuration");
    	
    	if(((pv.equals(profileVersion)) && (cv.equals(configVersion)))){
    		System.out.println("Version ok...proceed");
    	}else{
    	
    		System.out.println("Version Incorrect. Unable to proceed");
    		//destroyApp(true);
    		//notifyDestroyed();
    		shutDown();
    	}
    }
    
    public void startApp(){
    	System.out.println("In the startApp()...");
    	
    	Display d = Display.getDisplay(this);
    	MainMenu mm = new MainMenu(this,d);
    	SplashScreen ss = new SplashScreen(); 
        LoginForm lf = new LoginForm(d);
        	
    	ss.registerMenu(mm);
    	ss.registerLogin(lf);
    	lf.registerMenu(mm);
    	
    	d.setCurrent(ss);
    	
    	//mm.showMenu();   // SKIP DAMN PASSWORD SCREEN 	
    	//UserOptions pp = new UserOptions(d);
    	//pp.showUserOpt();
    }
    
    public void pauseApp(){
    	System.out.println("In the pauseApp()...");
    }
    
    public void destroyApp(boolean unc){
    	System.out.println("In the destroyApp()...");
    }
    
    public void shutDown(){
    	destroyApp(false);
    	notifyDestroyed();
    }
    
}

⌨️ 快捷键说明

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