-
team.vicilization.controller包
- MainWindow类
- State类
- GameStart类
- ButtonListener内部类
- Setting类
- ButtonListener内部类
- RadioButtonListener内部类
- MainGame类
- ComboxItemListener内部类
- GameButtonsListener内部类
- UpperInfoArea内部类
- LowerInfoArea内部类
- MapArea内部类
- MapPanel内部类
- MapMouseEventListener内部类
- MapPanel内部类
- Gameover类
- ButtonListener内部类
- GameStart类
- StateType枚举类
-
team.vicilization.gamemap包
- GameMap类
- LandSquare类
- TerrainType枚举类
- LandformType枚举类
- ResourceType枚举类
- GameMapConfig类
-
team.vicilization.gameitem包
- team.vicilization.gameitem.building包
- Building类
- BuildingInfo类
- BuildingType枚举类
- team.vicilization.gameitem.unit包
- Unit类
- Folk类
- Explorer类
- Constructor类
- Fighter类
- Spearman类
- Knight类
- Footman类
- Archer类
- Assasin类
- SwordsMan类
- Folk类
- UnitInfo类
- UnitType枚举类
- UnitSubType枚举类
- Movable接口
- Updateable接口
- Unit类
- team.vicilization.gameitem.city包
- City类
- CityName枚举类
- Fightable接口
- GameItemConfig类
- team.vicilization.gameitem.building包
-
team.vicilization.country包
- Country类
- CountryFlowValue类
- CountryStockValue类
- CountryName枚举类
- CountryConfig类
-
team.vicilization.mechanics包
- team.vicilization.mechanics.giant包
- Giant类
- GiantConfig类
- GiantType枚举类
- GiantName枚举类
- team.vicilization.mechanics.leader包
- Leader类
- LeaderName枚举类
- team.vicilization.mechanics.science包
- ScienceConfig类
- ScienceName枚举类
- team.vicilization.mechanics.trader包
- Trader类
- team.vicilization.mechanics.giant包
-
team.vicilization.util包
- Position类
- Property类
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
State | currentState | 当前状态 |
JPanel | currentPanel | 当前窗口 |
- 方法
函数原型 | 效果 |
---|---|
void main() | 游戏的主入口 |
void convertToNextState(CountryName[] countryName) | 转入下一个阶段 |
void convertToNextState(Country country) | 转入下一个阶段 |
void convertToNextState() | 转入下一个阶段 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
State | nextState | 下一个阶段 |
JPanel | panel | 这一状态用于显示的Panel |
MainWindow | mainWindow | 主窗口 |
- 方法
函数原型 | 效果 |
---|---|
JPanel getPanel() | 获取绘图面板 |
StateType getNextState() | 获取下一状态 |
void setNextState(StateType nextState) | 设定当前状态 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
JButton | startGameButton | 开始游戏的按钮 |
JPanel | backGroundPanel | 背景图片面板 |
JLabel | backGroundLabel | 显示背景图片的label |
- 方法
函数原型 | 效果 |
---|---|
void setBackgournd() | 设置背景 |
void addStartGameButton() | 添加开始游戏按钮 |
- 方法
函数原型 | 效果 |
---|---|
void actionPerformed(ActionEvent event) | 按下按钮后进入下一个状态 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
JButton | confirmButton | 确认按钮 |
Vector<JRadioButton> | chooseCountryButton_1 | 玩家选择国家的按钮 |
Vector<JRadioButton> | chooseCountryButton_2 | |
ButtonGroup | chooseCountryButtonGroup_1 | 两个玩家的选择按钮的button group |
ButtonGroup | chooseCountryButtonGroup_2 | |
JLabel | chooseLeaderLabel | 提示框 |
CountryName[] | selectedCountryNames | 两个玩家选择的国家 |
- 方法
函数原型 | 效果 |
---|---|
void addLabels() | 以下都是添加各种组件 |
void addButtons() | |
void addConfirmButton() | |
void addChooseCountryButtons() |
- 方法
函数原型 | 效果 |
---|---|
void actionPerformed(ActionEvent event) | 按下按钮后进入下一个状态 |
- 方法
函数原型 | 效果 |
---|---|
void actionPerformed(ActionEvent event) | 获取玩家选择的国家 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
int | round | 回合数 |
MapArea | mapArea | 游戏地图区域 |
UpperInfoArea | upperInfoArea | 上方信息区域 |
LowerInfoArea | lowerInfoArea | 下方信息区域 |
Vector<Country> | countries | 所有的国家 |
Country | currentPlayer | 当前玩家 |
Country | enermy | 敌方国家 |
Vector<City> | cities | 所有城市 |
Vector<Unit> | units | 所有单位 |
JButton | nextRoundButton | 下回合 |
JButton | unitUpgradeButton | 单位升级 |
JButton | unitMoveButton | 单位移动 |
JButton | unitFightButton | 单位战斗 |
JButton | explorerBuildCityButton | 建造城市 |
JButton | constructorHarvestButton | 收获 |
JComboBox<BuildingType> | availableBuildings | 可建造的城市 |
JComboBox<UnitSubType> | availableUnits | 可建造的单位 |
boolean | unitSeleted | 单位是否被选中 |
boolean | unitMoving | 单位是否移动 |
boolean | unitAttacking | 单位是否攻击 |
Unit | selectedUnit | 被选中的单位 |
boolean | citySelected | 城市是否被选中 |
City | selectedCity | 被选中的城市 |
boolean | startGame[] | 玩家是否开始了游戏 |
UnitSubType | underProducingUnit | 正在建造的单位 |
BuildingType | underProducingBuilding | 正在建造的建筑 |
ImageIcon | attackButtonIcon | 各种图片,下同 |
ImageIcon | harvestButtonIcon | |
ImageIcon | moveButtonIcon | |
ImageIcon | buildCityButtonIcon | |
ImageIcon | upgradeButtonIcon | |
ImageIcon | nextRoundButtonIcon | |
Vector<GiantName> | scientists | 所剩的大科 |
Vector<GiantName> | economists | 所剩的大商 |
Vector<GiantName> | engineers | 所剩的大工 |
- 方法
函数原型 | 效果 |
---|---|
void nextRound() | 下回合 |
void initIcons() | 初始化icon |
void initParams() | 初始化各项参数 |
void initGiants() | 初始化伟人 |
void initCountries(CountryName[] countrys) | 初始化国家 |
void initUnitsForOneCountry(Country country, int order) | 初始化一个国家的单位 |
void initComboxes() | 初始化combox |
void initButtons() | 初始化按钮 |
void initUpperInfoArea() | 初始化上方信息区域 |
void initLowerInfoArea() | 初始化下方信息区域 |
void initMapArea() | 初始化地图区域 |
void synchronizeCitiesAndUnits() | 更新城市与单位列表 |
boolean judgeVictory() | 判定胜利 |
void selectUnit(Unit unit) | 选中单位 |
void unselectUnit() | 取消选中单位 |
void prepareAttack() | 单位准备攻击 |
void unprepareAttack() | 单位取消准备攻击 |
void buildCity() | 建立城市 |
void selectCity(City city) | 选中城市 |
void unselectCity() | 取消选中城市 |
void showSelectProduce() | 显示选择生产的combox |
void unshowSelectProduce() | 不显示选择生产的combox |
void harvest() | 收获资源 |
void transView() | 移动视角 |
void fight(Fightable fighter, Fightable fought) | fighter攻击fought |
void fight(Fightable fighter, City city) | fighter攻击city |
void checkGiant() | 检查是否可以招募伟人 |
void showRecruitGiantDialog(GiantName name) () | 展示伟人对话框 |
void recruiteGiant() | 招募伟人 |
void getAllowedBuildings() | 建造页面显示可以建造的建筑 |
void getAllowedUnits() | 建造页面显示可以建造的单位 |
void clearAllowedBuildings() | 清除可以建造的建筑 |
void clearAllowedUnits() | 清除可以建造的单位 |
void selectProduction(BuildingType type) | 选择建造建筑 |
void selectProduction(UnitSubType type) | 选择建造单位 |
void drawAccesseble() | 绘制单位可以到达的格子 |
Vector<LandSquare> calculateAttackSquares() | 计算单位可以攻击的格子 |
void unitUpgrade | 单位升级 |
void drawAttackRange(Vector<LandSquare> squares) | 绘制可以攻击的格子 |
- 方法
函数原型 | 效果 |
---|---|
void itemStateChanged(ItemEvent event) | 获取选择建造的东西 |
- 方法
函数原型 | 效果 |
---|---|
void actionPerformed(ActionEvent event) | 处理玩家的按键点击事件 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
JLabel | sciencePointInfo | 科技点信息 |
JLabel | moneyInfo | 钱的信息 |
JLabel | roundInfo | 回合数 |
JLabel | sciencePointSymbolLabel | 科技点标志 |
JLabel | moneySymbolLabel | 钱标志 |
JLabel | roundSymbolLabel | 回合数标志 |
JLabel | countryName_1 | 玩家1国家名 |
JLabel | countryName_2 | 玩家2国家名 |
ImageIcon | scienceIcon | 科技图标 |
ImageIcon | moneyIcon | 钱图标 |
JLabel | scienceNameLabel | 科技名 |
JLabel | scienceProgressLabel | 科技进度 |
ImageIcon | scientistIcon | 各种图标,下同 |
ImageIcon | economistIcon | |
ImageIcon | engineerIcon | |
JLabel | scientistLabel | 大科 |
JLabel | economistLabel | 大商 |
JLabel | engineerLabel | 大工 |
JLabel | scientistNameLabel | 大科名字 |
JLabel | economistNameLabel | 大商名字 |
JLabel | engineerNameLabel | 大工名字 |
JLabel | scientistProgressLabel | 大科进度 |
JLabel | economistProgressLabel | 大商进度 |
JLabel | engineerProgressLabel | 大工进度 |
- 方法
函数原型 | 效果 |
---|---|
void update() | 更新信息 |
void initLabels() | 初始化label |
void initIcons() | 初始化icon |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
JLabel | unitTypeInfo | 单位信息 |
JLabel | healthInfo | 血量 |
JLabel | attackInfo | 攻击 |
JLabel | defenceInfo | 防御 |
JLabel | movabilityOrPopulationInfo | 移动力或人口 |
JLabel | healthLabel | 血量标志 |
JLabel | attackLabel | 攻击标志 |
JLabel | defenceLabel | 防御标志 |
JLabel | movabilityOrPopulationLabel | 移动力或人口标志 |
ImageIcon | healthIcon | 各种图标,下同 |
ImageIcon | attackIcon | |
ImageIcon | defenceIcon | |
ImageIcon | movabilityIcon | |
JLabel | cityNameInfo | 城市名 |
JLabel | cityFoodInfo | 城市食物 |
JLabel | cityProductivityInfo | 生产力 |
JLabel | cityMoneyInfo | 钱 |
JLabel | cityScienceInfo | 科技值 |
JLabel | cityFoodLabel | 食物标志 |
JLabel | cityProductivityLabel | 生产力标志 |
JLabel | cityMoneyLabel | 钱标志 |
JLabel | cityScienceLabel | 科技标志 |
ImageIcon | foodIcon | 各种图标,下同 |
ImageIcon | producticityIcon | |
ImageIcon | moneyIcon | |
ImageIcon | scienceIcon | |
JLabel | producingLabel | 生产标志 |
JLabel | producingItemLabel | 正在生产的东西 |
JLabel | progressLabel | 生产进度 |
ImageIcon | populationIcon | 人口图标 |
ImageIcon | productionIcon | 成产图标 |
- 方法
函数原型 | 效果 |
---|---|
void showUnitInfo(Unit unit) | 显示单位信息 |
void unshowUnitInfo() | 不显示单位信息 |
void updateUnitInfo() | 更新单位信息 |
void showCityInfo(City city) | 显示城市信息 |
void updateCityInfo() | 更新城市信息 |
void unshowCityInfo() | 不显示城市信息 |
void initIcons() | 初始化icon |
void initLabels() | 初始化label |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
MapPanel | mapPanel | 地图面板 |
- 方法
函数原型 | 效果 |
---|---|
void addUnitInMap(Unit unit, Position position) | 在地图中添加单位 |
LandSquare at(int x, int y) | 获取地块 |
LandSquare at(Position position) | 获取地块 |
void drawAccessableSquares(Vector<LandSquare> squares) | 绘制可以到达的区域 |
void drawCityTerritory() | 绘制城市领地 |
void drawAttackSquares(Vector<LandSquare> squares) | 绘制可以攻击的区域 |
void transViewTo(Position position) | 转移视角 |
GameMap getMap() | 获取地图 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
GameMap | map | 游戏地图 |
ImageIcon | hill_desert_icon | 各种icon,下同 |
ImageIcon | hill_frozenground_icon | |
ImageIcon | hills_forest_icon | |
ImageIcon | hills_grasslands_icon | |
ImageIcon | hills_rainforest_icon | |
ImageIcon | lake_icon | |
ImageIcon | plain_desert_icon | |
ImageIcon | plain_forest_icon | |
ImageIcon | plain_frozenground_icon | |
ImageIcon | plain_grasslands_icon | |
ImageIcon | plain_marsh_icon | |
ImageIcon | plain_rainforest_icon | |
ImageIcon | ridge_icon | |
ImageIcon | river_col_icon | |
ImageIcon | river_ne_icon | |
ImageIcon | river_nw_icon | |
ImageIcon | river_row_icon | |
ImageIcon | river_se_icon | |
ImageIcon | river_sw_icon | |
ImageIcon | constructor_icon | |
ImageIcon | explorer_icon | |
ImageIcon | footman_icon | |
ImageIcon | archer_icon | |
ImageIcon | knight_icon | |
ImageIcon | scout_icon | |
ImageIcon | spearman_icon | |
ImageIcon | swordsman_icon | |
ImageIcon | cityIcon | |
Vector<LandSquare> | accessableSquares | 可进入的格子 |
Vector<LandSquare> | attackSquares | 可攻击的格子 |
- 方法
函数原型 | 效果 |
---|---|
void initIcons | 初始化icon |
void initSquares() | 初始化地块 |
void drawAccessableSquares(Vector<LandSquare> squares) | 绘制可进入的区域 |
void drawTerritory() | 绘制城市领土 |
void drawAttackSquares(Vector<LandSquare> squares) | 绘制可攻击区域 |
void drawMapWithoutUnits() | 绘制没有单位的地图 |
void updateMap() | 更新地图 |
void addUnit(Unit unit, Position position) | 添加单位 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
boolean | moving | 是否移动 |
int | xinit | 初始x |
int | yinit | 初始y |
int | xcur | 当前x |
int | ycur | 当前y |
- 方法
函数原型 | 效果 |
---|---|
void mouseClicked(MouseEvent event) | 处理玩家的按键点击事件 |
void mouseEntered(MouseEvent event) | 鼠标进入事件 |
void mouseExited(MouseEvent event) | 鼠标离开事件 |
void mousePressed(MouseEvent event) | 鼠标按下事件 |
void mouseReleased(MouseEvent event) | 鼠标松开事件 |
void mouseDragged(MouseEvent event) | 鼠标拖拽事件 |
void mouseMoved(MouseEvent event) | 鼠标移动事件 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
JButton | restartButton | 重新开始 |
JLabel | victoryLabel | 胜利标志 |
- 方法
函数原型 | 效果 |
---|---|
void addRestartButton() | 添加按钮 |
void addVictoryLabel(CountryName name) | 添加胜利标志 |
- 方法
函数原型 | 效果 |
---|---|
void actionPerformed(ActionEvent event) | 处理玩家的按键点击事件 |
- 枚举值
GameStart, Setting, MainGame, Gameover
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
Vector<Vector<LandSquare>> | landSquares | 所有的地块 |
Vector<Vector<TerrainType>> | terrainMap | 地形图 |
Vector<Vector<LandformType>> | landformMap | 地貌 |
Vector<Vector<ResourceType>> | resourceMap | 资源 |
Vector<Vector<Double>> | temperatureMap | 温度分布 |
Vector<Vector<Double>> | moistureMap | 湿度分布 |
- 方法
函数原型 | 效果 |
---|---|
LandSquare getSquare(int x, int y) | 返回对应的单元块 |
LandSquare getSquare(Position position) | 返回对应的单元块 |
boolean isLegalPosition(int x, int y) | 判定是否合法 |
boolean isLegalPosition(Position position) | 判定是否合法 |
void initTemperature() | 初始化温度分布 |
void initMoisture() | 初始化湿度分布 |
void initTerrain_PLAIN_HILL() | 初始化地形 |
void initLandform() | 初始化地貌 |
void initResource() | 初始化资源 |
void clearForTerr(int x, int y, TerrainType terr) | 清除地貌 |
void applyRidge(int serial, int x, int y) | 添加山脉 |
void applyRiver(int serial, int x, int y) | 添加河流 |
void initTerrain_RIDGE_RIVER_LAKE() | 初始化地貌、山脉、河流、湖 |
void initLandSquare() | 初始化地块 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
TerrainType | terrainType | 地形类型 |
LandformType | landformType | 地貌类型 |
Resource | recource | 资源 |
Position | position | 位置 |
boolean | isMarked | 是否被标记(选中城市、单位移动) |
int | mobilityCost | 移动力消耗 |
int | defenceBuff | 防御力加成 |
int | productivityYield | 生产力产出 |
int | foodYield | 食物产出 |
int | moneyYield | 金币产出 |
int | scienceYield | 科技产出 |
- 方法
函数原型 | 效果 |
---|---|
void initLandSquare(Position pos) | 根据所在地理位置初始化地形、地貌、资源 |
ResourceType exploit() | 开发资源,资源消失,同时改变这一地块的产出 |
void harvested() | 开采地貌,同时改变这一地块的产出 |
void mark() | 标记这一地块 |
void unmark() | 取消标记 |
void calculateAll() | 计算所有属性 |
void calMobilityCost() | 计算单元格的移动消耗 |
void calDefenceBuff() | 计算单元格的防御加成 |
void calFoodYield() | 计算单元格的食物产出 |
void calMoneyYield() | 计算单元格的金币产出 |
void calProductivityYield() | 计算单元格的生产力产出 |
void calScienceYield() | 计算单元格的科技产出 |
- 地形
- 枚举值
PLAIN, HILL, RIDGE, LAKE, RIVER_ROW, RIVER_COL, RIVER_NE, RIVER_NW, RIVER_SE, RIVER_SW;
- 地貌
- 枚举值
NONE, FOREST, RAINFOREST, FROZENGROUND, DESERT, MARSH
- 资源类型
- 枚举值
HORSE, IRON, STONE, COPPER......
- 存放这个包中的各个常数
类型 | 成员变量名 | 备注 |
---|---|---|
HashMap<TerrainType, int> | TERRAIN_MOBILITY_COST | 地形对应移动力消耗 |
HashMap<TerrainType, int> | TERRAIN_DEFENCE_BUFF | 地形对应防御力加成 |
HashMap<TerrainType, int> | TERRAIN_PRODUCTIVITY | 地形对应产能 |
HashMap<TerrainType, int> | TERRAIN_MONEY | 地形对应钱 |
HashMap<TerrainType, int> | TERRAIN_FOOD | 地形对应食物 |
HashMap<TerrainType, int> | TERRAIN_SCIENCE | 地形对应科技,下面类似,不写了 |
HashMap<LandformType, int> | LANDFORM_MOBILITY_COST | |
HashMap<LandformType, int> | LANDFORM_DEFENCE_BUFF | |
HashMap<LandformType, int> | LANDFORM_PRODUCTIVITY | |
HashMap<LandformType, int> | LANDFORM_MONEY | |
HashMap<LandformType, int> | LANDFORM_FOOD | |
HashMap<LandformType, int> | LANDFORM_SCIENCE | |
HashMap<ResourceType, int> | RESOURCE_MOVIBILITY_COST | |
HashMap<ResourceType, int> | RESOURCE_DEFENCE_BUFF | |
HashMap<ResourceType, int> | RESOURCE_PRODUCTIVITY | |
HashMap<ResourceType, int> | RESOURCE_MONEY | |
HashMap<ResourceType, int> | RESOURCE_FOOD | |
HashMap<ResourceType, int> | RESOURCE_SCIENCE | |
HashMap<LandformType, Property> | LANDFORM_HARVEST | 清理地貌的产出 |
- 还有其他各种可能的参数,例如初始化地图时用到的各种常数
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
UnitType | type | 单位类型 |
UnitSubType | subType | 单位子类型 |
Country | country | 所属国家 |
Position | position | 位置 |
int | health | 生命值 |
UnitInfo | unitInfo | 单位信息 |
int | unitRecover | 每回合单位回复生命值 |
boolean | movedThisTurn | 本回合是否移动过 |
boolean | attackedThisTurn | 本回合是否攻击过 |
- 方法
函数原型 | 效果 |
---|---|
void recover() | 回复生命值 |
void unitEndOfTurn() | 回合结束时单位执行的操作 |
void unitStartTurn() | 回合开始时单位执行的操作 |
- 平民单位
- 开拓者
-
建造者
-
成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
int | times | 剩余次数 |
- 方法
函数原型 | 效果 |
---|---|
void reduceTimes() | 使用次数减少 |
-
战斗单位
-
成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
boolean | canUpdate | 单位可升级 |
- 枪兵
- 骑兵
- 步兵
- 弓兵
- 刺客
- 剑士
-
单位信息
-
成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
int | attack | 攻击力 |
int | defence | 防御力 |
int | mobility | 移动力 |
ScienceName | requiredScience | 所需科技 |
ResouceName | reauiredResource | 所需资源 |
- 方法
函数原型 | 效果 |
---|
- 枚举值
FOLK, FIGHTER
- 枚举值
NONE, EXPLORER, CONSTRUCTOR, SPEARMAN, KNIGHT, FOOTMAN, ARCHER, ASSASSIN, SWORDSMAN
- 方法
函数原型 | 效果 |
---|---|
Position currentLocation() | 获取单位当前位置 |
int getMobility() | 获取移动力 |
int setMobility(int mobility) | 设置移动力 |
Vector<LandSquare> getAvailableLocation(Gamemap map) | 获得所有可能到达的点 |
void moveTo(Position pos) | 移动到指定位置 |
- 方法
函数原型 | 效果 |
---|---|
boolean isUpgradable() | 计算是否可以升级 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
CityName | name | 城市名 |
int | population | 人口 |
Position | location | 位置 |
Country | country | 所属国家 |
Property | flowValue | 流量值 |
Property | stockValue | 存量值 |
Vector<LandSquare> | territory | 领土 |
Vector<BuildingType> | constructedBuildings | 已建建筑 |
ProducableInfo | productingItem | 正在建造的东西的消耗 |
BuildingType | producingBuilding | 正在生产的建筑类型 |
UnitSubType | producingUnit | 正在生产的单位类型 |
int | cityAttack | 城市攻击 |
int | cityDefence | 城市防御 |
int | cityHealth | 城市生命值 |
int | recovery | 每回合恢复的生命值 |
Vector<BuildingType> | allowedBuildings | 可以建造的建筑 |
Vector<Unit> | allowedUnits | 可以建造的单位 |
boolean | isProducing | 是否正在生产 |
- 方法
函数原型 | 效果 |
---|---|
void calculateAllowedBuildings() | 计算可生产的建筑 |
void calculateAllowedUnits() | 计算可生产的单位 |
void calculateFlowValue() | 计算流量 |
void updateStock() | 更新存量,涉及到人口的增长与减少 |
void recover() | 恢复血量 |
void cityEndOfTurn() | 回合结束城市的结算 |
UnitSubType cityStartTurn() | 回合开始城市的结算 |
void produce(UnitSubType type) | 生产单位 |
void produce(BuildingType type) | 生产建筑 |
UnitSubType finishProduceUnit() | 完成生产 |
boolean belongsTo(Country country) | 是否属于某个国家 |
boolean hasLandSquare(LandSquare landSquare) | 是否拥有某个地块 |
- 枚举值
对应国家的所有城市名字
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
BuildingType | type | 类型 |
Property | buildingFlowValue | 产出的值 |
BuildingInfo | buildingInfo | 建筑信息 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
ScienceName | requiredScience | 建造该建筑需要的科技 |
- 枚举值
NONE, ACADEMY, COMMERCIAL_CENTER, INDUSTRAL_PARK
-
生产信息
-
成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
int | productivityCost | 生产力花费 |
int | moneyCost | 金钱花费 |
- 方法
函数原型 | 效果 |
---|---|
int getAttack() | |
int getDefence() | |
int getHealth() | |
void injure(int damage) | 受伤,可能死 |
void die() | 删除单位,通知所属国家将拥有的这一单位去掉 |
boolean isDied() | 判断单位的生命值是否小于零 |
Vector<LandSquare> getAttackRange(GameMap map) | 获得攻击范围 |
- 存放这个包中的各个常数
类型 | 成员变量名 | 备注 |
---|---|---|
HashMap<BuildingType,Integer> | BUILDING_PRODUCTIVITY_COST | 建筑的生产力消耗 |
HashMap<BuildingType,Integer> | BUILDING_MONEY_COST | 建筑的金钱消耗 |
HashMap<BuildingType,ScienceName> | BUILDING_REQUIRED_SCIENCE | 建筑需要的科技 |
HashMap<BuildingType,Integer> | BUILDING_FLOW_PRODUCTIVITY | 建筑产生的生产力 |
HashMap<BuildingType,Integer> | BUILDING_FLOW_MONEY | 建筑产生的钱 |
HashMap<BuildingType,Integer> | BUILDING_FLOW_FOOD | 建筑产生的食物 |
HashMap<BuildingType,Integer> | BUILDING_FLOW_SCIENCE | 建筑产生的科技值 |
HashMap<BuildingType,Integer> | BUILDING_FLOW_SCIENTIST_VALUE | 建筑产生的科学家点数 |
HashMap<BuildingType,Integer> | BUILDING_FLOW_TRADER_VALUE | 建筑产生的大商人点数 |
HashMap<BuildingType,Integer> | BUILDING_FLOW_ENGINEER_VALUE | 建筑产生的大工程师点数 |
HashMap<UnitSubType, Integer> | UNIT_HEALTH | 单位生命值 |
HashMap<UnitSubType, Integer> | UNIT_ATTACK | 单位攻击力 |
HashMap<UnitSubType, Integer> | UNIT_DEFENCE | 单位防御力 |
HashMap<UnitSubType, Integer> | UNIT_MOBILITY | 单位移动力 |
HashMap<UnitSubType, Integer> | UNIT_PRODUCTIVITY_COST | 单位生产力消耗 |
HashMap<UnitSubType, Integer> | UNIT_MONEY_COST | 单位金钱消耗 |
HashMap<UnitSubType, ScienceName> | UNIT_REQUIRED_SCIENCE | 单位需要的科技 |
HashMap<UnitSubType, ResourceType> | UNIT_REQUIRED_RESOURCE | 单位需要的资源 |
HashMap<UnitSubType, Integer> | UNIT_RECOVERY | 单位回复量 |
HashMap<UnitSubType,ScienceName> | UPDATE_NEED_SCIENCE | 单位升级需要的科技 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
Leader | leader | 领袖 |
Vector<City> | cities | 拥有的城市 |
Vector<Unit> | units | 拥有的单位 |
Vector<Trader> | traders | 拥有的商人 |
int | occupiedTradeRoutes | 已经使用了的贸易路线 |
int | totalTradeRoutes | 总的贸易路线 |
HashMap<ResourceName, int> | countryResource | 拥有的资源 |
Vector<ScienceName> | learntScience | 已学习的科技 |
ScienceName | currentScience | 正学习的科技 |
Vector<CityName> | availableNames | 可用的城市名 |
GiantName | givenupScientist | 放弃的大科 |
GiantName | givenupEconomist | 放弃的大商 |
GiantName | givenupEngineer | 放弃的大工 |
Property | flowValue | 流量 |
Pproperty | stockValue | 存量 |
- 方法
函数原型 | 效果 |
---|---|
void readyForNewRound() | 计算等每一回合开始执行的任务 |
void endOfCurrentRound() | 恢复等每一回合结束执行的任务 |
void updateStock() | 更新存量 |
void updateFlow() | 更新流量 |
void calculateFlowValue() | 计算流量 |
void calculateTradeMoney() | 计算商路的钱 |
City buildNewCity(Position position, Vector<LandSquare> territory) | 建立新城市 |
void occupyCity(City city) | 占领城市 |
void loseCity(City city) | 失去城市 |
void addNewUnit(Unit unit) | 增加新单位 |
void deleteUnit(Unit unit) | 删除单位 |
ScienceName finishScience() | 研究完成 |
ResourceType harvestResource(LandformType landformType) | 收获资源 |
void addTradeRoute() | 贸易路线增加 |
void startTradeRoute(Trader trader, City city) | 开始贸易 |
void tradeAdvance() | 推进贸易 |
void endTrade(Trader trader) | 贸易结束 |
void recruiteGiant(GiantName giantname) | 招募得到伟人,包括购买或点数 |
void harvestLandform(Position position, LandformType landformType) | 清理地貌 |
boolean judgeScienceVictory() | 判定胜利 |
boolean hasCity(City city) | 是否拥有城市 |
boolean hasLandSquare(LandSquare landSquare) | 判断拥有单元格作为领土 |
Position nearestAvailable(Position root, GameMap map, Country enemyCountry) | 找出城市生产单位后能放入的最近单元格 |
- 枚举值
INDIA, AMERICA;
- 各种用到的游戏参数
类型 | 成员变量名 | 备注 |
---|---|---|
Vector<Position> | DEFAULT_TERRITORY | 默认城市领土 |
HashMap<CountryName, Color> | COLOR_OF_COUNTRY | 国家颜色 |
HashMap<CountryName, LeaderName> | LEADER_OF_COUNTRY | 国家领导人 |
HashMap<CountryName, Vector> | CITIES_OF_COUNTRY | 国家可用的城市名 |
- 枚举值
SCIENTIST, ECONOMIST, ENGINEER
- 枚举值
不举例了
- 储存所有有关Giant的常数
类型 | 成员变量名 | 备注 |
---|---|---|
HashMap<GiantName, GiantType> | GIANT_NAME_TO_TYPE | 伟人所属类型 |
HashMap<GiantType, Property> | GIANT_TYPE_BONUS | 伟人带来加成 |
HashMap<GiantType, Property> | GIANT_TYPE_COST | 伟人消耗点数 |
- 枚举值
不举例了
- 储存所有有关Science的常数
类型 | 成员变量名 | 备注 |
---|---|---|
HashMap<ScienceName, ScienceName> | PRE_SCIENCE | 前置科技 |
HashMap<ScienceName, ScienceName> | NEXT_SCIENCE | 下一个科技 |
HashMap<ScienceName, Integer> | SCIENCE_COST | 科技值消耗 |
-
该Leader部分暂未完成
-
成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
LeaderName | name | 名字 |
CountryName | nationality | 国籍 |
Unit | specialUnit | 特殊单位 |
- 方法
函数原型 | 效果 |
---|---|
void specialInitSkill() | 特殊初始化技能 |
void specialPermanentSkill() | 特殊永续技能 |
- 枚举值
GANDHI, ROOSEVELT;
-
该Trader部分暂未完成
-
成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
City | aimCity | 目标城市 |
int | lastTime | 剩余时间 |
int | benefits | 每回合收益 |
- 方法
函数原型 | 效果 |
---|---|
void startTrade(City city) | 向目的地城市开始贸易 |
- 各种配置,例如计算贸易收益的常数,伟人的收益,科技点的要求
- 全局参数,如果觉得应该放在这里的话
- 实际并没有用到
- 全局的函数,如果觉得应该放在这里
- 实际并没有用到
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
int | x | 列数,从左向右 |
int | y | 行数,从上到下 |
- 方法
函数原型 | 效果 |
---|---|
Position() | 默认构造函数 |
Position(int x, int y) | 按坐标构造函数 |
Position(Position position) | 复制构造函数 |
int distanceSquare(Position p1, Position p2) | 计算距离平方 |
boolean equals(Object object) | 判断是否相等 |
- 成员变量
类型 | 成员变量名 | 备注 |
---|---|---|
int | productivity | 生产力 |
int | money | 金币 |
int | food | 食物 |
int | science | 科技值 |
int | scientistValue | 大科学家点数 |
int | traderValue | 大商人点数 |
int | engineerValue | 大工程师点数 |
- 方法
函数原型 | 效果 |
---|---|
Property() | 默认构造方法,各值均为0 |
Property( /* 各项数值 */ ) | 用各项数值的构造方法 |
Property(BuildingType type) | 用buildingType初始化,获得和buildingType属性一致的property |
void addProperty(Property property) | 加某一Property的值 |