View Javadoc

1   package nl.tudelft.goal.ut2004.visualizer.map;
2   
3   import java.awt.Color;
4   
5   import nl.tudelft.goal.ut2004.visualizer.timeline.map.IRenderableWorldObject;
6   import cz.cuni.amis.pogamut.base3d.worldview.object.Location;
7   import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.FlagInfo;
8   
9   public class RenderableFlag implements IRenderableWorldObject {
10  
11  	private final FlagInfo flag;
12  	private final Color color;
13  	private final int glName;
14  
15  	public RenderableFlag(FlagInfo flag, int glName) {
16  		this.flag = flag;
17  		this.glName = glName;
18  		
19  		switch (flag.getTeam()) {
20  		case 0:
21  			this.color = Color.RED;
22  			break;
23  		case 1:
24  			this.color = Color.BLUE;
25  			break;
26  		default:
27  			this.color = Color.ORANGE;
28  		}
29  	}
30  
31  	@Override
32  	public Color getColor() {
33  		return color;
34  	}
35  
36  	@Override
37  	public Object getDataSource() {
38  		return flag;
39  	}
40  
41  	@Override
42  	public int getGLName() {
43  		return glName;
44  	}
45  
46  	@Override
47  	public Location getLocation() {
48  		return flag.getLocation();
49  	}
50  
51  
52  
53  }