?? character.java
字號:
package rich;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
public class Character {
String name;
String gender;
int age;
BalanceSheet balance;
ImageIcon image;
ImageIcon icon;
int x,y;
int address;
JLabel characterLayered;
String playerType;
Character(String name,String gender,int age,int cashInHand,int cashInBank,int x,int y,ImageIcon image,ImageIcon icon){
this.name = name;
this.age = age;
this.gender = gender;
this.image = image;
this.icon = icon;
balance = new BalanceSheet(cashInHand,cashInBank);
this.x = x;
this.y = y;
address = 0;
}
void setX(int x){ this.x = x; }
int getX(){ return x; }
void setY(int y){ this.y = y; }
int getY(){ return y; }
void expent(int cash){
balance.setCashInHand(cash,"pay");
}
void income(int cash){
balance.setCashInHand(cash,"store");
}
void carrying(int cash){
balance.setCashInBank(cash,"pay");
}
void saving(int cash){
balance.setCashInBank(cash,"store");
}
void showCashInHand(){
System.out.print(balance.getCashInHand());
}
void showCashInBank(){
System.out.print(balance.getCashInBank());
}
void setAddress(int address){ this.address = address; }
int getAddress(){ return address; }
String getName(){return name;}
int getAge(){ return age; }
String getGender(){ return gender; }
int getCashInHand(){ return balance.getCashInHand();}
int getCashInBank(){ return balance.getCashInBank();}
void industryBuild(){
}
ImageIcon getImage(){ return image; }
ImageIcon getIcon(){ return icon; }
void setCharacterLayered(JLabel characterLayered){
this.characterLayered = characterLayered;
}
JLabel getCharacterLayered(){
return characterLayered;
}
void setPlayerType(String playerType){ this.playerType = playerType; }
String getPlayerType(){ return playerType;}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -