Commit Graph
233 Commits
Author SHA1 Message Date
hba56 950a801d16 rounding fix for the xml
#story[1087]
2017-08-07 12:16:37 +12:00
Joseph Gardner 0bf2c6106b Boat updating speed after key press has been fixed. #fix #story[1094] 2017-08-07 12:03:34 +12:00
zwu18 ddaa2623ca Added tests for TackGybeCommand class.
#Story[1097]
2017-08-07 02:56:24 +12:00
fjc40 134586f407 The message encoders and decoders now catch exceptions, and throw InvalidMessageException.
Removed the big switch statement from BinaryMessageDecoder - it now uses the decoder factory instead.
issue #35 #36
#story[1095]
2017-08-06 22:25:43 +12:00
fjc40 9c64b678e3 Added MarkRoundingEncoder.
Refactored MarkRoundingDecoder - it now implements MessageDecoder.
Tidied up MarkRounding - it is now documented and has getters. Also Created MarkRoundingBoatStatusEnum, MarkRoundingIDEnum, MarkRoundingSideEnum, MarkRoundingTypeEnum.
Added MarkRoundingDecoderTest.
issue #35 #36
#story[1095]
2017-08-06 21:38:12 +12:00
fjc40 da800e659a Added AverageWindEncoder.
Refactored AverageWindDecoder - it now implements MessageDecoder.
Refactored AverageWind - it now uses milliseconds and knots, instead of packed MMperSec and tenths of a second. It also exposes its attributes now.
Added (un)packAverageWindPeriod to AC35UnitConverter.
Added AverageWindDecoderTest.
issue #35 #36
#story[1095]
2017-08-06 20:31:21 +12:00
fjc40 ce63f58429 Added RaceStartStatusEncoder.
Added RaceStartTypeEnum.
Refactored RaceStartStatusDecoder to implement the MessageDecoder interface.
Documented RaceStartStatus, and it actually exposes its properties now.
Updated RaceStartStatusDecoderTest.
issue #35 #36
#story[1095]
2017-08-06 19:36:21 +12:00
fjc40 e99ad00294 Javadoc fixes. 2017-08-06 18:54:45 +12:00
fjc40 750ea5c141 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]
2017-08-06 18:51:13 +12:00
zwu18 a388989827 Reworked TackGybeCommand. Current boat in race will now tack and gybe when control is pressed.
#Story[1097]
2017-08-06 16:38:44 +12:00
fjc40 1fbdd09d70 Refactored BoatLocation message, encoders, decoders. It now exposes datatypes that we actually use in the program (double knots, bearings, etc..), instead of the bits-on-the-wire packed units (like int mmPerSec). Also documented it, and updated test.
issue #35 #36
#story[1095]
2017-08-06 16:13:25 +12:00
zwu18 18f14c7542 VMGCommand now toggles autoVMG on and off. Linked up observer and observable so the current boat can now be controlled. Fixed autoVMG not working.
#Story[1097]
2017-08-06 16:12:53 +12:00
fjc40 ff262a6227 Added Knots <-> MMperSec conversions to AC35UnitConverter.
Removed redundant/unused conversions.
Documented all of the conversions, and renamed them to pack/unpackX, to match the API spec.
Updated/added some tests in AC35UnitConverterTest.
RaceStatus now contains a Bearing instead of a packed int bearing.
RaceStatus now contains wind speed in knots, instead of MMperSec packed.
This means that only RaceStatus decoder/encoder need to care about the bits-over-wire packed values.
issue #35 #36
#story[1095]
2017-08-06 14:57:51 +12:00
zwu18 dab0f2b402 Merge branch 'story63' into CommandFactory
# Conflicts:
#	racevisionGame/src/main/java/mock/model/commandFactory/TackGybeCommand.java
2017-08-06 14:54:21 +12:00
zwu18 074e2e590b VMGCommand now toggles autoVMG on and off. Linked up observer and observable so the current boat can now be controlled.
#Story[1097]
2017-08-06 14:48:46 +12:00
fjc40 a0f98eadaa Added some documentation to BoatStatus.
issue #35 #36
#story[1095]
2017-08-06 13:57:09 +12:00
zwu18 3d417c3a40 Merge branch 'story63' into CommandFactory
# Conflicts:
#	racevisionGame/src/main/java/mock/model/MockRace.java
#	racevisionGame/src/main/java/mock/model/RaceLogic.java
#	racevisionGame/src/main/java/mock/model/RaceState.java
#	racevisionGame/src/main/java/mock/model/commandFactory/CommandFactory.java
#	racevisionGame/src/main/java/mock/model/commandFactory/VMGCommand.java
#	racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java
2017-08-06 13:48:41 +12:00
fjc40 b1922fc3fc Added RaceStatusEncoder.
Refactored RaceStatusDecoder to be more consistent with other decoders - it now has a getMessage() function.
Added BoatStatus encoder and decoder - the RaceStatus encoder and decoder uses this for BoatStatuses. The BoatStatus encoder doesn't implement the MessageEncoder interface as BoatStatus is not a proper message type (doesn't inherit from AC35Data).
Added remaining cases to EncoderFactory, but commented them out.
BoatStatus now uses BoatStatusEnum instead of a byte.
Added some comments to RaceStatus, and it uses enums instead of bytes.
MockOutput logs a warning if a RaceStatus cannot be encoded.
Added a BoatStatusDecoderTest.
Updated RaceStatusDecoder to use new encoders/decoders.
issue #35 #36
#story[1095]
2017-08-06 13:38:27 +12:00
fjc40 e464ee298e javadoc fixes for some warnings. 2017-08-06 01:08:47 +12:00
fjc40 b486f99dbe Added XMLMessageEncoder.
Refactored XMLMessageDecoder to be consistent with other decoders - only needs to expose the XMLMessage.
Refactored BoatLocationDecoder to be consistent with other decoders - only needs to expose the BoatLocation.
Updated XMLMessageDecoderTest to use new encoder/decoder. Also tests all three message types.
Removed XMLMessageEncoderTest as it was redundant.
Updated BinaryMessageDecoderTest.xmlMessageTest() to use updated XMLMessage encoder/decoder.
issue #35 #36
#story[1095]
2017-08-06 01:01:05 +12:00
fjc40 8ef906472b Renamed Heartbeat to HeartBeat.
Added HeartBeatDecoder.
Added HeartBeatEncoder.
BinaryMessageDecoder now uses HeartBeatDecoder.
MockOutput now logs a warning if a heartBeat cannot be encoded.
Added HeartBeatDecoderTest.
issue #35 #36
#story[1095]
2017-08-05 23:27:28 +12:00
fjc40 c3ed30019c Added BoatLocationEncoder.
Updated BoatLocationDecoder test to use new encoder.
Updated MockOutput to use new encoder. It logs a warning if encoding fails.

