Commit Graph
50 Commits
Author SHA1 Message Date
cbt24 7d64a43350 Allow collision checking to provide collision parameters to ray casting method
- Added tests for MockBoat collision direction and distance

#story[1100]
2017-08-15 13:47:59 +12:00
cbt24 2fbb96afd7 Created ray casting methods for MockBoat and CompoundMark
- Added ColliderRegistry to Race
- Added collision triggering to RaceLogic
- Created basic collision handlers for MockBoat and CompoundMark
2017-08-15 12:57:26 +12:00
Connor Taylor-Brown 7474de9816 Created foundation classes and interfaces for collision architecture.
- Added Collider interface
- Added Collision class
- Added ColliderRegistry class

#story[1100]
2017-08-11 14:05:36 +12:00
Connor Taylor-Brown e021dd328d Changed CompositeCommand stack to queue
#story[1096]
2017-08-08 23:56:59 +12:00
Connor Taylor-Brown dad4fa57c6 Fixed WindCommand not updating downwind command when moving upwind.
#story[1096]
2017-08-07 14:51:32 +12:00
Connor Taylor-Brown 55798447ab Cherry-picked CommandFactory connection between ControllerServer and RaceLogic.
#story[1096]
2017-08-07 14:25:30 +12:00
Connor Taylor-Brown e76de1cbf9 Added test for WindCommand
#story[1096]
2017-08-07 14:13:14 +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 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
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
zwu18 7fc1347377 Created class TackGybeCommand which implements the CommandFactory interface.
#story[1097]
2017-08-02 22:28:47 +12:00
Joseph Gardner b258e94a54 Merged wind generator into this branch. #story[1094] 2017-08-02 15:19:32 +12:00
Joseph Gardner fba256113a Merged wind generator into this branch. #story[1094] 2017-08-02 15:09:59 +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
fjc40 ed12ff659d mock:
Moved wind generation logic and state into the WindGenerator class.
MockRace initialises this, and calls it to update wind.
2017-08-02 13:59:19 +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
Joseph Gardner 775c32ca92 Made new branch for command architecture. 2017-08-02 12:48:56 +12:00
Joseph Gardner a87879eaa9 Made new branch for command architecture. 2017-08-02 12:41:47 +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
Fan-Wu Yang 442920f9f6 DOD, and added javadocs/fixed javadocs #story[1087] 2017-07-27 16:24:19 +12:00
Jessica Syder 402df18b71 Merge remote-tracking branch 'remotes/origin/master' into css 2017-07-27 14:31:33 +12:00
Joseph Gardner 6492ba89ab Merging main features into story 6. App now sends and receives key strokes. #story[1007, 1089] 2017-07-27 12:36:34 +12:00
Connor Taylor-Brown cc264f318e Added ControllerClient and ControllerServer
- StartController sets up client-wide ControllerClient on socket to game server.
- RaceController now calls ControllerClient.sendKey with each keypress
- ConnectionAcceptor runs ControllerServer for each successfully connected client

#story[1089]
2017-07-26 22:57:01 +12:00
zwu18 88604df66d Merge branch 'cbt-multi-controller' into css
# Conflicts:
#	racevisionGame/src/main/java/mock/app/App.java
#	racevisionGame/src/main/java/visualiser/Controllers/ConnectionController.java
#	racevisionGame/src/main/java/visualiser/app/App.java
#	racevisionGame/src/main/java/visualiser/model/RaceConnection.java
#	racevisionGame/src/main/resources/visualiser/scenes/connect.fxml
2017-07-26 20:54:07 +12:00
zwu18 9c9b98f882 Added functionality to host game and join a game in lobby. Host name and game name are not implemented yet.
#story[1087]
2017-07-26 20:42:36 +12:00
Connor Taylor-Brown 7e3e865563 Host starts with button in ConnectionController
- Converted Event to Singleton for configuring and hosting no more than one game instance.
- Retrieve address and port from ConnectionAcceptor
- Automatically add local host to host list

#story[1010]
2017-07-25 15:52:53 +12:00
Fan-Wu Yang eec0cb3493 Added fairness to mockOuput list so the index will correspond to the player in order that they entered the hosted game, #story[1010] 2017-07-24 17:40:46 +12:00
Fan-Wu Yang cfd858194e Removed Unecessary Print Messages
- Removed xml's printing at the start as well as the amount of visualisers connected from spamming the log.
- Issue of visualisers connecting when not actually connecting was actually an visual issue as the log spits out the number of visualisers right now before the loop has gotten rid of the useless sockets.
#story[1010]
2017-07-24 17:36:47 +12:00
Fan-Wu Yang 9f99e21232 Added functionality for more than one visualiser to connect to the mock.
- more than one visualiser can now connect to the mock.
- Created class ConnectionAcceptor that will accept and allocate to each socket
- Issue of sockets connecting after the race starts then disconnecting will use a socket slot.
#story[1010]
2017-07-24 17:27:49 +12:00
hba56 0d5bede349 java doc fixes to fix the ci build problems
#story[1003]
2017-07-21 10:25:36 +12:00
fjc40 5cddaaed8e mock.app.App now tells mock.app.Event that the xml file strings are XMLFileType.Contents.
Made network.MessageEncoders.RaceVisionByteEncoder methods static (they were effectively static already).

shared.dataInput.XMLReader#readXMLFileToString(..) now throws an XMLReaderException if the file cannot be found.

