Commit Graph
403 Commits
Author SHA1 Message Date
Joseph Gardner d8628b4289 Boats now start the race with sails out. #story[1098] 2017-08-10 13:25:57 +12:00
fjc40 130ffcbf07 Fixed some merge issues. 2017-08-10 13:16:53 +12:00
fjc40 805c12bf41 Merge remote-tracking branch 'origin/master' into issue_28_36_decoders
# Conflicts:
#	racevisionGame/src/main/java/mock/app/ConnectionAcceptor.java
#	racevisionGame/src/main/java/mock/app/Event.java
#	racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java
2017-08-10 13:12:26 +12:00
Fraser Cope 7b382e48ac Merge branch 'story63' into 'master'
63. [C, M] I'd like to be able to make small adjustments to the heading of my boat, as Gemma, either upwind or downwind.

Note: each keypress should change the boat's heading by a small amount (3 degrees?) Pressing the 'upwind' key will turn the boat's head towards the wind by that small amount, while the 'downwind' key will do the opposite. Continuing to press the downwind key when the boat is already heading straight downwind, or upwind when heading directly upwind, achieves nothing.

Acceptance criteria:

- The player boat turns towards wind a small amount for each press of the 'upwind' key.
- The player boat turns away from the wind by a small amount for each press of the 'downwind' key.
- If the boat heading is directly into wind after a series of 'upwind' keypresses, the heading will continue to change in the same direction for one more keypress.
- Substitute 'downwind' for 'upwind' for the downwind case.


See merge request !21
2017-08-10 12:57:21 +12:00
Jessica Syder 321dcde72f Implemented luffing sail without image (yet).
- Added sailsLuff image property
- Displayed luffing sail in correct position and angle

#story[1098]
2017-08-10 12:49:00 +12:00
hba56 4da3734804 added the ability to toggle the race guide line on and off
#story[1087]
2017-08-10 12:17:19 +12:00
fjc40 7cc39abe57 WIP. Probably need to cherry pick stuff out of here.
Added ClientConnection and server-side handshake.
Added MessageSerialiser and Deserialiser.
#story[1095]
2017-08-10 12:13:40 +12:00
Joseph Gardner 1302769a50 Merge branch 'Development' into story_64_sails
# Conflicts:
#	racevisionGame/src/main/java/mock/model/commandFactory/CommandFactory.java
#	racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java
#	racevisionGame/src/test/java/mock/model/MockBoatTest.java
2017-08-10 11:56:09 +12:00
Joseph 41d09f587e Merge branch 'master' into story_64_sails
# Conflicts:
#	racevisionGame/src/main/java/visualiser/gameController/Keys/ControlKey.java
#	racevisionGame/src/main/java/visualiser/gameController/Keys/SailsToggleKey.java
#	racevisionGame/src/main/java/visualiser/gameController/Keys/VMGKey.java
#	racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java
2017-08-10 08:58:43 +12:00
hba56 74f04a13f8 Merge remote-tracking branch 'origin/Development' into Development 2017-08-09 23:27:04 +12:00
hba56 e53d72f24b compound marks now can give the mark they have that needs to be rounded this is used to draw the line around the correct mark
#story[1101]
2017-08-09 23:25:42 +12:00
Connor Taylor-Brown da9915174c Merge branch 'master' into Development 2017-08-09 23:05:07 +12:00
Connor Taylor-Brown 3cf0cf2ee0 Merge branch 'master' into story63 2017-08-09 22:56:55 +12:00
Connor Taylor-Brown 638413da1a Merge remote-tracking branch 'remotes/origin/story63' into Development 2017-08-09 22:46:26 +12:00
Jessica Syder ce973fecfe Sails are displayed correctly for all wind and active boat directions.
- Figured out the different situations that can occur using accurate points of sail
- Mathed out the rotation angle for each situation
- Manual testing carried out by running simulations
- Manual testing carried out using pen and paper

