資源簡介
mcv模式練習,以創(chuàng)建游戲角色為案例,有選擇菜單,按菜單進行選擇,代碼按照mvc模式分塊
代碼片段和文件信息
package?com.isoft.game.control;
import?com.isoft.game.entry.basePerson;
import?com.isoft.game.entry.Master;
import?com.isoft.game.entry.Warrior;
import?com.isoft.game.service.CreatePerson;
import?com.isoft.game.view.ReadPrint;
public?class?Controller?{
private?ReadPrint?rp;
private?int?select;
private?basePerson?player;
public?Controller()?{
rp=new?ReadPrint();
}
public?void?start()?{
exit:
while(true)?{
//輸出菜單
rp.print(“\n********歡迎來到王者榮耀********\n“);
rp.print(“0-退出游戲,?1-創(chuàng)建人物“);
rp.print(“請選擇:“);
select=rp.getInt();
switch?(select)?{
?case?0:
rp.print(“期待你的再次挑戰(zhàn)!“);
break?exit;
?????????????case?1:
???????????? ?rp.print(“請做出人物選擇:\n“);
?rp.print(“1-戰(zhàn)士,2-法師,3-射手,4-刺客,5-敬請期待~“);
?rp.print(“請選擇:“);
?i
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-05-18?23:48??gameInterfaces\
?????文件?????????232??2018-05-18?23:56??gameInterfaces\.classpath
?????文件?????????383??2018-05-12?13:21??gameInterfaces\.project
?????目錄???????????0??2018-05-18?23:48??gameInterfaces\.settings\
?????文件?????????598??2018-05-12?13:21??gameInterfaces\.settings\org.eclipse.jdt.core.prefs
?????目錄???????????0??2018-07-23?14:50??gameInterfaces\bin\
?????目錄???????????0??2018-07-23?14:50??gameInterfaces\bin\com\
?????目錄???????????0??2018-07-23?14:50??gameInterfaces\bin\com\isoft\
?????目錄???????????0??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\
?????目錄???????????0??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\control\
?????文件????????1674??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\control\Controller.class
?????文件????????1241??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\control\MapController.class
?????目錄???????????0??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\enter\
?????文件?????????476??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\enter\Enter.class
?????目錄???????????0??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\entry\
?????文件????????1807??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\entry\ba
?????文件????????1394??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\entry\Master.class
?????文件????????1274??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\entry\Shooter.class
?????文件????????1280??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\entry\Warrior.class
?????目錄???????????0??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\interfaces\
?????文件?????????201??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\interfaces\ba
?????目錄???????????0??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\service\
?????文件?????????836??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\service\CreatePerson.class
?????文件????????1858??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\service\Map1.class
?????文件????????1622??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\service\Map2.class
?????目錄???????????0??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\view\
?????文件????????1210??2018-07-23?14:50??gameInterfaces\bin\com\isoft\game\view\ReadPrint.class
?????目錄???????????0??2018-05-18?23:48??gameInterfaces\src\
?????目錄???????????0??2018-05-18?23:48??gameInterfaces\src\com\
?????目錄???????????0??2018-05-18?23:48??gameInterfaces\src\com\isoft\
?????目錄???????????0??2018-05-18?23:48??gameInterfaces\src\com\isoft\game\
............此處省略18個文件信息
評論
共有 條評論