⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gamebean.java

📁 struts框架的jsf组件的核心实用例子集合
💻 JAVA
字号:
package com.corejsf;public class GameBean {   private BattleGround own;   private BattleGround opponent;   public GameBean() { initialize(); }   // PROPERTY: own   public BattleGround getOwn() { return own; }      public void setOwn(BattleGround newValue) { own = newValue; }   // PROPERTY: opponent   public BattleGround getOpponent() { return opponent; }   public void setOpponent(BattleGround newValue) { opponent = newValue; }   public String initialize() {      own = new BattleGround();      own.setRows(10);      own.setColumns(10);      own.initialize();      opponent = new BattleGround();      opponent.setRows(10);      opponent.setColumns(10);      opponent.initializeRandomly();      return "setup";   }   public String move() {      opponent.fire();      if (opponent.isGameOver()) return "win";      own.makeRandomMove();      if (own.isGameOver()) return "lose";      return "turn";   }}

⌨️ 快捷键说明

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