📄 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;}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -