/*
 *    Debrief - the Open Source Maritime Analysis Application
 *    http://debrief.info
 *
 *    (C) 2000-2014, PlanetMayo Ltd
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the Eclipse Public License v1.0
 *    (http://www.eclipse.org/legal/epl-v10.html)
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 */
package ASSET.Models.Vessels;


public class Buoy extends SSN
{
  /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	/** whether this is an active sensor
	 * 
	 */
	private boolean _isTransmitting;

	public Buoy(final int id, final boolean isActive)
  {
    super(id);
    _isTransmitting = isActive;
  }

  public Buoy(final int id, final ASSET.Participants.Status status, final ASSET.Participants.DemandedStatus demStatus, final String name)
  {
    super(id, status, demStatus, name);
  }

  public void initialise()
  {
    if(getStatus() != null)
      this.getStatus().setFuelLevel(100);
  }

	@Override
	public boolean radiatesThisNoise(int medium)
	{
		if(_isTransmitting)			
			return super.radiatesThisNoise(medium);
		else
			return false;
	}
}

@@ -564,16 +564,118 @@
 els;%0D%0A%0D%0A
+import java.util.Iterator;%0D%0A%0D%0Aimport ASSET.Models.SensorType;%0D%0Aimport ASSET.Participants.Category;%0D%0A%0D%0A
 %0D%0Apublic
@@ -780,198 +780,159 @@
 %09%0D%0A%09
-/** whether this is an active sensor%0D%0A%09 * %0D%0A%09 */%0D%0A%09private boolean _isTransmitting;%0D%0A%0D%0A%09public Buoy(final int id, final boolean isActive)%0D%0A  %7B%0D%0A    super(id);%0D%0A    _isTransmitting = isActive
+public Buoy(final int id)%0D%0A  %7B%0D%0A    super(id);%0D%0A    setCategory(new Category(Category.Force.BLUE, Category.Environment.SUBSURFACE, Category.Type.BUOY))
 ;%0D%0A 
@@ -1238,16 +1238,24 @@
 );%0D%0A  %7D%0D
+%0A  %0D%0A  %0D
 %0A%0D%0A%09@Ove
@@ -1318,99 +1318,295 @@
 %0D%0A%09%09
-if(_isTransmitting)%09%09%09%0D%0A%09%09%09return super.radiatesThisNoise(
+boolean res = false;%09%09%0D%0A%09%09Iterator%3CSensorType%3E sensors = this.getSensorFit().getSensors().iterator();%0D%0A%09%09while (sensors.hasNext())%0D%0A%09%09%7B%0D%0A%09%09%09SensorType thisS = (SensorType) sensors.next();%0D%0A%09%09%09if(thisS.getMedium() == 
 medium)
-;
 %0D%0A%09%09
-else
+%09%7B%0D%0A%09%09%09%09res = true;
 %0D%0A%09%09%09
+%09
+break;%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%09%0D%0A%09%09
 return 
-false
+res
 ;%0D%0A%09

handle active modes