Commit Graph
910 Commits
Author SHA1 Message Date
hba56 fdd0b30a51 Added the ability to hide and show info table with a key press
-the wind arrow also scales with the new size of the screen
2017-08-16 02:04:07 +12:00
Jessica Syder 3d953362a6 Merge branch 'story_61' into 'master'
Story 61

[Agilefant link](http://agilefant.cosc.canterbury.ac.nz:8080/agilefant302/qrq.action?q=story:1095)

```
Note: the boat should be permanently circled with a highlight (or something similar)
See: (http://learn.canterbury.ac.nz/mod/forum/discuss.php?d=213948). Contains boat request to join, and server response messages.

Acceptance criteria:

- The boat that responds to control keypresses is permanently highlighted on screen.
- No boat without a highlight responds to keypresses.
```

Works with either single player or multiplayer game (see HostController.hostGamePressed()).

The race.xml currently is not updated when players join/quit, so there are 6 boats by default, and any boats without playes will just sail off the side of the map.

- resolves #39 
- resolves #37 
- resolves #35 
- resolves #27 
- resolves #25 
- resolves #32 


See merge request !26
2017-08-16 00:00:08 +12:00
fjc40 85e703cba5 RaceController/info table now makes a copy of the boat list, to avoid race conditions.
#story[1095]
2017-08-15 23:10:32 +12:00
fjc40 bcb6b79f8d Fixed player boat not being highlighted.
#story[1095]
2017-08-15 22:41:43 +12:00
fjc40 a4755ed88b Maybe fixed updating boat list on FX thread. 2017-08-15 21:08:56 +12:00
fjc40 0483859c40 Fixed sparkline y axis labelling. Reverted it to how it previously worked (negative data values instead of negative scale).
issue #32
2017-08-15 20:40:29 +12:00
fjc40 9ab12a9c58 MockBoat: Removed redundant isAutoVMG() function.
TackGybeCommand now disables autoVMG.
Removed print statements from VMGCommand.
2017-08-15 18:48:14 +12:00
fjc40 dc4610d6eb Fixed sparkline not updating.
#story[1095]
2017-08-15 18:41:28 +12:00
fjc40 5ae8393126 Fixed null pointer exception when a boat finishes the race.
Boats now default to have position (0, 0).
Added mark rounding data to single player race.xml
2017-08-15 17:13:12 +12:00
fjc40 3a0bd10a57 Merge remote-tracking branch 'origin/master' into story_61
# Conflicts:
#	racevisionGame/src/main/java/mock/model/MockRace.java
#	racevisionGame/src/main/java/mock/model/commandFactory/CommandFactory.java
#	racevisionGame/src/main/java/visualiser/gameController/ControllerClient.java
#	racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java
#	racevisionGame/src/main/resources/visualiser/scenes/race.fxml
2017-08-15 14:49:58 +12:00
fjc40 c9875f3987 RaceLogic no longer uses AnimationTimer for its main loop (since that ran in javafx thread). 2017-08-15 14:37:36 +12:00
Connor Taylor Brown ab9aeeb58f Merge branch 'CommandFactory' into 'master'
Tacking and gybing merge request

Note: this allows the player to perform a common maneuver, changing tack, quickly. The goal is to change the boat's heading from one tack to another with a single keypress.
If the boat is heading upwind, the keypress will cause the boat to tack through head-to-wind, so that the wind shifts from one side of the boat to the other. The TWA (true wind angle) after tacking should be 360-TWA(before_tacking).
Similarly for gybing if the boat is initially heading downwind, except that the boat's heading always remains away from the wind.

Acceptance criteria:

- The wind shifts from one side of the boat to the other on keypress
- When heading upwind the boat should tack on keypress
- When heading downwind the boat should gybe on keypress

[Manual test](https://eng-git.canterbury.ac.nz/seng302-2017/team-7/wikis/manual-test:-tacking-and-gybing)

See merge request !24
2017-08-15 12:06:20 +12:00
cbt24 da52082d70 Deleted duplicate method (again -.-) 2017-08-15 11:40:22 +12:00
Connor Taylor-Brown 847cd1251e Merge remote-tracking branch 'remotes/origin/master' into CommandFactory
# Conflicts:
#	racevisionGame/src/main/java/mock/model/commandFactory/TackGybeCommand.java
#	racevisionGame/src/main/java/mock/model/commandFactory/VMGCommand.java
2017-08-15 01:01:06 +12:00
Connor Taylor-Brown b97bfe62a6 Fixed documentation bugs not relevant to story. 2017-08-15 00:52:50 +12:00
Fan-Wu Yang cdcd326b7c Merge branch 'story68' into 'master'
Story68



See merge request !25
2017-08-14 13:05:26 +12:00
hba56 1bdf80417d javadoc
#story[1087]
2017-08-14 12:14:55 +12:00
hba56 0ff4e9871d Merge remote-tracking branch 'remotes/origin/master' into story68 2017-08-14 12:13:24 +12:00
Fan-Wu Yang eebdd3806e Added .idea/codeStyleSettings.xml to the git ignore 2017-08-14 04:06:14 +12:00
fjc40 175fb11178 Javadoc fixes.
#story[1095]
2017-08-14 01:02:58 +12:00
fjc40 7366aba5ec Added empty data sources, to be used by VisualiserRace.
Created FrameRateTracker which can be used to track framerate.
Updated RequestToJoinEnum and JoinAcceptanceEnum to match the agreed connection API.
Added AssignPlayerBoat message, which is used internally on the client to assign the player a source ID once they have connected.
Fixed some race conditions in the MessageRouter.
Updated ConnectionAcceptor.CheckClientConnection to wait slightly longer before removing connection (there was a slight race condition before).
Race no longer has a reference to LatestMessages. LatestMessages no longer has specific messages types in it.
Created RaceState class, which contains the state that is shared between VisualiserRaceState and MockRaceState (currently only used on visualiser).
Split VisualiserRace into VisualiserRaceState and VisualiserRaceService.
Added the VisualiserRace commands (BoatLocatonCommand, RaceStatusCommand, etc...).
Slightly increased the preferred width of race.fxml table columns.
issues #27 #37 #35
#story[1095]
2017-08-14 00:53:05 +12:00
hba56 dc9317fe2e remove system.out statments
#story[1101]
2017-08-13 19:33:46 +12:00
hba56 67bb7b81dc Merge remote-tracking branch 'origin/story68' into story68 2017-08-13 19:10:31 +12:00
hba56 0d786f381b fix for boats finishing the race
#story[1101]
2017-08-13 19:10:16 +12:00
hba56 2acc36225e Fix for placement of invis gates and checks that boats pass through these gates
-see wiki on rounding
#story[1101]
2017-08-13 18:11:53 +12:00
Jessica Syder 8b1561cdc7 Fixed nullpointer when boat passes finish line.
- Added a condition in calculateBearingToNextMethod to avoid nullpointer
2017-08-13 16:08:14 +12:00
hba56 f90648e4ce Fixing a silly mistake where starboard side rounding checks for a port side rounding (Thank goodness for documenting manual tests)
#story[1101]
2017-08-12 23:40:28 +12:00
hba56 a05ffd023d Fixing a silly mistake where starboard side rounding checks for a port side rounding (Thank goodness for documenting manual tests)
#story[1101]
2017-08-12 22:55:25 +12:00
hba56 f386a4b989 added checks for gates and moved second rounding check to be in line with the next mark to move towards
#story[1101]
2017-08-12 22:27:27 +12:00
hba56 fe91264aec fix for the tests
#story[1101]
2017-08-12 21:10:31 +12:00
fjc40 89b0aa8b77 Implemented MessageRouter.
Added ConnectionToServerCommandFactory, and JoinSuccessfulCommand, RaceParticipantsFullCOmmand, ServerFullCommand.
Added IncomingHeartBeatCommandFactory, and IncomingHeartBeatCommand.
Added ConnectionToServerState, which represents the client's connection state to server.
Renamed VisualiserInput to VisualiserRaceController.
Added ConnectionToServer, which tracks the client's connection to server.
Added ConnectionToServerController, which accepts JoinAcceptance messages, turns them into commands, and passes them to ConnectionToServer.
Added IncomingHeartBeatService, which tracks the heart beat status of the connection.
Added IncomingHeartBeatController, which accepts HeartBeat messages, turns them into commands, and passes them to IncomingHeartBeatService.
Refactored ServerConnection a bit.
#story[1095]
2017-08-12 19:58:47 +12:00
hba56 62e37489ee starboard rounding update
#story[1101]
2017-08-12 03:41:50 +12:00
hba56 d70a711a3d Merge branch 'master' into story68
-updated port and starboard boat checks
-added gps method to check if on correct side of a line
-updated pos check method to make boats round marks with the new tech

# Conflicts:
#	racevisionGame/src/main/java/mock/app/ConnectionAcceptor.java
#	racevisionGame/src/main/java/mock/app/Event.java
#	racevisionGame/src/main/java/mock/model/commandFactory/TackGybeCommand.java
#	racevisionGame/src/main/java/mock/model/commandFactory/VMGCommand.java
2017-08-12 03:26:28 +12:00
hba56 499a409d4f Merge branch 'master' into story68
-updated port and starboard boat checks
-added gps method to check if on correct side of a line
-updated pos check method to make boats round marks with the new tech

# Conflicts:
#	racevisionGame/src/main/java/mock/app/ConnectionAcceptor.java
#	racevisionGame/src/main/java/mock/app/Event.java
#	racevisionGame/src/main/java/mock/model/commandFactory/TackGybeCommand.java
#	racevisionGame/src/main/java/mock/model/commandFactory/VMGCommand.java
2017-08-12 03:24:20 +12:00
zwu18 848edfc6a4 Removed commented out code. Merged master in.
#story[1097]
2017-08-12 03:20:21 +12:00
zwu18 c3ea62dfee Merge branch 'master' into CommandFactory
# Conflicts:
#	racevisionGame/src/main/java/mock/app/ConnectionAcceptor.java
#	racevisionGame/src/main/java/mock/app/Event.java
#	racevisionGame/src/main/java/mock/model/commandFactory/TackGybeCommand.java
#	racevisionGame/src/main/java/mock/model/commandFactory/VMGCommand.java
#	racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java
2017-08-12 03:18:24 +12:00
zwu18 9c902dab46 Added javadoc to classes.
#story[1097]
2017-08-12 02:11:23 +12:00
fjc40 6e5fb62880 Added REQUEST_RECEIVED and DECLINED to ConnnectionStateEnum.
#story[1095]
2017-08-12 01:05:45 +12:00
fjc40 41b0a5d7f7 Merge branch 'story_61' of eng-git.canterbury.ac.nz:seng302-2017/team-7 into story_61 2017-08-11 22:38:55 +12:00
fjc40 b625b6ab05 XMLReader.readXMLFileToString no longer throws a Transformer exception. 2017-08-11 22:38:39 +12:00
zwu18 e4b72fdfeb Update appearance on client arrow.
#story[1095]
2017-08-11 20:38:54 +12:00
fjc40 61d18f85c5 javadoc fixes. 2017-08-10 23:57:54 +12:00
fjc40 19984772c0 Merge branch 'master' into story_61
Also got client-server handshake working. Multiple clients can connect and control their own boat.
The client's boat has a larger black triangle drawn around it. Probably needs tidying up.
Added isClientBoat boolean to VisualiserBoat.

WindGenerator is now an interface, implemented by ConstantWindGenerator (useful for testing) and RandomWindGenerator. Added ConstantWindGeneratorTest.
RandomWindGenerator was formerly WindGenerator.
The WindGenerator is passed in to MockRace.

CommandFactory throws a CommandConstructionException if it cannot create a command.

MessageSerialiser and MessageDeserialiser correctly terminate on error.

Readded VisualiserInput's switch statement in the main loop, pending a refactor.

Removed the sleep statement from LobbyController - it was blocking javaFX thread.

Lobby.fxml: moved buttons and text input into grid panes, so they don't break when you resize screen.

Added some test object creation functions in several test classes (MockRaceTest.createMockRace(), BoatXMLReaderTest.createBoatDataSource(), etc...).

#story[1095]
2017-08-10 23:49:21 +12:00
Fraser Cope a8af866228 Merge branch 'pom_profile_fix' into 'master'
Pom profile fix

The racevisionGame pom still had "profiles", which aren't needed with a single jar build, and the built jar didn't have a mainifest/main class.

See merge request !19
2017-08-10 13:29:05 +12:00
fjc40 5bc51343f5 Merge remote-tracking branch 'origin/master' into pom_profile_fix 2017-08-10 13:25:08 +12:00
Fraser Cope cdb6219cce Merge branch 'issue_28_36_decoders' into 'master'
Issue 28 & 36 - encoders and decoders refactor

This resolves #28 #36.
This was on the story_61 branch, but I figured it may be helpful to push this into master/other branches before then.

The main changes:
- Moved encoding functions from RaceVisionByteEncoder into their own encoder classes.
- Added a EncoderFactory and DecoderFactory, which return correct en/decoder based on MessageType.
- All encoders implement MessageEncoder interface, and all decoder implement MessageDecoder interface.

Extra changes:
- Added names to most threads that are created.
- Removed the nested while loop from MockOutput, and moved the XML stuff before the main loop (functionally it's the same).

See merge request !23
2017-08-10 13:21:42 +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
fjc40 39b5cc2edc MockBoat has autoVMG disabled by default.
Wind/Tack commands disable autoVMG. VMG command enables it.
Upwind command was turning until boat was at 0 degrees, instead of being aligned with wind direction, but that's fixed.
#story[1096]
2017-08-10 12:44:42 +12:00