当前位置: 首页 > news >正文

日本网站制作公司seod的中文意思

日本网站制作公司,seod的中文意思,seo工作前景如何,哪里做网站最好网站摘要:这是一款基于GitHub项目修改的中国象棋Android应用,主要功能包括悔棋、重开局、AI等级设置和先手选择等。项目采用Android Studio开发,compileSdkVersion为33,支持Android 5.0(API 24)及以上系统。应用采用SoundPool实现音效…

摘要:这是一款基于GitHub项目修改的中国象棋Android应用,主要功能包括悔棋、重开局、AI等级设置和先手选择等。项目采用Android Studio开发,compileSdkVersion为33,支持Android 5.0(API 24)及以上系统。应用采用SoundPool实现音效播放,SharedPreferences保存游戏配置和进度,并实现了完整的象棋逻辑和UI交互。主要功能模块包括游戏主界面(MainActivity)、棋盘视图(GameBoardView)和游戏逻辑(GameLogic)等,支持加载上次游戏进度,提供多种棋子样式选择。

1、效果展示

    基于github项目修改

2、功能支持悔棋、重开、设置等级、优先出棋等

a.工程build代码情况

   模块build

compileSdk 33defaultConfig {applicationId "com.hzy.chinese.jchess"minSdk 24targetSdk 32versionCode 5versionName "1.0.4"testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"}

工程build文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.plugins {id 'com.android.application' version '7.2.2' apply falseid 'com.android.library' version '7.2.2' apply falseid 'io.github.wurensen.android-aspectjx' version '3.3.2' apply false
}task clean(type: Delete) {delete rootProject.buildDir
}

b.chess主页面代码:

package com.hzy.chinese.jchess.activity;import android.content.Intent;
import android.content.SharedPreferences;
import android.media.AudioManager;
import android.media.SoundPool;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.Toast;import androidx.appcompat.app.AppCompatActivity;import com.hzy.chinese.jchess.R;
import com.hzy.chinese.jchess.game.GameConfig;
import com.hzy.chinese.jchess.game.GameLogic;
import com.hzy.chinese.jchess.game.IGameCallback;
import com.hzy.chinese.jchess.view.GameBoardView;import java.util.LinkedList;import butterknife.BindView;
import butterknife.ButterKnife;public class MainActivity extends AppCompatActivityimplements IGameCallback {@BindView(R.id.game_board)GameBoardView mGameBoard;@BindView(R.id.game_progress)ProgressBar mGameProgress;private SoundPool mSoundPool;private LinkedList<Integer> mSoundList;private GameLogic mGameLogic;private SharedPreferences mPreference;private boolean mSoundEnable;private int mHandicapIndex;private boolean mComputerFlip;private int mPieceStyle;private int mAILevel;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_chess);ButterKnife.bind(this);mPreference = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());loadDefaultConfig();initSoundPool();initGameLogic();}@Overridepublic boolean onCreateOptionsMenu(Menu menu) {getMenuInflater().inflate(R.menu.menu_main_activity, menu);return super.onCreateOptionsMenu(menu);}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {switch (item.getItemId()) {case R.id.main_menu_exit:// 退出finish();break;case R.id.main_menu_retract:// 悔棋mGameLogic.retract();break;case R.id.main_menu_restart:// 重开mGameLogic.restart(mComputerFlip, mHandicapIndex);showMessage(getString(R.string.new_game_started));break;case R.id.main_menu_settings:// 设置startActivity(new Intent(this, SettingsActivity.class));break;}return super.onOptionsItemSelected(item);}@Overrideprotected void onResume() {super.onResume();loadDefaultConfig();mGameLogic.setLevel(mAILevel);mGameBoard.setPieceTheme(mPieceStyle);mGameBoard.invalidate();}@Overrideprotected void onDestroy() {if (mSoundPool != null) {mSoundPool.release();}mPreference.edit().putString(GameConfig.PREF_LAST_FEN, mGameLogic.getCurrentFen()).apply();super.onDestroy();}private void loadDefaultConfig() {// 音效开启状态 默认 开启 true 关闭 falsemSoundEnable = mPreference.getBoolean(getString(R.string.pref_sound_key), true);// 先走让子 0 1 2 3mHandicapIndex = Integer.parseInt(mPreference.getString(getString(R.string.pref_handicap_key), "0"));// 电脑先走 false  true 则先走mComputerFlip = mPreference.getBoolean(getString(R.string.pref_who_first_key), false);// 棋子样式 0 1mPieceStyle = Integer.parseInt(mPreference.getString(getString(R.string.pref_piece_style_key), "0"));// 电脑棋力 0 1 2 3 4mAILevel = Integer.parseInt(mPreference.getString(getString(R.string.pref_level_key), "0"));}private void initSoundPool() {mSoundList = new LinkedList<>();int poolSize = GameConfig.SOUND_RES_ARRAY.length;if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {mSoundPool = new SoundPool.Builder().setMaxStreams(poolSize).build();} else {mSoundPool = new SoundPool(poolSize, AudioManager.STREAM_MUSIC, 0);}for (int res : GameConfig.SOUND_RES_ARRAY) {mSoundList.add(mSoundPool.load(this, res, 1));}}private void initGameLogic() {mGameLogic = mGameBoard.getGameLogic();mGameLogic.setCallback(this);mGameLogic.setLevel(mAILevel);mGameBoard.setPieceTheme(mPieceStyle);// load last saved gameString lastFen = mPreference.getString(GameConfig.PREF_LAST_FEN, "");if (lastFen.isEmpty()) {mGameLogic.restart(mComputerFlip, mHandicapIndex);} else {showMessage(getString(R.string.load_last_game_finish));mGameLogic.restart(mComputerFlip, lastFen);}}@Overridepublic void postPlaySound(final int soundIndex) {if (mSoundPool != null && mSoundEnable) {int soundId = mSoundList.get(soundIndex);mSoundPool.play(soundId, 1, 1, 0, 0, 1);}}@Overridepublic void postShowMessage(final String message) {runOnUiThread(() -> showMessage(message));}private void showMessage(String message) {Toast.makeText(this, ""+message, Toast.LENGTH_LONG).show();}@Overridepublic void postShowMessage(int messageId) {postShowMessage(getString(messageId));}@Overridepublic void postStartThink() {runOnUiThread(() -> mGameProgress.setVisibility(View.VISIBLE));}@Overridepublic void postEndThink() {runOnUiThread(() -> mGameProgress.setVisibility(View.GONE));}
}

3、源码获取

https://download.csdn.net/download/shi450561200/91070234?spm=1001.2014.3001.5501

http://www.hkea.cn/news/238106/

相关文章:

  • 企业网站优化之如何做需求分析网奇seo赚钱培训
  • 施工企业会计制度收入确认规定百度自然排名优化
  • 校园网站建设意义网络营销的特点有哪些
  • 内江做网站哪里便宜google搜索关键词热度
  • 福建省建设银行招聘网站网络推广员压力大吗
  • 动态网站订单怎么做搜索引擎优化营销
  • html5行业网站最近有哪些新闻
  • 做网站业务的怎么寻找客户在哪里打广告效果最好
  • 广东深圳seo服务内容
  • 做网站怎么备案网络服务有限公司
  • 网站主页特效欣赏百度官网下载电脑版
  • php mysql开发网站开发任何小说都能搜到的软件
  • the7 wordpress主题宁波seo外包费用
  • 云南建筑培训网seo刷点击软件
  • 男女做暖网站h5页面制作平台
  • 可以做puzzle的网站百度关键词排名提升工具
  • 竞网网站建设南宁网站seo大概多少钱
  • 114黄页信息网宝鸡seo培训
  • 东南亚做棋牌网站挖掘爱站网
  • 中国工程建设招标网官方网站谷歌查询关键词的工具叫什么
  • wordpress管理员密码忘记成都seo招聘
  • 武汉企业建站系统模板下载官方正版百度
  • 上海做网站国际财经新闻
  • 用废旧盒子做家用物品网站seo排名工具
  • 企业铭做网站域名解析在线查询
  • 怎么注册自己的小程序网站优化分析
  • 荆州网站建设流程网站设计培训
  • 网站支付怎么做的seo职业技能培训班
  • 做csgo直播网站上海知名网站制作公司
  • 深圳住建局官方网站seo网站关键词优化快速官网