visualiser.Controllers.StartController assumed XML messages were resource paths instead of file contents - fixed.

Testing:
networking tests now work again.
2017-07-20 01:01:29 +12:00
fjc40 4bcfc01ceb shared.dataInput:
Added shared.enums.XMLFileType, which is used to specify if a string contains a file path or file contents.
Updated the XML readers to use it.

Testing:
Moved the networking tests and resources into racevisionGame module.
Moved the remaining tests from visualiser into racevisionGame, and added a few empty tests to implement later.
2017-07-19 23:18:52 +12:00
fjc40 10e80bca05 Moved mock.app.App#readFile(...) to shared.dataInput.XMLReader#readXMLFileToString(...).
Did the bare minimum to get the mock.model, mock.dataInput, shared.model tests working - many of them need to be tidied/refactored/moved as they don't take into account most of the refactorings.
2017-07-19 22:30:21 +12:00
fjc40 7d3cf6ee80 I had accidentally broken the raceXML construction - fixed it.
Fixed a few issues where boat didn't have nextMark/previousMark times under certain circumstances.
LatestMessages wasn't actually notifying properly - fixed.
The various XML readers now treat a string constructor as containing file contents, not file name - this was how it was mostly already used.
Fixed some issues in RaceXMLReader, including where element.getChildNodes() was used instead of element.getElementsByName(...).
Boat: changes speed to a doubleProperty. Changed leg to a Property<Leg>.
Race.lastFps is now an IntegerProperty.
Added breaks to the case statements in VisualiserInput. Whoops.
ResizableRaceCanvas now handles drawing the race boundary. Tidied up code a bit.
Removed ResizableRaceMap.

Started refactoring Sparkline. Currently doesn't work.
2017-07-10 08:35:43 +12:00
fjc40 abbbf70146 Refactored Race, MockRace, and VisualiserRace to use RaceClock instead of keeping their own timers.
Moved FPS tracking to Race class, so both VisualiserRace and MockRace can monitor their FPS.
LatestMessages is now observable. It notifies observers when an XMLMessage is received.
Boat now has StringProperty for name and country/abbreviation.
Moved the MockRace timescale value to Constants.RaceTimeScale. This is passed in to MockRace on construction.
Tidied up StartController.
Copied the visualiser's resources into the resources folder.
Refactored RaceClock. Added comments. Tidied code a bit. Moved to shared.model.

Started work on RaceController.
2017-07-08 23:21:29 +12:00
fjc40 f057ad58b7 LatestMessages can hold MarkRounding messages. It also holds XMLMessage for each message type.
MockOutput now uses LatestMessages for xml messages.
Moved xml message encoding into RaceVisionByteEncoder. Removed XMLMessageEncoder.
Moved XML message sub types into an enumeration (XMLMessageType).
XMLMessage can now be queried for its attributes (like timestamp, length, etc...).

VisualiserInput now uses LatestMessages.
VisualiserInput now (as it did previously) uses switch statements for checking packet type, instead of if statements.
VisualiserRace now uses LatestMessages instead of VisualiserInput.
2017-07-07 02:05:21 +12:00
fjc40 8e18ad62ca Added LatestMessages to network.Messages. This is an object that encapsulates the latest up to date set of race messages.
Race stores a reference to it. MockRace writes to it, and eventually, VisualiserRace will read from it.
Updated MockRace, MockOutput, Event to use it.

Angle now implements hashCode().
2017-07-06 16:02:11 +12:00
fjc40 3a0b81834f Refactored mock.Event to work with MockRace.
Fixed the networking imports.
Race now keeps a reference to its Race, Boat, and Regatta data sources.
VisualiserRace can be provided with new Race/Boat/Regatta data sources during runtime. Currently it updates boundary and legs with a new RaceDataSource, and marker boats with a new BoatDataSource.
2017-07-06 15:25:00 +12:00
fjc40 8d36d89570 Refactored and moved RaceXMLReader to shared/dataInput.
RaceStatus can provide windspeed in knots in addition to mm/sec.
RaceDataSource now provides a list of participating boat sourceIDs instead of boats.
Added a RegattaDataSource interface.
Angle, Azimuth, Bearing and mutable - careful.
Boat has positionInRace.
CompoundMarks have an ID and name.
Marks can be moved (setPosition(...)).

Refactored Mock.Race, Visualiser.StreamedCourse, Visualiser.StreamedRace, into (shared) Race, MockRace, VisualiserRace.

VisualiserBoat has color.
Added xml and polar files into resources folder.
2017-07-06 01:30:55 +12:00
fjc40 7f027c8cc5 Refactored and moved XMLReader, RaceDataSource, BoatXMLReader, BoatDataSource, RegattaXMLReader to shared/dataInput. 2017-07-04 17:50:43 +12:00
fjc40 d0d63ca236 Copied remaining files into appropriate package. These need to be refactored and put into the shared package. 2017-07-04 16:22:25 +12:00
fjc40 bbbb1f2eb0 Renamed sharedModel module to racevisionGame - this is intended to be our single module program.
Moved Boat/MockBoat/VisualiserBoat into it.
Moved Polars, polarParser, VMG, and polar exception.
Moved the networking stuff into it.
Moved angle, azimuth, bearing into it.
Moved gpscoordinate into it.
Moved mark/compoundMark into it.
Moved leg into it.
Moved trackpoint into it.
2017-07-04 15:53:17 +12:00