?? balancesheet.java
字號:
/*
* Created on 2004/7/24
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package rich;
import java.util.ArrayList;
/**
* @author ZhiJian
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class BalanceSheet {
int cashInHand;
int cashInBank;
ArrayList groundList ;
BalanceSheet(int cashInHand,int cashInBank){ // initial all information
this.cashInBank = cashInBank;
this.cashInHand = cashInHand;
groundList = new ArrayList();
}
void setCashInHand(int cash,String type){ //store or pay money
if(type=="store"){
cashInHand += cash;
}else if(type=="pay"){
cashInHand-=cash;
}
}
int getCashInHand(){ return cashInHand; }
void setCashInBank(int cash,String type){ //save or carry in bank
if(type=="store"){
cashInBank += cash;
}else if(type=="pay"){
cashInBank -= cash;
}
}
int getCashInBank(){return cashInBank;}
boolean setGround(Ground ground,Character Owner){ //buy ground
if(ground.getOwner()==null){
ground.setOwner(Owner);
groundList.add(ground);
return true;
}else{
return false;
}
}
ArrayList getGround(){ return groundList; }
void updateBuilding(int address){ //update building
Ground ground;
int i=0;
do{
ground = (Ground)groundList.get(i);
i++;
}while(ground.getAddress()!=address);
ground.levelUp();
cashInHand -= 500;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -