-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeros.java
More file actions
154 lines (121 loc) · 3.08 KB
/
Heros.java
File metadata and controls
154 lines (121 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import java.util.ArrayList;
//define hero basic information
public abstract class Heros implements Character {
private String name;
private int level;
private int MP;
private int strength;
private int dexterity;
private int agility;
private int gold;
private ArrayList<item> items;
private int HP;
private int heroRow;
private int heroCol;
private int currentLane;
private int[] homeLocation;
public Heros(String name, int mana, int strength, int agility, int dexterity, int money, int experience) {
this.name = name;
this.MP = mana;
this.strength = strength;
this.agility = agility;
this.dexterity = dexterity;
this.gold = money;
this.level = experience;
this.HP = experience * 100;
heroRow = 0;
heroCol = 0;
this.currentLane = 0;
items = new ArrayList<item>();
}
public int getHeroRow(){
return heroRow;
}
public int getCurrentLane(){
return this.currentLane;
}
public void setCurrentLane(int currentLane) {
this.currentLane = currentLane;
}
public void sethHeroRow(int heroRow){
this.heroRow = heroRow;
} public String getName(){
return name;
};
public void setName(String name){
this.name = name;
};
public int getLevel(){
return level;
}
public void setLevel(int level){
this.level = level;
}
public int getMP(){
return MP;
}
public void setMP(int MP){
this.MP = MP;
};
public int getStrength(){
return strength;
}
public void setStrength(int strength){
this.strength = strength;
}
public int getDexterity(){
return dexterity;
}
public void setDexterity(int dexterity){
this.dexterity =dexterity;
}
public int getAgility(){
return agility;
}
public void setAgility(int agility){
this.agility = agility;
}
public int getMoney(){
return gold;
}
public void setMoney(int money){
this.gold = money;
}
public ArrayList<item> getItems(){
return items;
}
public void setItems(item i) {
items.add(i);
}
public void setItems(ArrayList<item> items) {
this.items = items;
}
public int getHP() {
return HP;
}
public void setHP(int HP) {
this.HP = HP;
}
public int getHeroCol() {
return heroCol;
}
public void setHeroCol(int heroCol) {
this.heroCol = heroCol;
}
public int[] getHomeLocation() {
return homeLocation;
}
public void setHomeLocation(int homeLocationCol, int homeLocationRow) {
int[] location = new int[2];
location[0] = homeLocationCol;
location[1] = homeLocationRow;
this.homeLocation = location;
}
public void setHeroRow(int heroRow) {
this.heroRow = heroRow;
}
@Override
public void LeaveCurrentLocation(Map map){
map.HeroLeave(this.getHeroCol(), this.getHeroRow());
}
}