freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

基于android的中國象棋畢業(yè)設計-資料下載頁

2025-06-28 00:27本頁面
  

【正文】 findViewById()。 helpBtn=(Button)findViewById()。 final builder = new (this)。 (new OnClickListener(){ public void onClick(View v){ Intent intent = new Intent()。//構造信使,用于不同界面之間的跳轉 (, )。 (intent)。 } })。 // 點擊退出按鈕,提示是否退出 是:返回歡迎界面 否:繼續(xù)游戲 (new OnClickListener() { public void onClick(View v) { ()。 AlertDialog alert = (, new () { public void onClick(DialogInterface arg0,int arg1) {} }).setPositiveButton(, new () { public void onClick(DialogInterface arg0,int arg1) { finish()。 } }).create()。 ()。 } })。 (new OnClickListener() { public void onClick(View v) { AlertDialog alert =(規(guī)則:每次紅方棋子先走\n將或帥\n移動范圍:它只能在王宮內移動... ...) .setPositiveButton(確定, new (){ public void onClick(DialogInterface dialog, int which) { } }).show()。 ()。 } })。 }}Chess01Activity類(初始化游戲界面類):public class Chess01Activity extends Activity { public static final String DEVICE_NAME = device_name。 public static final String TOAST = toast。 public static boolean side=false。 // 用來選擇紅方棋子還是黑方棋子,false代表黑方 public static int returnID。 public static boolean myFlag = true。 private RadioGroup select = null。 private RadioButton red = null。 private RadioButton black = null。 public static int subWidth=0。 public static int subHeight=0。 public static int fullWidth=0。 public static int fullHeight=0。 public static int realHeight=0。 public void onCreate(Bundle savedInstanceState) {//重寫的onCreate (savedInstanceState)。 ()。 //全屏 requestWindowFeature()。 getWindow().setFlags( , )。 setContentView()。 select=(RadioGroup)findViewById()。 red=(RadioButton)findViewById()。 black=(RadioButton)findViewById()。 (new (){ public void onCheckedChanged(RadioGroup group, int checkedId) { if(()){ side = true。 } if(()){ side = false。 } } })。 DisplayMetrics dm=new DisplayMetrics()。//獲取屏幕 長寬 getWindowManager().getDefaultDisplay().getMetrics(dm)。 fullWidth=。 fullHeight=。 subWidth=。 subHeight=fullHeight/10。 //鋪滿的參數(shù)值 realHeight=fullHeight。 //鋪滿的參數(shù)值 } public void initGameView(){//初始化游戲界面 (new GameView(this,this))。 //切換到游戲界面 myFlag=true。 =false。 =true。 } public void onStart() { ()。 } public synchronized void onResume() { ()。 } public synchronized void onPause() { ()。 } public void onStop() { ()。 } public void onDestroy() { myFlag = false。 side = false。 =true。 =false。 ()。 } public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater()。 (, menu)。 return true。 } public boolean onOptionsItemSelected(MenuItem item) { switch (()) { case : initGameView()。 } return false。 }}ChessMove類(棋子的走法類):public class ChessMove { int ChessID。//表明是什么棋子 int fromX。//起始的坐標 int fromY。 int toX。//目的地的坐標 int toY。 int score。//值,估值時會用到 public ChessMove(int ChessID, int fromX,int fromY,int toX,int toY,int score){//構造器 = ChessID。//棋子的類型 = fromX。//棋子的起始坐標 = fromY。 = toX。//棋子的目標點x坐標 = toY。//棋子的目標點y坐標 = score。 }}GameView類(棋盤棋子繪制類):public class GameViewextern extends SurfaceView implements { private static final Context Activity = null。 private TutorialThread thread。//刷幀的線程 MyThread myThread。 static int width。 static int height。 static int fullWidth。 static int fullHeight。 static int realHeight。 static int offsetHeight。 static int befX。 static int befY。 static int curX。 static int curY。 static boolean flagBack=false。 Chess01Activity activity。//聲明Activity的引用 Bitmap qipan。//棋盤 Paint paint。//畫筆 static boolean who = true。//who=true時,輪到黑方;who=false,輪到紅方 static boolean focus = false。//當前是否有選中的棋子 static int selectqizi = 0。 //當然選中的棋子 static int startI, startJ。//記錄當前棋子的開始位置 static int endI, endJ。//記錄當前棋子的目標位置 Bitmap[] heiZi = new Bitmap[7]。//黑子的圖片數(shù)組 Bitmap[] hongZi = new Bitmap[7]。//紅子的圖片數(shù)組 Bitmap back。 Bitmap pnull。 Bitmap back2。 static Rule guiZe。//規(guī)則類 int status = 0。//游戲狀態(tài)。0游戲中,1勝利, 2失敗 private Canvas canvas。 static int[][] qizi 。 public GameView(Context context,Chess01Activity activity) {//構造器 super(context)。 = activity。//得到Activity的引用 width=。 height=。 fullWidth=。 fullHeight=。 realHeight=。 offsetHeight=fullHeightrealHeight。 getHolder().addCallback(this)。 = new TutorialThread(getHolder(), this)。//初始化刷幀線程 init()。//初始化所需資源 guiZe = new Rule()。//初始化規(guī)則類 myThread = new MyThread()。 ()。 } public void init(){//初始化方法 paint = new Paint()。//初始化畫筆 qipan = (getResources(), )。//棋盤圖片 back = (getResources(), )。//背景 pnull = (getResources(), )。 back2=(getResources(), )。 heiZi[0] = (getResources(), )。//黑帥 heiZi[1] = (getResources(), )。//黑車 heiZi[2] = (getResources(), )。//黑馬 heiZi[3] = (getResources(), )。//黑炮 heiZi[4] = (getResources(), )。//黑士 heiZi[5] = (getResources(), )。//黑象 heiZi[6] = (getResources(), )。//黑兵 hongZi[0] = (getResources(), )。//紅將 hongZi[1] = (getResources(), )。//紅車 hongZi[2] = (getResources(), )。//紅馬 hongZi[3] = (getResources(), )。//紅砲 hongZi[4] = (getResources(), )。//紅仕 hongZi[5] = (getResources(), )。//紅相 hongZi[6] = (getResources(), )。//紅卒 if(==false){ qizi= new int[][]{//棋盤 {2,3,6,5,1,5,6,3,2}, //side==false {0,0,0,0,0,0,0,0,0}, {0,4,0,0,0,0,0,4,0}, {7,0,7,0,7,0,7,0,7}, {0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0}, //如選擇黑方,則黑棋子顯示在棋盤下方 {14,0,14,0,14,0,14,0,14}, {0,11
點擊復制文檔內容
環(huán)評公示相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1