-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStore.java
More file actions
36 lines (34 loc) · 820 Bytes
/
Copy pathStore.java
File metadata and controls
36 lines (34 loc) · 820 Bytes
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
import java.util.*;
public class Store
{
Scanner scan = new Scanner(System.in);
private static Weapons w1 = new RustySword();
private static Weapons w2 = new SimpleSpear();
private static Weapons w3 = new SimpleClub();
private static String name = "Angmars Weapons";
public Store()
{
}
public Weapons getRustySword()
{
return this.w1;
}
public Weapons getSimpleSpear()
{
return this.w2;
}
public Weapons getSimpleClub()
{
return this.w3;
}
public int showWeaponsAvailable()
{
System.out.println(this.name);
System.out.println("[0]"+this.w1.getName()+":"+this.w1.getPrice());
System.out.println("[1]"+this.w2.getName()+":"+this.w2.getPrice());
System.out.println("[2]"+this.w3.getName()+":"+this.w3.getPrice());
System.out.print("Choice: ");
int x = scan.nextInt();
return x;
}
}