#story[1095]
2017-08-05 22:11:54 +12:00
fjc40 31ce9fff94 Added BoatActonEncoder.
Updated ControllerClient to use RaceVisionByteEncoder.encode(message). It also logs a warning if the encoding fails. Also removed pointless and out of place encode/decode of the action enum.
Added a BoatActionDecoderTest which tests encoding/decoding a BoatAction Message.
issue #35 #36
#story[1095]
2017-08-05 21:53:54 +12:00
fjc40 16686678a7 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]
2017-08-05 21:31:47 +12:00
fjc40 7ea5b31fa1 RequestToJoinEnum contains an int instead of a byte.
Added requestToJoin and joinAcceptance encoding functions to RaceVisionByteEncoder.
Implemented JoinAcceptanceDecoder.
Implemented RequestToJoinDecoder.
Added tests for encoding/decoding RequestToJoin and JoinAcceptance messages.

issue #35
#story[1095]
2017-08-05 20:42:25 +12:00
fjc40 ca2b8a8899 Added missing javadoc.
#story[1095]
2017-08-05 19:43:58 +12:00
fjc40 f65ed79619 Implemented RequestToJoin and JoinAcceptance messages.
Also added their message types to MessageType.

issue #35
#story[1095]
2017-08-05 19:23:32 +12:00
fjc40 1385500e68 Added JoinAcceptance and RequestToJoin enumerations.
Issue #35
#story[1095]
2017-08-05 19:10:15 +12:00
fjc40 7feddeb49f Merge branch 'master' into story48 2017-08-05 15:23:33 +12:00
Connor Taylor-Brown 554f8a2a0f Added WindCommand and multiple command execution to RaceLogic
- Dispatch commands with CompositeCommand
- Single WindCommand handles upwind and downwind logic
- Changed key bindings as Mac lacks PgUp PgDn
- ControllerServer is observable, RaceLogic updates CompositeCommand as observer
2017-08-04 23:08:07 +12:00
hba56 0b74acadff rounding checks are now done by port or starboard side depending on what the compound marks type is
#story[1101]
2017-08-04 22:19:07 +12:00
hba56 db1efab225 rounding checks are now done by port or starboard side depending on what the compound marks type is
#story[1101]
2017-08-04 22:17:17 +12:00
hba56 be8b0e672d Updated the xml reader to pull in the rounding type of the compound marks and set each mark with that value
#story[1101]
2017-08-04 22:01:21 +12:00
Connor Taylor-Brown 425cc7f91f Changed ControlKey to use BoatActionEnum instead of magic numbers. 2017-08-04 21:27:53 +12:00
zwu18 14ce5fcaff Made changes to TackGybeCommand and VMGCommand classes to fit pattern layout.
#Story[1097]
2017-08-04 03:56:55 +12:00
zwu18 6e699f7037 Merge branch 'RaceFactory' into CommandFactory 2017-08-04 03:00:31 +12:00
Connor Taylor-Brown 851bbb4fde Merged branch "RaceFactory" with master 2017-08-03 23:03:15 +12:00
fjc40 148108a658 CommandFactory uses BoatActionEnum instead of raw ints.
#story[1094]
2017-08-03 21:11:25 +12:00
Connor Taylor-Brown c83442761c Implemented Factory for Command objects and fixed Command Pattern implementation.
- Commands now have standard 0-parameter execute method
- Commands are created by CommandFactory

