-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.java
74 lines (62 loc) · 2.27 KB
/
App.java
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
// package Map;
import Map.*;
public class App {
public static void main(String[] args) throws Exception {
location troop=new location(63,69);
location l=new location(3,96);
basicmap enemy=new enemyhotspot();
basicmap safelocation=new safelocation();
basicmap electricity=new electricpower();
basicmap f=new fuel();
basicmap water=new waterresources();
airdrop adp=new airdrop();
time t=new time();
enemy.setlocation(l,2);
enemy.printmap();
enemy.localmap(l);
l=enemy.nearestlocation(troop);
l.printlocation();
safelocation.setlocation(troop,1);
safelocation.printmap();
safelocation.localmap(troop);
l=safelocation.nearestlocation(troop);
l.printlocation();
electricity.setlocation(troop,3);
electricity.printmap();
electricity.localmap(troop);
l=electricity.nearestlocation(troop);
l.printlocation();
f.setlocation(troop,3);
f.printmap();
f.localmap(troop);
l=f.nearestlocation(troop);
l.printlocation();
// f.setlocation(troop,3);
// f.printmap();
// f.localmap(troop);
// l=f.nearestlocation(troop);
// l.printlocation();
water.setlocation(troop,3);
water.printmap();
water.localmap(troop);
l=water.nearestlocation(troop);
l.printlocation();
basicmap enemybase=new enemybase();
enemybase.printmap();
l=enemybase.nearestlocation(troop);
l.printlocation();
adp.airdroptt(troop);
/*
location object saves the location (latitude,longitude) (0<=latitude<50,0<=longitude<100)
latitude is |
longitude is ---
for all the map objects
.printmap() prints the map
.localmap(location l) prints the objects local map of the given location
.nearestlocation(location troop) returns nearest object of the respective class
airdrop
.setlocation(location l) sets the give objects map value at location to 1
airdropclassobject.airdroptt(location troop) prints the location and time of delivery
*/
}
}