forked from rick2785/JavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathESUFOBossGun.java
More file actions
19 lines (13 loc) · 494 Bytes
/
ESUFOBossGun.java
File metadata and controls
19 lines (13 loc) · 494 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Here we define a basic component of a space ship
// Any part that implements the interface ESWeapon
// can replace that part in any ship
public class ESUFOBossGun implements ESWeapon{
// EnemyShip contains a reference to the object
// ESWeapon. It is stored in the field weapon
// The Strategy design pattern is being used here
// When the field that is of type ESUFOGun is printed
// the following shows on the screen
public String toString(){
return "40 damage";
}
}