1 package nl.tudelft.pogamut.unreal.agent.module.shooting.util;
2
3 import cz.cuni.amis.pogamut.base3d.worldview.object.ILocated;
4 import cz.cuni.amis.pogamut.base3d.worldview.object.Location;
5
6
7
8
9
10
11
12 public final class FocusProvider implements ILocated {
13
14 private ILocated focus;
15
16
17
18
19
20
21
22 public FocusProvider(ILocated focus) {
23 super();
24 this.focus = focus;
25 }
26
27
28
29
30 public FocusProvider() {
31 this(null);
32 }
33
34
35
36
37 public ILocated getFocus() {
38 return focus;
39 }
40
41
42
43
44
45 public void setFocus(ILocated focus) {
46 this.focus = focus;
47 }
48
49
50
51
52 @Override
53 public Location getLocation() {
54 if(focus == null){
55 return null;
56 }
57
58 return focus.getLocation();
59 }
60
61
62
63
64
65
66 @Override
67 public String toString() {
68 return "FocusProvider [focus=" + focus + "]";
69 }
70
71 public void clearFocus() {
72 focus = null;
73 }
74
75 }