View Javadoc

1   /*
2    * To change this template, choose Tools | Templates
3    * and open the template in the editor.
4    */
5   
6   package nl.tudelft.goal.ut2004.visualizer.map;
7   
8   import java.awt.Color;
9   import java.util.ArrayList;
10  import java.util.List;
11  
12  import nl.tudelft.goal.ut2004.visualizer.timeline.map.IRenderableUTAgent;
13  import cz.cuni.amis.introspection.Folder;
14  import cz.cuni.amis.pogamut.base.agent.IAgentId;
15  import cz.cuni.amis.pogamut.base.agent.exceptions.AgentException;
16  import cz.cuni.amis.pogamut.base.agent.state.level0.IAgentState;
17  import cz.cuni.amis.pogamut.base.communication.command.IAct;
18  import cz.cuni.amis.pogamut.base.communication.worldview.IWorldView;
19  import cz.cuni.amis.pogamut.base.component.bus.IComponentBus;
20  import cz.cuni.amis.pogamut.base.component.exception.ComponentCantStartException;
21  import cz.cuni.amis.pogamut.base.utils.logging.IAgentLogger;
22  import cz.cuni.amis.pogamut.base3d.worldview.object.Location;
23  import cz.cuni.amis.pogamut.base3d.worldview.object.Rotation;
24  import cz.cuni.amis.pogamut.base3d.worldview.object.Velocity;
25  import cz.cuni.amis.pogamut.unreal.bot.IUnrealBot;
26  import cz.cuni.amis.utils.exception.PogamutException;
27  import cz.cuni.amis.utils.flag.ImmutableFlag;
28  
29  /**
30   * Simple proxy from IUTAgent to IRenderableUTAgent.
31   * 
32   * @author Honza
33   */
34  final class ProxyRenderableAgent implements IRenderableUTAgent {
35  	private int glName;
36  	private IUnrealBot agent;
37  	private Color color;
38  
39  	public ProxyRenderableAgent(IUnrealBot agent, Color color, int glName) {
40  		this.agent = agent;
41  		this.glName = glName;
42  		this.color = color;
43  	}
44  
45  	@Override
46  	public Color getColor() {
47  		return color;
48  	}
49  
50  	@Override
51  	public List<String> getAssociatedInfo() {
52  		return new ArrayList<String>(0);
53  	}
54  
55  	// TODO(MP): Not rendering map events.
56  	// @Override
57  	// public List<MapEvent> getMapEvents() {
58  	// return new ArrayList<MapEvent>();
59  	// }
60  
61  	@Override
62  	public Object getDataSource() {
63  		return agent;
64  	}
65  
66  	@Override
67  	public int getGLName() {
68  		return glName;
69  	}
70  
71  	@Override
72  	public void respawn() throws PogamutException {
73  		agent.respawn();
74  	}
75  
76  	/*
77  	 * TODO
78  	 * 
79  	 * @Override public void setBoolConfigure(BoolBotParam param, boolean value) { agent.setBoolConfigure(param, value); }
80  	 * 
81  	 * @Override public boolean getBoolConfigure(BoolBotParam param) { return getBoolConfigure(param); }
82  	 */
83  	@Override
84  	public IAct getAct() {
85  		return agent.getAct();
86  	}
87  
88  	@Override
89  	public String getName() {
90  		return agent.getName();
91  	}
92  
93  	@Override
94  	public IAgentLogger getLogger() {
95  		return agent.getLogger();
96  	}
97  
98  	@Override
99  	public ImmutableFlag<IAgentState> getState() {
100 		return agent.getState();
101 	}
102 
103 	@Override
104 	public void start() throws AgentException {
105 		agent.start();
106 	}
107 
108 	@Override
109 	public void startPaused() throws ComponentCantStartException {
110 		agent.startPaused();
111 	}
112 
113 	@Override
114 	public void pause() throws AgentException {
115 		agent.pause();
116 	}
117 
118 	@Override
119 	public void resume() throws AgentException {
120 		agent.resume();
121 	}
122 
123 	@Override
124 	public void stop() {
125 		agent.stop();
126 	}
127 
128 	@Override
129 	public void kill() {
130 		agent.kill();
131 	}
132 
133 	@Override
134 	public Folder getIntrospection() {
135 		return agent.getIntrospection();
136 	}
137 
138 	@Override
139 	public Location getLocation() {
140 		return agent.getLocation();
141 	}
142 
143 	@Override
144 	public Velocity getVelocity() {
145 		return agent.getVelocity();
146 	}
147 
148 	@Override
149 	public Rotation getRotation() {
150 		return agent.getRotation();
151 	}
152 
153 	@Override
154 	public IWorldView getWorldView() {
155 		throw new UnsupportedOperationException("Not supported yet.");
156 	}
157 
158 	@Override
159 	public IAgentId getComponentId() {
160 		throw new UnsupportedOperationException("Not supported yet.");
161 	}
162 
163 	@Override
164 	public IComponentBus getEventBus() {
165 		throw new UnsupportedOperationException("Not supported yet.");
166 	}
167 
168 }