Code: Show/Hide import java.util.*;
public class TurretBot extends SubspaceBot { private HashSet attached; public TurretBot(BotAction botAction) { attached = new HashSet(); } public void handleEvent(TurretEvent event) { int turret = event.getAttacherID(); String name = m_botAction.getPlayerName(turret); if(attached.add(name)) { int capship = event.getAttacheeID(); //Stuff goes here } else attached.remove(name); } } } |