?? mobilegamemidlet.java
字號:
package com.tianxia.qipai;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import com.tianxia.qipai.control.MainControl;
import com.tianxia.qipai.event.*;
public class MobileGameMidlet extends MIDlet {
private MainControl maincontrol;
public MobileGameMidlet() {
super();
maincontrol=MainControl.getInstance();
maincontrol.init(this);
maincontrol.handleEvent(MainGameEvent.MAINGAMESTART,new MainGameEvent());
// TODO 自動生成構造函數存根
}
protected void startApp() throws MIDletStateChangeException {
if(maincontrol!=null){
maincontrol.handleEvent(MainGameEvent.MAINGAMEWAKEN,new MainGameEvent());
}
// TODO 自動生成方法存根
}
protected void pauseApp() {
// TODO 自動生成方法存根
maincontrol.handleEvent(MainGameEvent.MAINGAMEPAUSE,new MainGameEvent());
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO 自動生成方法存根
try {
Thread.sleep(100); //為了給socket連接有足夠的時間發送數據
} catch (InterruptedException e) {
// TODO 自動生成 catch 塊
e.printStackTrace();
}
}
public void gameExit(){
try {
destroyApp(true);
} catch (MIDletStateChangeException e) {
// TODO 自動生成 catch 塊
e.printStackTrace();
}
notifyDestroyed();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -