View Javadoc

1   package nl.tudelft.goal.ut2004.visualizer.gui.action;
2   
3   import java.awt.event.ActionEvent;
4   import java.awt.event.ActionListener;
5   
6   import nl.tudelft.goal.ut2004.visualizer.controller.ServerController;
7   import nl.tudelft.goal.ut2004.visualizer.gui.widgets.WaypointBox;
8   
9   
10  import cz.cuni.amis.pogamut.base3d.worldview.object.Location;
11  import cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealWaypoint;
12  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Respawn;
13  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player;
14  import cz.cuni.amis.pogamut.ut2004.communication.worldview.map.Waypoint;
15  import cz.cuni.amis.pogamut.ut2004.server.IUT2004Server;
16  
17  public class RespawnHereAction implements ActionListener {
18  	private final Player player;
19  	private final IUnrealWaypoint navpoint;
20  
21  	public RespawnHereAction(Player player, IUnrealWaypoint navPoint) {
22  		this.player = player;
23  		this.navpoint = navPoint;
24  	}
25  
26  	@Override
27  	public void actionPerformed(ActionEvent e) {
28  		ServerController controller = ServerController.getInstance();
29  		IUT2004Server server = controller.getServer();
30  		assert server != null;
31  
32  		Respawn respawn = new Respawn(player.getId(), navpoint.getLocation(),null);
33  		server.getAct().act(respawn);
34  	}
35  }