Added MessageDecoder interface. All decoder implement this.

Added DecoderFactory. This creates an appropriate decoder based on a MessageType.
BoatActionDecoder implements MessageDecoder.
BoatLocationDecoder implements MessageDecoder.
HeartBeatDecoder implements MessageDecoder.
JoinAcceptance implements MessageDecoder.
RaceStatusDecoder implements MessageDecoder.
RequestToJoinDecoder implements MessageDecoder.
XMLMessageDecoder implements MessageDecoder.
Refactored CourseWind decoder/encoder. CourseWind decoder/encoder is for an individual CourseWind.
CourseWinds decoder/encoder is for the combined message from the API.
Documented BoatAction, and it now contains a BoatActionEnum instead of a byte.
Refactored CourseWind and CourseWinds classes. They now expose correct units, instead of packed units.
Added CourseWindDecoderTest, and updated CourseWindsDecoderTest.
issue #35 #36
#story[1095]
This commit is contained in:
fjc40
2017-08-06 18:51:13 +12:00
parent 1fbdd09d70
commit 750ea5c141
32 changed files with 840 additions and 234 deletions
@@ -29,10 +29,10 @@ public class BoatActionDecoderTest {
byte [] testEncodedMessage = RaceVisionByteEncoder.encode(message);
//Decode.
BoatActionDecoder testDecoder = new BoatActionDecoder(testEncodedMessage);
BoatActionEnum decodedBoatAction = testDecoder.getBoatAction();
BoatActionDecoder testDecoder = new BoatActionDecoder();
testDecoder.decode(testEncodedMessage);
BoatAction decodedMessage = new BoatAction(decodedBoatAction);
BoatAction decodedMessage = testDecoder.getMessage();
return decodedMessage;
}