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   
8   import cz.cuni.amis.pogamut.unreal.bot.IUnrealBot;
9   import cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer;
10  import cz.cuni.amis.pogamut.ut2004.bot.impl.NativeUT2004BotAdapter;
11  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Kick;
12  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player;
13  import cz.cuni.amis.pogamut.ut2004.server.IUT2004Server;
14  
15  public class KickAction implements ActionListener {
16  	private final IPlayer player;
17  
18  	public KickAction(IPlayer bot) {
19  		this.player = bot;
20  	}
21  
22  	@Override
23  	public void actionPerformed(ActionEvent e) {
24  		ServerController controller = ServerController.getInstance();
25  		IUT2004Server server = controller.getServer();
26  		assert server != null;
27  
28  		Kick kick = new Kick(player.getId());
29  		server.getAct().act(kick);
30  	}
31  }