Added an InvalidMessageTypeException - thrown whenever we encounter a MessageType that isn't recognised or isn't supported.

Added EncoderFactory. This creates specific MessageEncoders. Supports JoinAcceptance and RequestToJoin.
Added MessageEncoder interface.
Added JoinAcceptanceEncoder.
Added encode(AC35Data) function to RaceVisionByteEncoder.
Added RequestToJonEncoder.
Updated RequestToJoin and JoinAcceptance decode/encode tests to use the above.

issue #35 #36
#story[1095]
This commit is contained in:
fjc40
2017-08-05 21:31:47 +12:00
parent 7ea5b31fa1
commit 16686678a7
8 changed files with 185 additions and 32 deletions
@@ -0,0 +1,17 @@
package network.Exceptions;
/**
* An exception thrown when we encounter a message type that isn't recognised.
*/
public class InvalidMessageTypeException extends Exception {
public InvalidMessageTypeException(String message) {
super(message);
}
public InvalidMessageTypeException(String message, Throwable cause) {
super(message, cause);
}
}