-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWeapon.java
More file actions
46 lines (42 loc) · 1.3 KB
/
Weapon.java
File metadata and controls
46 lines (42 loc) · 1.3 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
package Assignment4;
public class Weapon extends Item {
private int strengthPerHit;
private String type;
private int damageSpeed;
public Weapon(String name, double weight, double value, double ID, double Durability, int strengthPerHit,
String type, int damageSpeed) {
super(name, weight, value, ID, Durability);
this.strengthPerHit = strengthPerHit;
this.type = type;
this.damageSpeed = damageSpeed;
}
public int getStrengthPerHit() {
return strengthPerHit;
}
public void setStrengthPerHit(int strengthPerHit) {
this.strengthPerHit = strengthPerHit;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public int getDamageSpeed() {
return damageSpeed;
}
public void setDamageSpeed(int damageSpeed) {
this.damageSpeed = damageSpeed;
}
@Override
public String toString() {
return ("Name: | "+this.getName()+
" | ID: "+ this.getID() +
" | Weight: "+ this.getWeight()+
" | Value: " + this.getValue()+
" | Durability: " + this.getDurability()+
" | The strength: " + this.getStrengthPerHit()+
" | Type of Weapon: " + this.getType()+
" | Damage speed: " + this.getDamageSpeed() + " |");
}
}