Skip to content
Snippets Groups Projects
Commit cb87dcf2 authored by Brutzman, Don's avatar Brutzman, Don
Browse files

javadoc

parent ee19934c
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,8 @@ public class NetworkComms implements Runnable ...@@ -32,6 +32,8 @@ public class NetworkComms implements Runnable
/** people we notify when we receive a PDU */ /** people we notify when we receive a PDU */
private List<PduListener> listeners; private List<PduListener> listeners;
/** provide reference to this object
* @return reference to this object */
public static NetworkComms getInstance() public static NetworkComms getInstance()
{ {
synchronized(NetworkComms.class) synchronized(NetworkComms.class)
...@@ -110,7 +112,8 @@ public class NetworkComms implements Runnable ...@@ -110,7 +112,8 @@ public class NetworkComms implements Runnable
socket.close(); socket.close();
} }
} }
/** Send a PDU
* @param aPdu to send */
public void sendPdu(Pdu aPdu) public void sendPdu(Pdu aPdu)
{ {
aPdu.setTimestamp(time.getDisAbsoluteTimestamp()); aPdu.setTimestamp(time.getDisAbsoluteTimestamp());
...@@ -125,11 +128,15 @@ public class NetworkComms implements Runnable ...@@ -125,11 +128,15 @@ public class NetworkComms implements Runnable
} }
} }
/** add a PduListener, if not already present
* @param aListener PduListener reference to add */
public void addListener(PduListener aListener) public void addListener(PduListener aListener)
{ {
listeners.add(aListener); listeners.add(aListener);
} }
/** remove a PduListener, if present
* @param aListener PduListener reference to remove */
public void removeListener(PduListener aListener) public void removeListener(PduListener aListener)
{ {
listeners.remove(aListener); listeners.remove(aListener);
......
...@@ -16,6 +16,7 @@ import edu.nps.moves.dis7.pdus.*; ...@@ -16,6 +16,7 @@ import edu.nps.moves.dis7.pdus.*;
*/ */
public class SimulationRunner public class SimulationRunner
{ {
/** three strikes you're out! */
public final static int FIRING_ATTEMPTS = 3; public final static int FIRING_ATTEMPTS = 3;
private static NetworkComms networkComms = null; private static NetworkComms networkComms = null;
...@@ -226,7 +227,8 @@ public class SimulationRunner ...@@ -226,7 +227,8 @@ public class SimulationRunner
PduListenerImpl.ENTITIES.clear(); PduListenerImpl.ENTITIES.clear();
} }
} }
/** wait before next activity
* @param ms duration in milliseconds */
public static void sleep(long ms) { public static void sleep(long ms) {
try try
{ {
......
...@@ -17,6 +17,8 @@ public class Sniper implements Runnable ...@@ -17,6 +17,8 @@ public class Sniper implements Runnable
Vector3Double disCoordinates; Vector3Double disCoordinates;
EntityID eId; EntityID eId;
/** provide reference to this object
* @return reference to this object */
public static Sniper getInstance() { public static Sniper getInstance() {
if (sniper == null) { if (sniper == null) {
sniper = new Sniper(); sniper = new Sniper();
......
...@@ -19,6 +19,8 @@ public class Target implements Runnable { ...@@ -19,6 +19,8 @@ public class Target implements Runnable {
private static Target target = null; private static Target target = null;
private EntityID eId; private EntityID eId;
/** provide reference to this object
* @return reference to this object */
public static Target getInstance() { public static Target getInstance() {
if (target == null) { if (target == null) {
target = new Target(); target = new Target();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment