Package edu.nps.moves.dis7
Class MinefieldStatePdu
java.lang.Object
edu.nps.moves.dis7.PduSuperclass
edu.nps.moves.dis7.Pdu
edu.nps.moves.dis7.MinefieldFamilyPdu
edu.nps.moves.dis7.MinefieldStatePdu
- All Implemented Interfaces:
Serializable
information about the complete minefield. The minefield presence, perimiter,
etc. Section 7.9.2 COMPLETE
Copyright (c) 2008-2016, MOVES Institute, Naval Postgraduate School. All
rights reserved. This work is licensed under the BSD open source license,
available at https://www.movesinstitute.org/licenses/bsd.html
- Author:
- DMcG
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
appearance bitflagsprotected short
force IDprotected MinefieldIdentifier
Minefield IDprotected Vector3Double
location of center of minefield in world coordsprotected EulerAngles
orientation of minefieldprotected int
Minefield sequenceprotected EntityType
type of minefieldprotected List
<EntityType> Type of minesprotected int
how many mine typesprotected short
Number of permieter pointsprotected List
<Vector2Float> perimeter points for the minefieldprotected int
protocolMode.Fields inherited from class edu.nps.moves.dis7.PduSuperclass
exerciseID, pduType, protocolFamily, protocolVersion, timestamp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
equalsImpl
(Object obj) Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied objectint
short
int
int
int
short
int
void
marshal
(DataOutputStream dos) void
marshal
(ByteBuffer buff) Packs a Pdu into the ByteBuffer.void
setAppearance
(int pAppearance) void
setForceID
(short pForceID) void
setMinefieldID
(MinefieldIdentifier pMinefieldID) void
setMinefieldLocation
(Vector3Double pMinefieldLocation) void
setMinefieldOrientation
(EulerAngles pMinefieldOrientation) void
setMinefieldSequence
(int pMinefieldSequence) void
setMinefieldType
(EntityType pMinefieldType) void
setMineType
(List<EntityType> pMineType) void
setNumberOfMineTypes
(int pNumberOfMineTypes) Note that setting this value will not change the marshalled value.void
setNumberOfPerimeterPoints
(short pNumberOfPerimeterPoints) Note that setting this value will not change the marshalled value.void
setPerimeterPoints
(List<Vector2Float> pPerimeterPoints) void
setProtocolMode
(int pProtocolMode) void
unmarshal
(DataInputStream dis) void
unmarshal
(ByteBuffer buff) Unpacks a Pdu from the underlying data.Methods inherited from class edu.nps.moves.dis7.Pdu
getPadding, getPduStatus, marshal, setPadding, setPduStatus
Methods inherited from class edu.nps.moves.dis7.PduSuperclass
getExerciseID, getLength, getPduType, getProtocolFamily, getProtocolVersion, getTimestamp, setExerciseID, setLength, setPduType, setProtocolFamily, setProtocolVersion, setTimestamp
-
Field Details
-
minefieldID
Minefield ID -
minefieldSequence
protected int minefieldSequenceMinefield sequence -
forceID
protected short forceIDforce ID -
numberOfPerimeterPoints
protected short numberOfPerimeterPointsNumber of permieter points -
minefieldType
type of minefield -
numberOfMineTypes
protected int numberOfMineTypeshow many mine types -
minefieldLocation
location of center of minefield in world coords -
minefieldOrientation
orientation of minefield -
appearance
protected int appearanceappearance bitflags -
protocolMode
protected int protocolModeprotocolMode. First two bits are the protocol mode, 14 bits reserved. -
perimeterPoints
perimeter points for the minefield -
mineType
Type of mines
-
-
Constructor Details
-
MinefieldStatePdu
public MinefieldStatePdu()Constructor
-
-
Method Details
-
getMarshalledSize
public int getMarshalledSize()- Overrides:
getMarshalledSize
in classMinefieldFamilyPdu
-
setMinefieldID
-
getMinefieldID
-
setMinefieldSequence
public void setMinefieldSequence(int pMinefieldSequence) -
getMinefieldSequence
public int getMinefieldSequence() -
setForceID
public void setForceID(short pForceID) -
getForceID
public short getForceID() -
getNumberOfPerimeterPoints
public short getNumberOfPerimeterPoints() -
setNumberOfPerimeterPoints
public void setNumberOfPerimeterPoints(short pNumberOfPerimeterPoints) Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose. The getnumberOfPerimeterPoints method will also be based on the actual list length rather than this value. The method is simply here for java bean completeness. -
setMinefieldType
-
getMinefieldType
-
getNumberOfMineTypes
public int getNumberOfMineTypes() -
setNumberOfMineTypes
public void setNumberOfMineTypes(int pNumberOfMineTypes) Note that setting this value will not change the marshalled value. The list whose length this describes is used for that purpose. The getnumberOfMineTypes method will also be based on the actual list length rather than this value. The method is simply here for java bean completeness. -
setMinefieldLocation
-
getMinefieldLocation
-
setMinefieldOrientation
-
getMinefieldOrientation
-
setAppearance
public void setAppearance(int pAppearance) -
getAppearance
public int getAppearance() -
setProtocolMode
public void setProtocolMode(int pProtocolMode) -
getProtocolMode
public int getProtocolMode() -
setPerimeterPoints
-
getPerimeterPoints
-
setMineType
-
getMineType
-
marshal
- Overrides:
marshal
in classMinefieldFamilyPdu
-
unmarshal
- Overrides:
unmarshal
in classMinefieldFamilyPdu
-
marshal
Packs a Pdu into the ByteBuffer.- Overrides:
marshal
in classMinefieldFamilyPdu
- Parameters:
buff
- The ByteBuffer at the position to begin writing- Throws:
BufferOverflowException
- if buff is too smallReadOnlyBufferException
- if buff is read only- Since:
- ??
- See Also:
-
unmarshal
Unpacks a Pdu from the underlying data.- Overrides:
unmarshal
in classMinefieldFamilyPdu
- Parameters:
buff
- The ByteBuffer at the position to begin reading- Throws:
BufferUnderflowException
- if buff is too small- Since:
- ??
- See Also:
-
equals
- Overrides:
equals
in classMinefieldFamilyPdu
-
equalsImpl
Description copied from class:PduSuperclass
Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied object- Overrides:
equalsImpl
in classMinefieldFamilyPdu
- Parameters:
obj
- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-