#story[1094]
2017-08-03 17:54:03 +12:00
Joseph Gardner 40a3ed1bb0 Boats now store whether autoVMG is on or off, boat speed scales off their bearing relative to the TWA. #story[1094] 2017-08-03 16:56:52 +12:00
hba56 f212414bd9 Added in a new basis for boats to round marks, gave mockboats a status to say how far through a rounding they are and made a method in GPScoordinate public so it can be used to calculate intersections.
This branch will not run the game any more as boats can't move on to the next leg until they can be controlled by the user.

#story[1087]
2017-08-03 13:27:00 +12:00
fjc40 2e325d5177 Added WindGeneratorTest. 2017-08-03 13:21:53 +12:00
fjc40 e4999a3c93 Added a light variant of the arrow image.
nightMode.css loads this instead of the regular dark arrow.
ResizableRaceCanvas doesn't cache the race boundary background, as it was unneccessary and stopped the canvas from being transparent.
#story[1093]
2017-08-03 12:56:15 +12:00
fjc40 2a5d0938ff Merge branch 'story48' into Development 2017-08-03 11:07:17 +12:00
Connor Taylor-Brown c8621a7be5 Merge branch 'RaceFactory' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7 into RaceFactory 2017-08-03 09:01:27 +12:00
zwu18 d9679c1497 Build failing due to junit even though junit passes all tests. Commented out VMGCommand and TackGybeCommand content. 2017-08-03 01:31:05 +12:00
Connor Taylor-Brown 2672c2b13b Separated RaceLogic from MockRace
- MockRace satisfies refactor requirement for RaceState
- VisualiserRace directly implements Runnable to remove method from MockRace

#story[1094]
2017-08-03 00:32:17 +12:00
zwu18 b581b01a44 Merge branch 'RaceFactory' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7 into RaceFactory
# Conflicts:
#	racevisionGame/src/main/java/mock/model/MockRace.java
2017-08-03 00:28:44 +12:00
zwu18 ad61dc6bce Implemented runCommand method in VMGCommand and TackGybeCommand classes. Both classes currently rely on the MockRace class so changes will be required when MockRace is refactored.
#story[1097]
2017-08-03 00:22:46 +12:00
Connor Taylor-Brown 0466292bd0 Partially removed VMG optimisation, separated server-specific functionality
from MockRace into RaceServer.

#story[1094]
2017-08-02 23:39:13 +12:00