#story[1098]
2017-08-09 21:48:17 +12:00
Connor Taylor-Brown e021dd328d Changed CompositeCommand stack to queue
#story[1096]
2017-08-08 23:56:59 +12:00
hba56 e2605c3c7c Merge remote-tracking branch 'remotes/origin/story68' into Development 2017-08-08 23:29:57 +12:00
hba56 bb75806781 Cleaned up line to be in a shippable shape
#story[1101]
2017-08-08 23:23:46 +12:00
fjc40 3ec87582d3 Merge remote-tracking branch 'origin/master' into story_61 2017-08-08 20:58:53 +12:00
hba56 22722286ef all paths now join up
#story[1087]
2017-08-08 14:47:11 +12:00
zwu18 53c9192130 Merge branch 'CommandFactory' into Development
# Conflicts:
#	racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java
2017-08-08 02:52:29 +12:00
hba56 ef3f468b19 arrows displayed for each leg
#story[1101]
2017-08-08 00:02:07 +12:00
Jessica Syder ace1252c1d Fixed sails so they behave correctly
- Changed sail angle calculations back
- Luffing currently displays no sail as a temporary representation of sails in

#story[1098]
2017-08-07 17:40:21 +12:00
Connor Taylor-Brown 8ee4e84236 Merge remote-tracking branch 'remotes/origin/story63' into Development
# Conflicts:
#	racevisionGame/src/main/java/mock/model/MockBoat.java
#	racevisionGame/src/main/java/mock/model/MockRace.java
2017-08-07 15:02:13 +12:00
Joseph Gardner f6cdf66bfe Sails can be toggled on the visualiser and the rotate sails button rotates the sail visually. #story[1098] 2017-08-07 15:01:16 +12:00
Connor Taylor-Brown 55798447ab Cherry-picked CommandFactory connection between ControllerServer and RaceLogic.
#story[1096]
2017-08-07 14:25:30 +12:00
hba56 62752c142a building blocks for drawing the race line around the course
#story[1087]
2017-08-07 12:47:55 +12:00
Jessica Syder 7c5670f8c2 Sails are displayed on first boat in a race. Optimised imports.
- Implemented drawSails method
- Sail position is displayed and updated using a boat's heading
- Sails conform to 'Points of sail'
- Javadoc'd new method and tidied up existing
- Sped up track point frequency (visualiserBoat class)
- Optimised imports (any other classes changed)
- A lot of canvas drawing and sail rotating issues were discovered and eventually overcome along the way. Using a sail image to draw and rotate on the existing canvas rather than a JavaFX shape on a new canvas was the final decision.

#story[1098]
2017-08-07 12:20:52 +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 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
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
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 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 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 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 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 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
Connor Taylor-Brown 425cc7f91f Changed ControlKey to use BoatActionEnum instead of magic numbers. 2017-08-04 21:27: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 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
fjc40 e1905e9e36 javadoc fix. 2017-08-02 18:27:40 +12:00
fjc40 9889a474ee Added ArrowController. This is the controller for arrow.fxml.
Removed arrow control stuff from ResizableRaceCanvas.
Added a wind speed label to arrow.fxml. Also created an outer GridPane to lay things out.
#story[1093]
2017-08-02 18:24:43 +12:00
Joseph Gardner 51bbdf9a50 Merge branch 'issue_26_wind' into RaceFactory
# Conflicts:
#	racevisionGame/src/main/java/mock/model/MockRace.java
#	racevisionGame/src/main/java/shared/model/Race.java
#	racevisionGame/src/main/java/visualiser/model/VisualiserRace.java
2017-08-02 15:04:55 +12:00
Joseph Gardner 81eeca3533 Split wind off from Race and made it its own class. Deleted dnfChance as it is no longer used. 2017-08-02 13:45:10 +12:00
fjc40 99f3310d8b Created a setWind(bearing, knots) in Race, which updates the Wind with new values.
MockRace now uses Wind.
VisualiserRace now uses Wind.
#story[1093]
2017-08-01 18:45:17 +12:00
David Wu f2932e8bae New branch created for development. 2017-08-01 12:29:05 +12:00
Fan-Wu Yang 442920f9f6 DOD, and added javadocs/fixed javadocs #story[1087] 2017-07-27 16:24:19 +12:00
Jessica Syder 9eaf24e699 Fixed title screen having whitespace on different screen resolutions.
- Title screen has no white space on edges
- Main controller now anchors title to corners of main window

#story[1087] #pair[fjc40, jam339]
2017-07-27 14:54:56 +12:00