Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprint 5 - closed #96

Merged
merged 219 commits into from
Jul 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
219 commits
Select commit Hold shift + click to select a range
b0ecc58
Added messages that GUI can send to GameViewActor notifying for user …
siboxd Jul 23, 2018
e63e3a7
Moved GameViewActor Companion object below class
siboxd Jul 23, 2018
9d20595
Iniziata rifattorizzazione Authentication DAO
DavideBorficchia Jul 24, 2018
fc1d469
rifattorizzato test
DavideBorficchia Jul 24, 2018
00b3b74
Merge pull request #75 from siboXD/feature/gameViewActorGUIIntegration
siboxd Jul 24, 2018
4fcf175
Aggiunta documentazione
DavideBorficchia Jul 24, 2018
22064f8
- Added methods in GeometricUtils to calculate distance from a straig…
siboxd Jul 24, 2018
cc95ccd
- Added GameViewActor behaviour on reception of AddAttack message
siboxd Jul 24, 2018
0ac92a5
- Added constructor parameter in GameViewActor to make possible to ha…
siboxd Jul 24, 2018
dae2693
Added GameViewActor documentation
siboxd Jul 24, 2018
b3d6f61
- Added a thickness strategy in TentacleView
siboxd Jul 24, 2018
a823854
- Moved companion object in PlayerActor below class behaviour
siboxd Jul 24, 2018
b937a13
- Better generified DistributedState
siboxd Jul 24, 2018
a1dfd78
CellWorldDistributedState was taking as implicit input the "self" ins…
siboxd Jul 24, 2018
7ce7498
risolto bug della dimensione delle celle e aggiunta energia celle in …
DavideBorficchia Jul 24, 2018
1e34b6d
Made GameViewActor not to modify directly local world when a view act…
siboxd Jul 24, 2018
20d926c
Added action on external distributed state update, notifying GameView…
siboxd Jul 24, 2018
22855e4
Moved companion object of ClientControllerActor below class
siboxd Jul 24, 2018
5e9feac
Added some doc to core classes and reorganized code
siboxd Jul 24, 2018
aae17ea
- Removed JsonFormat trait that wasn't used
siboxd Jul 24, 2018
b4c22ea
Solved Warnings of Vertx during tests, checking if a vertx instance i…
siboxd Jul 24, 2018
acd2c7b
- Moved a utility conversion from Seq to JsonArray in general VertxJD…
siboxd Jul 24, 2018
a35be66
- Added doc
siboxd Jul 24, 2018
fd6c864
Added doc to core-testing classes
siboxd Jul 24, 2018
c02a402
Added doc
siboxd Jul 24, 2018
8adbc82
- Added doc
siboxd Jul 24, 2018
c49e256
- Added doc
siboxd Jul 24, 2018
ca013a1
Fixed bug introduced replacing random ID generation
siboxd Jul 24, 2018
82614e9
aggiunta documentazione
DavideBorficchia Jul 25, 2018
14f00dd
ora l'energia della cella viene disegnata al centro
DavideBorficchia Jul 25, 2018
31a0231
lavorando alla visualizzazione dell'istante
DavideBorficchia Jul 25, 2018
76c3144
iniziata gestione dell'eccezione di non inizializzazione
DavideBorficchia Jul 25, 2018
0ffccb1
eliminato commenti
DavideBorficchia Jul 25, 2018
f8496c0
Removed unused import
siboxd Jul 25, 2018
8ce574b
aggiunto check inizialized DAO
DavideBorficchia Jul 25, 2018
0288d30
Merge pull request #78 from DavideBorficchia/feature/draw_info_GUI
siboxd Jul 25, 2018
9e5ed0b
Merge branch 'develop' into feature/gameViewActorGUIIntegration
siboxd Jul 25, 2018
02a19e3
Solved a problem after merge with GameViewActor constructor
siboxd Jul 25, 2018
990d3bd
Made javaFx colors the default and replaced present conversion to awt…
siboxd Jul 25, 2018
835c7fb
- Moved constant of TentacleView in its proper class
siboxd Jul 25, 2018
7935906
Moved CellView energy font inside CellView class constant
siboxd Jul 25, 2018
e9109d4
Merge pull request #77 from siboXD/feature/gameViewActorGUIIntegration
siboxd Jul 25, 2018
991ca45
- Added doc
siboxd Jul 25, 2018
af7c6bb
Services main classes now are mixed in with VertxInstance
siboxd Jul 25, 2018
4a8e929
aggiunti test per il check dell'inizializzazione del DAO
DavideBorficchia Jul 25, 2018
b8cc279
Reformatted and refactored some code in rooms testing classes
siboxd Jul 25, 2018
f75f83c
Merge branch 'develop' into feature/generalFixes
siboxd Jul 25, 2018
2627d5a
Moved CellWorldDistributedState int impl package of game model
siboxd Jul 25, 2018
7f4b633
Moved GeometricUtils out of game.impl package, because they are gener…
siboxd Jul 25, 2018
e3a9a99
rifattorizzato test e aggiunta doc
DavideBorficchia Jul 25, 2018
a5c4d66
Removed old TODO
siboxd Jul 25, 2018
4629db5
Merge pull request #76 from DavideBorficchia/feature/refactoring_stor…
siboxd Jul 25, 2018
1c1563c
Merge branch 'develop' into feature/generalFixes
siboxd Jul 25, 2018
d46c488
- Renamed StorageDAO to AuthenticationDAO
siboxd Jul 25, 2018
df5a845
- Adjusted misspelling
siboxd Jul 25, 2018
698c0f0
Used implicit conversion to JsonArray embedded in VertxJDBC
siboxd Jul 25, 2018
d82eaae
- Renamed Test for AuthenticationLocalDAO accordingly
siboxd Jul 25, 2018
5393da3
Renamed methods avoiding warnings
siboxd Jul 25, 2018
3e5166d
Moved constants in RoomsTesting to companion object
siboxd Jul 25, 2018
afe1a76
Added a plugin to view tasks dependencies (which tasks are launched s…
siboxd Jul 25, 2018
de96333
"build" task already calls "shadowJar" for projects, so it's waste of…
siboxd Jul 25, 2018
7b6040a
Merge pull request #79 from siboXD/feature/generalFixes
siboxd Jul 25, 2018
ce45c33
Created a FontSize constant in GameViewConstants
siboxd Jul 25, 2018
9b95e70
- Added default Game font size and color to GameViewConstants
siboxd Jul 25, 2018
1ad5a54
Added CellView capability to transport energy text color
siboxd Jul 25, 2018
192bb0a
Now radius value is used as it was thought
siboxd Jul 25, 2018
ccce89a
Implemented cellViewSizing between a minimum and maximum sizes
siboxd Jul 25, 2018
fa87d4d
- Solved warnings in Cell (due to wildcard imports)
siboxd Jul 25, 2018
2567443
Solved warnings in CellWorld and Tentacle (due to wildcard imports)
siboxd Jul 25, 2018
5764cde
- Added doc to ParticipantListReceiver
siboxd Jul 25, 2018
b0a6fd8
Reworded doc for CellView
siboxd Jul 25, 2018
7f23264
Added a TentacleView class
siboxd Jul 25, 2018
86f5570
- Added implicit conversion from Tentacle to TentacleView
siboxd Jul 25, 2018
9a90f16
Added private modifiers where missing
siboxd Jul 25, 2018
213aa59
Added GameFX doc
siboxd Jul 25, 2018
5edf9b9
Added a method to convert colors to HexDecimal strings
siboxd Jul 25, 2018
4f5e155
- Modified TentacleView to piggyback the reached point of the tentacle
siboxd Jul 25, 2018
46f7fe4
Renamed drawArch to drawTentacle
siboxd Jul 25, 2018
96e1982
Another comment from italian to english in ObjectDrawer
siboxd Jul 25, 2018
81b36d2
Renamed implicit method cellToViewCell to cellToView
siboxd Jul 25, 2018
b31d4e3
Refactored GameViewActor:
siboxd Jul 25, 2018
3830269
Modified ViewTitle to more appropriate CellWars
siboxd Jul 25, 2018
66552ca
eliminato parametro inutilizzato
DavideBorficchia Jul 25, 2018
e99d91c
Added check if Color calculated by ColorHash is a color used in GUI
siboxd Jul 25, 2018
a4642c2
prima implementazione della visualizzazione del tempo nella GUI
DavideBorficchia Jul 25, 2018
c1ac87f
corretto distrazione
DavideBorficchia Jul 25, 2018
ffb6971
visualizzato tempo nella GUI
DavideBorficchia Jul 25, 2018
53aeb90
Merge pull request #82 from DavideBorficchia/feature/display_instant_gui
siboxd Jul 25, 2018
27a6ccb
Merge branch 'develop' into feature/cellProperSizing
siboxd Jul 25, 2018
578ba72
Merge pull request #81 from siboXD/feature/cellProperSizing
siboxd Jul 25, 2018
880798c
Merge branch 'develop' into feature/modelAndViewModelRefactor
siboxd Jul 25, 2018
a06625d
- Modified ObjectDrawer to a more specific CellWorldObjectDrawer
siboxd Jul 25, 2018
13e4e24
Refactored drawInstant method to use an option instead of a boolean flag
siboxd Jul 25, 2018
220687e
Added GameViewConstants for time text font and color
siboxd Jul 25, 2018
34ffc76
Reformatted code
siboxd Jul 25, 2018
8901ae8
Merge pull request #83 from siboXD/feature/modelAndViewModelRefactor
siboxd Jul 26, 2018
8c7493a
aggiunta trasparenza per il tempo visualizzato nella GUI
DavideBorficchia Jul 26, 2018
16f031b
rifattorizzato codice
DavideBorficchia Jul 26, 2018
2f76cce
aggiunta formattazione del tempo trascorso di gioco
DavideBorficchia Jul 26, 2018
a773345
Merge pull request #84 from DavideBorficchia/feature/transparency_ins…
siboxd Jul 26, 2018
09e7236
Refactored CellView to contain it's border parameter and it's default…
siboxd Jul 26, 2018
838867f
Renamed constant in GameViewConstants
siboxd Jul 26, 2018
119eabf
Removed redundant conversion to rgb color in GameViewConstants
siboxd Jul 26, 2018
db5a849
- Added Doc
siboxd Jul 26, 2018
e1bf8d4
Added GameTimeText color in check of used colors when selecting user …
siboxd Jul 26, 2018
d4d9c7f
Added an object in GameFX that will manage user made events on GUI
siboxd Jul 26, 2018
0208de6
Replaced flag management with Option type in UserEventHandler
siboxd Jul 26, 2018
d2072dd
Added methods to communicate to GameViewActor
siboxd Jul 26, 2018
42a0938
- Modified GameFx to hold a reference to GameViewActor
siboxd Jul 26, 2018
2f491d3
Removed useless variable
siboxd Jul 26, 2018
e35e4d1
Added Check if attack is being made from one cell to same cell
siboxd Jul 26, 2018
373839e
Further separated GameViewActor behaviours
siboxd Jul 26, 2018
3610e4a
- Re-enabled flag management in GameFx UserEventHandler
siboxd Jul 26, 2018
3f5d6be
Solved a BUG that made not possible to use RoomService:
siboxd Jul 26, 2018
62a4bd1
Removed unused import
siboxd Jul 26, 2018
5fe2e40
Added a better error message in VertxClient
siboxd Jul 26, 2018
0f38001
Modified AuthenticationApiWrapper to have a method nextHeader that re…
siboxd Jul 26, 2018
dd5d922
Merge branch 'feature/authLocalDAOBugFix' into feature/userActionToDi…
siboxd Jul 26, 2018
b096bb1
- Removed useless parameter in DistributeState and its subclass
siboxd Jul 26, 2018
4dca5e3
Solved a bug in TentacleView
siboxd Jul 26, 2018
2440b1c
Now there's better synchronization between games because of the Write…
siboxd Jul 26, 2018
4070632
Merge pull request #86 from siboXD/feature/authLocalDAOBugFix
siboxd Jul 26, 2018
ed7a683
Augmented time between game frames, so it's now more lightweight to c…
siboxd Jul 26, 2018
ba41d39
Merge pull request #80 from siboXD/feature/gradleTaskTreeVisualization
siboxd Jul 26, 2018
29bd004
Merge pull request #87 from siboXD/feature/userActionToDistributedWor…
siboxd Jul 26, 2018
9488f04
Travis CI Speedup
siboxd Jul 26, 2018
8e68c37
Silenced logging in tests for all services
siboxd Jul 26, 2018
f07d95f
create classe per la visualizzazione del dialog di attesa
DavideBorficchia Jul 27, 2018
996e234
aggiunto metodo per customizzare il comportamente alla ricezione di u…
DavideBorficchia Jul 27, 2018
3106766
Merge pull request #88 from siboXD/feature/travisCIBuildSpeedUp
siboxd Jul 27, 2018
c635251
rifattorizzato nomi componenti e iniziata la visualizzazione dei dial…
DavideBorficchia Jul 27, 2018
78c3abf
aggiunti messaggi di loading nella fase di autenticazione
DavideBorficchia Jul 27, 2018
9b56227
eliminati alert non user-friendly
DavideBorficchia Jul 27, 2018
8801f74
fixato bug dialog registrazione
DavideBorficchia Jul 27, 2018
fdeb53e
rifattorizzato codice
DavideBorficchia Jul 27, 2018
74e8dd3
Modified .gitignore to ignore all .iml files
siboxd Jul 27, 2018
6c26c5d
Merge pull request #89 from DavideBorficchia/feature/loading_dialog
siboxd Jul 27, 2018
115c148
Merge pull request #90 from siboXD/feature/gitignoreFix
siboxd Jul 27, 2018
6a1aca4
aggiunta la possibilità di selezionare il token dal dialog
DavideBorficchia Jul 27, 2018
7bdbe90
finita implementazine visualizzazione dialog selezionabile
DavideBorficchia Jul 27, 2018
fd1af5f
rifattorizzato codice
DavideBorficchia Jul 27, 2018
fef123c
formattato codice
DavideBorficchia Jul 27, 2018
881d8b9
rifattorizzato codice per il tokenDialog
DavideBorficchia Jul 27, 2018
79bc518
Merge pull request #91 from DavideBorficchia/feature/dialog_seleziona…
siboxd Jul 27, 2018
6268a54
- Refactored RoomsLocalDAO method to use for comprehension instead of…
siboxd Jul 27, 2018
b60cb05
Other refactoring in RoomsLocalDAO companion object
siboxd Jul 27, 2018
d51a9cf
Moved duplicated code in RoomsServiceUtils
siboxd Jul 27, 2018
f45fcd5
- Removed unused constants from RoomsServiceUtils (moved to RoomServi…
siboxd Jul 27, 2018
1f7d939
Removed class RoomsServiceUtils because of its contents too specific …
siboxd Jul 27, 2018
4f8bb44
Solved compilation problem
siboxd Jul 27, 2018
67b3be9
Refactored internal error and success handling in RoomsServiceVerticle
siboxd Jul 27, 2018
b52d63f
- Started refactoring RoomsLocalDAOTest with for comprehension
siboxd Jul 27, 2018
f8f6731
RoomsLocalDAO for comprehension refactoring completed
siboxd Jul 27, 2018
4bf51d8
Replaced all Future.successful(Unit) with Future.successful(())
siboxd Jul 27, 2018
56b036d
- Further refactored RoomsLocalDAOTest
siboxd Jul 27, 2018
aba58e3
Finished refactoring RoomsServiceVerticleTest
siboxd Jul 27, 2018
de805b8
- Started refactoring RoomsApiWrapperTest with for comprehension
siboxd Jul 27, 2018
9a2bbfb
Finished refactoring of RoomsApiWrapper
siboxd Jul 27, 2018
b4c214d
Refactored AuthenticationLocalDAO with for comprehension
siboxd Jul 27, 2018
2ef8656
Merge pull request #92 from siboXD/feature/roomsRefactor
siboxd Jul 28, 2018
b3c585b
- Renamed FXDialogs to FXLoadingDialogs
siboxd Jul 28, 2018
a66f3eb
Moved showTokenDialog to RoomFXController because it's a specific beh…
siboxd Jul 28, 2018
15bc382
- Generified FxLoadingDialogs and renamed back to FXDialogs
siboxd Jul 28, 2018
cb1eff8
Solved compilation problems
siboxd Jul 28, 2018
6e1a15d
Made RoomFXController showTokenDialog method reuse FXDialogs structure
siboxd Jul 28, 2018
862ce2e
- Translated and added doc
siboxd Jul 28, 2018
ef62951
- Merged FXDialogs and FXAlerts
siboxd Jul 28, 2018
d98920e
- Moved loading management in a private object
siboxd Jul 28, 2018
5bdf5e4
Renamed AlertActor to ActorAlertManagement
siboxd Jul 28, 2018
56652e7
Finished refactoring ActorAlertManagement
siboxd Jul 28, 2018
df59e4e
Separated AuthenticationFXController from declaration of its strategy
siboxd Jul 28, 2018
4dc9c51
Renamed AuthenticationFXStrategy to a simpler AuthenticationStrategy
siboxd Jul 28, 2018
5f09087
Added documentation to FXInputChecks
siboxd Jul 28, 2018
9fbd8e1
Refactoring FXView
siboxd Jul 28, 2018
e9862ef
Moved ParicipantListReceiver to controller package
siboxd Jul 28, 2018
dcf4df6
Started refactoring on ClientControllerActor
siboxd Jul 28, 2018
4159254
Moved utility methods to end of class
siboxd Jul 28, 2018
ee8d04b
Reordered and better separated behaviours
siboxd Jul 28, 2018
bbd5947
Renamed a method and added doc
siboxd Jul 28, 2018
03e024d
- Added messages classes (authentication for now is complete)
siboxd Jul 28, 2018
434c0e1
- Created a class for Rooms messages
siboxd Jul 28, 2018
acd8f71
- Removed where possible Sting = null replacing with Option[String] =…
siboxd Jul 28, 2018
ca0c455
Made messages classes sealed
siboxd Jul 28, 2018
b1d13a8
Solved compilation problems after last modifications
siboxd Jul 28, 2018
2f566b1
- Renamed common messages classes adding a "common" suffix
siboxd Jul 28, 2018
06acb48
Moved ActorAlertManagement to controller package
siboxd Jul 28, 2018
f0bbfd1
- Refactored AuthenticationFxController
siboxd Jul 28, 2018
330ac7b
Renamed some classes and variables
siboxd Jul 28, 2018
b386cfb
Renamed FXInputView to FXInputViewManagement
siboxd Jul 28, 2018
13e6d1d
Renamed some classes
siboxd Jul 28, 2018
905ad0d
- Created a new ActorViewVisibilityManagement to add common behaviour…
siboxd Jul 28, 2018
c2413e4
Refactored Strings
siboxd Jul 28, 2018
cf83b4c
- Moved room creation and entering messages coming from room view int…
siboxd Jul 28, 2018
7220e4c
Refactored View actors moving common parts to FXViewActor
siboxd Jul 28, 2018
43c1d20
Solved compilation problems
siboxd Jul 28, 2018
149e55d
- Separated RoomStrategy from RoomFXController
siboxd Jul 28, 2018
9e82218
- Saved some space moving annotation near declarations
siboxd Jul 28, 2018
fa9a3f6
- Modified FXML method name
siboxd Jul 28, 2018
3c570b3
Added contribution headers and left TODOs where needed
siboxd Jul 28, 2018
3179cbe
Merge pull request #93 from siboXD/feature/clientRefactoring
siboxd Jul 29, 2018
2318007
Renamed FXViewActor to FXServiceViewActor
siboxd Jul 29, 2018
f74d875
Refactored FXAlertsController to accept closure actions for every dialog
siboxd Jul 29, 2018
5ad54f0
Refactoring AuthenticationFXController, moving some actions to Authen…
siboxd Jul 29, 2018
266b2c4
- ClientControllerActor Refactoring (fixed info messages sending to V…
siboxd Jul 29, 2018
13febcf
- Started refactoring RoomFXController moving view disabling logic to…
siboxd Jul 29, 2018
de1b702
MOdified a method in FXAlerts that in case of a dialogContent was not…
siboxd Jul 29, 2018
c25f324
Added possibility to copy the token to system clipboard, for an easy use
siboxd Jul 29, 2018
a2c50ab
Added type hierarchy to Authentication Common messages
siboxd Jul 29, 2018
76498f8
- Removed unnecessary comments in Authentication commons
siboxd Jul 29, 2018
d6e9519
Added rooms exiting messages to Rooms common requests
siboxd Jul 29, 2018
f101740
- Now RoomsViewActor shows a loading while waiting for other players
siboxd Jul 29, 2018
1b15727
- Refactored type hierarchy in Rooms common messages
siboxd Jul 29, 2018
96fcab5
Implemented stopping participant list receiver in case no more necessary
siboxd Jul 29, 2018
68678b5
Solved a little bug that made loading dialog not disappear after erro…
siboxd Jul 29, 2018
c2e6867
Solved misspelling
siboxd Jul 29, 2018
39b7067
Merge pull request #94 from siboXD/feature/clientRefactoring
siboxd Jul 30, 2018
f8653bf
Updated sprint 5 backlog
siboxd Jul 30, 2018
f2f8455
Updated project version number
siboxd Jul 30, 2018
d6a4622
Merge pull request #95 from siboXD/develop
siboxd Jul 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fabric.properties
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
*.iml
# modules.xml
# .idea/misc.xml
# *.ipr
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ env:
global:
- secure: "dRKFshApyl4AUJFX35C3GfeYoV7jFjZirDj9YbNMSegvEMf6eIiapdBP/GfnCYKmOCO9cuZU3p2hUHGNNZYRdDcuP12SlrCVfxDnLkqPgwuZKGm0T0yAsACVJZRD/uNfy5HMiCPMDyT+h9pqMlBj+LsCov46AlaQdmwS9luIjPWNA+Ter17javVpLLzsRH+8Vsh1UtiEk4seIHkhOlxQLaAEvoTr2kRrI048C3aVYY8hDIMNrK/OPiVwF+83ZeXbZL0Q9E+QnmXimAB/lS7VleW4DD1g4JI9NL3HHAJbe3yDHdwRb/fYLX/ZpT0MA0qgYSlxwT2hrpFYQa/HgRUN2jREpSLWxnfKd1QQYXuxTGQaI9WUd+j+8ppvvJZHqdqc8QGMRHrodtdYcDJhYk5Z1nOlkVux+Axt/x4o63RJtZ7dX8JTsHyFW415FhnK56iGfRTLe7aipYuepZcxeydWrEis8+hy7eVuPwxH0qiCHugHRlzyTJZLR9z6peXg0IeDpCULm4Wy7LX/xHSagk4CFbqHghzdMtcaCSn9q7ooFv5RWqHYEq+szAAl/usYN5MuN2g1ZD7T4BooWJdUbntELiLh4yBpAkFaW0VTN1A5N+UK/QdCzFG0Sl6VXYGxU3/93fgbhf7Q1v+Q/H7wc5GrGQy+4R425WCYXilOksFJkWk="
script:
- './gradlew'
- './gradlew clean build -x test javadoc scaladoc reportScoverage'
after_success:
- 'bash scripts/commit_and_upload.sh -r iuginP/pps-17-cw-mp -b master -s latest-docs/scala -d scala'
- 'bash scripts/commit_and_upload.sh -r iuginP/pps-17-cw-mp -b master -s latest-docs/java -d java'
Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def scalaStyleOutputPath = "${buildDir.path}$scalaStyleOutput"
allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: "com.dorongold.task-tree"

repositories {
// Repositories where to find libraries
Expand Down Expand Up @@ -112,6 +113,8 @@ buildscript {
}
}
dependencies {
classpath "gradle.plugin.com.dorongold.plugins:task-tree:1.3"

classpath "gradle.plugin.org.scoverage:gradle-scoverage:2.3.0"
classpath "gradle.plugin.com.github.maiflai:gradle-scalatest:0.22"

Expand All @@ -121,4 +124,4 @@ buildscript {
}
}

defaultTasks 'clean', 'build', 'javadoc', 'scaladoc', 'reportScoverage', 'shadowJar'
defaultTasks 'clean', 'build', 'javadoc', 'scaladoc', 'reportScoverage'
24 changes: 12 additions & 12 deletions client/src/main/resources/layouts/roomManagerLayout.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@
</font>
</Label>
<TextField GridPane.rowIndex="0" GridPane.columnIndex="1" id="pr_cr_roomName"
fx:id="pr_cr_roomName" layoutX="115.0" layoutY="28.0"/>
fx:id="tfPrivateCreateRoomName" layoutX="115.0" layoutY="28.0"/>
<Label GridPane.rowIndex="1" GridPane.columnIndex="0" layoutX="240.0"
layoutY="68.0" text="Numero dei giocatori">
<font>
<Font size="24.0"/>
</font>
</Label>
<Spinner fx:id="pr_cr_numPlayer" id="numPlayer" GridPane.rowIndex="1"
<Spinner fx:id="spPrivateCreateNumPlayer" id="numPlayer" GridPane.rowIndex="1"
GridPane.columnIndex="1">
<valueFactory>
<SpinnerValueFactory.IntegerSpinnerValueFactory min="2" max="4"/>
</valueFactory>
</Spinner>
<Button GridPane.rowIndex="4" GridPane.columnIndex="0"
<Button fx:id="btnPrivateCreate" GridPane.rowIndex="4" GridPane.columnIndex="0"
GridPane.halignment="CENTER" layoutX="111.0" layoutY="95.0"
mnemonicParsing="false" onAction="#onClickCreate" prefHeight="25.0"
mnemonicParsing="false" onAction="#onClickCreatePrivate" prefHeight="25.0"
prefWidth="70.0" text="Crea"/>
<Button GridPane.rowIndex="4" GridPane.columnIndex="0"
<Button fx:id="btnPrivateReset" GridPane.rowIndex="4" GridPane.columnIndex="0"
GridPane.halignment="RIGHT" layoutX="111.0" layoutY="95.0"
mnemonicParsing="false" onAction="#onClickReset" prefHeight="25.0"
mnemonicParsing="false" onAction="#onClickResetPrivate" prefHeight="25.0"
prefWidth="70.0" text="Reset"/>
</GridPane>
</TitledPane>
Expand All @@ -55,10 +55,10 @@
</font>
</Label>
<TextField GridPane.rowIndex="0" GridPane.columnIndex="1" id="pr_et_roomID"
fx:id="pr_et_roomID" layoutX="115.0" layoutY="28.0"/>
<Button GridPane.rowIndex="2" GridPane.columnIndex="0"
fx:id="tfPrivateEnterRoomID" layoutX="115.0" layoutY="28.0"/>
<Button fx:id="btnPrivateEnter" GridPane.rowIndex="2" GridPane.columnIndex="0"
GridPane.halignment="RIGHT" layoutX="111.0" layoutY="95.0"
mnemonicParsing="false" onAction="#onClickEnter" prefHeight="25.0"
mnemonicParsing="false" onAction="#onClickEnterPrivate" prefHeight="25.0"
prefWidth="70.0" text="Entra"/>
</GridPane>
</TitledPane>
Expand All @@ -69,15 +69,15 @@
<!-- Pane per entrare in una stanza pubblica -->
<!-- Contenuto pane -->
<GridPane hgap="30" vgap="10" alignment="TOP_CENTER">
<Spinner fx:id="pub_et_numPlayer" id="numPlayer" GridPane.rowIndex="1"
<Spinner fx:id="spPublicEnterNumPlayer" id="numPlayer" GridPane.rowIndex="1"
GridPane.columnIndex="1">
<valueFactory>
<SpinnerValueFactory.IntegerSpinnerValueFactory min="2" max="4"/>
</valueFactory>
</Spinner>
<Button GridPane.rowIndex="1" GridPane.columnIndex="2"
<Button fx:id="btnPublicEnter" GridPane.rowIndex="1" GridPane.columnIndex="2"
GridPane.halignment="CENTER" layoutX="111.0" layoutY="95.0"
mnemonicParsing="false" onAction="#onClickRoomPublic" prefHeight="25.0"
mnemonicParsing="false" onAction="#onClickEnterPublic" prefHeight="25.0"
text="Entra" />
</GridPane>
</VBox>
Expand Down
7 changes: 4 additions & 3 deletions client/src/main/scala/it/cwmp/client/ClientMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import akka.actor.{ActorSystem, Props}
import com.typesafe.config.ConfigFactory
import it.cwmp.client.controller.ClientControllerActor

/**
* The client entry point
*/
object ClientMain extends App {
val APP_NAME = "ClientApp"
val APP_NAME = "CellWarsClient"

private val config = ConfigFactory.parseString("akka.remote.netty.tcp.port=0").withFallback(ConfigFactory.load())

val system = ActorSystem(APP_NAME, config)

val clientControllerActor = system.actorOf(Props(classOf[ClientControllerActor], system), ClientControllerActor.getClass.getName)
}
2 changes: 1 addition & 1 deletion client/src/main/scala/it/cwmp/client/GameMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object GameMain extends App {

val system = ActorSystem(APP_NAME, config)

val gameActor = system.actorOf(Props(classOf[GameViewActor]), GameViewActor.getClass.getName)
val gameActor = system.actorOf(Props(classOf[GameViewActor], null), GameViewActor.getClass.getName)

import GameViewActor._

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package it.cwmp.client.controller

import akka.actor.Actor.Receive
import it.cwmp.client.controller.AlertMessages._
import it.cwmp.client.view.FXAlertsController

/**
* A trait that gives autonomous management of alert messages;
*
* To use it you need to add "alertBehaviour" to your Actor receive
*
* @author Eugenio Pierfederici
* @author contributor Enrico Siboni
*/
trait ActorAlertManagement {

/**
* @return the alerts controller
*/
protected def fxController: FXAlertsController

/**
* @return the behaviour that manages alert messages
*/
protected def alertBehaviour: Receive = {
case Info(title, message) => onInfoAlertReceived(title, message)
case Error(title, message) => onErrorAlertReceived(title, message)
}

/**
* Called when a info alert is received
*
* @param title the title of the info
* @param message the message of the info
*/
protected def onInfoAlertReceived(title: String, message: String): Unit =
fxController showInfo(title, message)

/**
* Called when an error alert is received
*
* @param title the title of the error
* @param message the message of the error
*/
protected def onErrorAlertReceived(title: String, message: String): Unit =
fxController showError(title, message)
}

/**
* A collection of AlertMessages
*/
object AlertMessages {

/**
* Tells to show info message
*
* @param title the title
* @param message the message
*/
case class Info(title: String, message: String)

/**
* Tells to show an error message
*
* @param title the title
* @param message the message
*/
case class Error(title: String, message: String)

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package it.cwmp.client.controller

import akka.actor.Actor.Receive
import it.cwmp.client.controller.ViewVisibilityMessages.{Hide, Show}
import it.cwmp.client.view.{FXRunOnUIThread, FXViewController}

/**
* A trait that give autonomous management to view visibility
*
* To use it you need to add "visibilityBehaviour" to your Actor receive
*
* @author Enrico Siboni
*/
trait ActorViewVisibilityManagement extends FXRunOnUIThread {

/**
* @return the visibility controller
*/
protected def fxController: FXViewController

/**
* @return the behaviour that manages alert messages
*/
protected def visibilityBehaviour: Receive = {
case Show => onShowGUI()
case Hide => onHideGUI()
}

/**
* Called when GUI is shown
*/
protected def onShowGUI(): Unit = runOnUIThread(() => fxController showGUI())

/**
* Called when GUI is hidden
*/
protected def onHideGUI(): Unit = runOnUIThread(() => fxController hideGUI())
}


/**
* A collection of view visibility messages
*/
object ViewVisibilityMessages {

/**
* Shows the underlying graphical interface
*/
case object Show

/**
* Hides the underlying graphical interface
*/
case object Hide

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package it.cwmp.client.controller

import akka.actor.Actor
import it.cwmp.client.controller.messages.AuthenticationRequests.{LogIn, SignUp}
import it.cwmp.client.controller.messages.AuthenticationResponses.{LogInFailure, LogInSuccess, SignUpFailure, SignUpSuccess}
import it.cwmp.client.controller.messages.RoomsRequests.{ServiceCreate, ServiceEnterPrivate, ServiceEnterPublic}
import it.cwmp.client.controller.messages.RoomsResponses._
import it.cwmp.services.wrapper.{AuthenticationApiWrapper, RoomsApiWrapper}
import it.cwmp.utils.Utils.stringToOption

import scala.concurrent.ExecutionContext.Implicits.global
import scala.language.implicitConversions
import scala.util.{Failure, Success, Try}

/**
* A class that implements the actor that will manage communications with services APIs
*/
case class ApiClientActor() extends Actor {

override def receive: Receive = authenticationBehaviour orElse roomsBehaviour

/**
* @return the behaviour of authenticating user online
*/
private def authenticationBehaviour: Receive = {
val authenticationApiWrapper = AuthenticationApiWrapper()
//noinspection ScalaStyle
import authenticationApiWrapper._
{
case LogIn(username, password) =>
val senderTmp = sender
login(username, password).onComplete(replyWith(
token => senderTmp ! LogInSuccess(token),
exception => senderTmp ! LogInFailure(exception.getMessage)
))
case SignUp(username, password) =>
val senderTmp = sender
signUp(username, password).onComplete(replyWith(
token => senderTmp ! SignUpSuccess(token),
exception => senderTmp ! SignUpFailure(exception.getMessage)
))
}
}

/**
* @return the behaviour of managing the rooms online
*/
private def roomsBehaviour: Receive = {
val roomApiWrapper = RoomsApiWrapper()
//noinspection ScalaStyle
import roomApiWrapper._
{
case ServiceCreate(roomName, playersNumber, token) =>
val senderTmp = sender
createRoom(roomName, playersNumber)(token).onComplete(replyWith(
token => senderTmp ! CreateSuccess(token),
exception => senderTmp ! CreateFailure(exception.getMessage)
))
case ServiceEnterPrivate(idRoom, address, webAddress, token) =>
val senderTmp = sender
enterRoom(idRoom, address, webAddress)(token).onComplete(replyWith(
_ => senderTmp ! EnterPrivateSuccess,
exception => senderTmp ! EnterPrivateFailure(exception.getMessage)
))
case ServiceEnterPublic(nPlayer, address, webAddress, token) =>
val senderTmp = sender
enterPublicRoom(nPlayer, address, webAddress)(token).onComplete(replyWith(
_ => senderTmp ! EnterPublicSuccess,
exception => senderTmp ! EnterPublicFailure(exception.getMessage)
))
}
}

/**
* A utility method to match Success or failure of a try and do something with results
*
* @param onSuccess the action to do on success
* @param onFailure the action to do on failure
* @param toCheck the try to check
* @tparam T the type of the result if present
*/
private def replyWith[T](onSuccess: => T => Unit, onFailure: => Throwable => Unit)
(toCheck: Try[T]): Unit = toCheck match {
case Success(value) => onSuccess(value)
case Failure(ex) => onFailure(ex)
}
}
Loading