795 Commits

Author SHA1 Message Date
Fleischer Hanno
b7a3790f81 added final Presentation 2024-12-17 16:46:20 +01:00
Hanno Fleischer
56112f01bb Update README.md 2024-12-16 13:34:39 +00:00
Hanno Fleischer
75ce695029 Update README.md 2024-12-16 11:24:35 +00:00
Hanno Fleischer
9af54051da Update README.md 2024-12-16 11:24:24 +00:00
Hanno Fleischer
ccf77f052f repositioned Logger for server shutdown 2024-12-16 12:14:09 +01:00
Hanno Fleischer
0d3e93b681 fixed test for state transition 2024-12-16 12:12:21 +01:00
Hanno Fleischer
ab4c7159f3 Server now closes correctly when host is leaving 2024-12-16 12:08:18 +01:00
Fleischer Hanno
61ea4c3276 the game will now create a new clg when entering the main view 2024-12-16 11:38:31 +01:00
Fleischer Hanno
e8506e607c removed icon for app when using apple due to problems 2024-12-16 11:23:27 +01:00
Hanno Fleischer
0c46477f01 Update README.md 2024-12-15 10:04:49 +00:00
Hanno Fleischer
3ba1c62685 Merge branch 'development2' into 'main'
fixed Icons; edited smoke particles; removed test code

See merge request progproj/gruppen-ht24/Gruppe-01!43
2024-12-14 09:14:59 +00:00
Hanno Fleischer
82aa9f6a51 fixed double copunting of played cards and now calculating correct travled nodes 2024-12-14 10:13:46 +01:00
Cedric Beck
9c9702b2c5 fixed setIcons; edited smoke particles; removed test code 2024-12-14 01:28:43 +01:00
Hanno Fleischer
d6ae8f3bdc Merge branch 'development2' into 'main'
Converted Music and deleted unused modules

See merge request progproj/gruppen-ht24/Gruppe-01!42
2024-12-13 20:54:51 +00:00
Cedric Beck
a3e6db6573 deleted unused modules; converted music 2024-12-13 20:26:08 +01:00
Cedric Beck
c7cba412fe Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-13 14:24:33 +01:00
Cedric Beck
caa370fec2 added icon 2024-12-13 14:23:45 +01:00
Hanno Fleischer
5c61c8c263 Merge branch 'main' into 'development2'
fixed failing test, due to wrong assertions or missing messages, as well as...

See merge request progproj/gruppen-ht24/Gruppe-01!41
2024-12-13 13:05:31 +00:00
Cedric Beck
d8eefeb348 renamed boardHandler methods 2024-12-13 14:01:24 +01:00
Hanno Fleischer
3f07400cf8 fixed failing test, due to wrong assertions or missing messages, as well as rewriting the 'addBonusCards()' method in Game to not use duplicates 2024-12-13 14:00:54 +01:00
Hanno Fleischer
e3ec2aaba8 added leave button logic to interrupt state 2024-12-13 11:14:14 +01:00
Timo Brennförder
70e31e15c7 added StartDialogTest and started PlayerTests 2024-12-13 10:58:13 +01:00
Hanno Fleischer
b891e78647 Add README.md 2024-12-13 09:28:06 +00:00
Hanno Fleischer
ff41183643 Merge branch 'development2' into 'main'
Version 1.0

See merge request progproj/gruppen-ht24/Gruppe-01!40
2024-12-13 09:26:49 +00:00
Hanno Fleischer
3658a91b7b added possiblity to build jar file and override shutdown behavior when closing via alt-f4 or the close button of the window 2024-12-13 10:15:45 +01:00
Benjamin Feyer
1e5c5bd5eb added T016 2024-12-13 05:58:22 +01:00
Benjamin Feyer
23d4bf31a7 added testcase T004 2024-12-13 05:49:23 +01:00
Benjamin Feyer
5826d93be4 added test case T003 2024-12-13 05:47:30 +01:00
Benjamin Feyer
9c3b949e5a corrected javaDoc in GameTest 2024-12-13 05:24:15 +01:00
Benjamin Feyer
81223653f9 added Piecetest T005/T006 2024-12-13 05:15:30 +01:00
Benjamin Feyer
28c06c931e added the game-test 6/7 (T008-T009) 2024-12-13 04:25:37 +01:00
Benjamin Feyer
f93da332b3 added the game-test8 t010 2024-12-13 04:20:18 +01:00
Benjamin Feyer
379e4bcec1 corrected a pieceTest 2024-12-13 04:08:36 +01:00
Benjamin Feyer
dc7dae5db9 added some gameTests and reformatted ServerStateTests 2024-12-13 04:07:00 +01:00
Benjamin Feyer
702154c018 fixed PieceTest18 2024-12-13 02:52:11 +01:00
Benjamin Feyer
032cd76ec2 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-13 02:39:59 +01:00
Benjamin Feyer
5c8dce0626 finished the serverStateTests 2024-12-13 02:39:48 +01:00
Benjamin Feyer
911ab42101 edited some tests for the server 2024-12-13 02:18:45 +01:00
Benjamin Feyer
ea3f4df636 aaded some tests! 2024-12-13 01:59:34 +01:00
Timo Brennförder
065a626307 added Tests for LobbyStateTests 2024-12-13 00:44:37 +01:00
Timo Brennförder
2ec9b3a246 added NetworkDialogClientTests
testEnterIP -> passes
testEnterPort -> can't be tested in model
testConnectToServer -> passes
testCantConnectToServer -> passes
testCancelJoining -> passes
2024-12-12 20:53:04 +01:00
Benjamin Feyer
48d6516073 fixed and added some tests 2024-12-12 15:01:57 +01:00
Benjamin Feyer
0d4685f3c2 added some tests and corrected some tests and added logic for the tests like getter and setter 2024-12-12 13:46:23 +01:00
Benjamin Feyer
d12b0b6a77 fixed some tests 2024-12-12 02:58:30 +01:00
Benjamin Feyer
4dda9229b3 fixed some tests 2024-12-12 02:02:29 +01:00
Benjamin Feyer
e6453b2f1b Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-12 01:03:04 +01:00
Benjamin Feyer
af8ab21e5f fixed some tests 2024-12-12 01:02:55 +01:00
Hanno Fleischer
d21e963d33 Merge remote-tracking branch 'origin/development2' into development2 2024-12-12 00:21:13 +01:00
Hanno Fleischer
1f3b07709c added java docs to NoPieceState 2024-12-12 00:20:15 +01:00
Benjamin Feyer
a6215b9986 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-12 00:03:32 +01:00
Benjamin Feyer
6381d7b3b9 fixed some tests 2024-12-12 00:03:24 +01:00
Hanno Fleischer
176affa9c5 added java docs to view 2024-12-11 23:58:32 +01:00
Benjamin Feyer
67ea9ede18 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-11 23:32:30 +01:00
Benjamin Feyer
173cbe31e5 fixed some tests 2024-12-11 23:32:19 +01:00
Hanno Fleischer
c13152bb29 added java docs to model 2024-12-11 23:31:52 +01:00
Benjamin Feyer
a3d0056f7f finished clientStateTests 2024-12-11 21:54:14 +01:00
Benjamin Feyer
06dcc4c0e4 fixed buck 2024-12-11 20:19:15 +01:00
Benjamin Feyer
61e168cefb fixed buck 2024-12-11 20:08:26 +01:00
Benjamin Feyer
cecd7e1a23 fixed buck 2024-12-11 19:59:01 +01:00
Hanno Fleischer
f9772732c4 added better network support and disconnecting doesnt clos the client who hosts the server now 2024-12-11 19:10:46 +01:00
Benjamin Feyer
f09766eb42 Merge remote-tracking branch 'origin/development2' into development2
# Conflicts:
#	Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/FirstRollState.java
#	Projekte/mdga/model/src/test/java/pp/mdga/client/clientState/ClientStateTest.java
#	Projekte/mdga/model/src/test/java/pp/mdga/game/PieceTest.java
2024-12-11 17:16:26 +01:00
Benjamin Feyer
62e3dd7932 fixed some tests 2024-12-11 17:13:59 +01:00
Hanno Fleischer
d80499a18a Merge remote-tracking branch 'origin/development2' into development2 2024-12-11 16:50:18 +01:00
Hanno Fleischer
4b665c4cf2 getter and setter fo isDied 2024-12-11 16:49:45 +01:00
Cedric Beck
3048caf5c9 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-11 14:23:44 +01:00
Cedric Beck
b8df688ba3 added highlight/hover/select to nodes 2024-12-11 14:23:24 +01:00
Hanno Fleischer
8201ab4b63 added error handling when the drawpile is empty 2024-12-11 14:11:07 +01:00
Felix Koppe
14a407b7d5 Merge commit 2024-12-11 13:57:43 +01:00
Felix Koppe
170a282077 Add selectNext 2024-12-11 13:56:55 +01:00
Hanno Fleischer
5854609b12 added notification to change to startdialog state when calling next in statitics state 2024-12-11 13:43:15 +01:00
Hanno Fleischer
ea25f66dae wrote getter for ceremonyview in mdga app 2024-12-11 13:34:38 +01:00
Felix Koppe
c069a61f2d Merge commit 2024-12-11 13:12:51 +01:00
Felix Koppe
07029407d8 Add ceremony 2024-12-11 13:11:48 +01:00
Hanno Fleischer
42a73ceb24 after switching from spectator to animation you should now be reset correctly into spectator 2024-12-11 13:03:39 +01:00
Hanno Fleischer
42283f29a0 fixed missing passthrough statement in choosepiecestate 2024-12-11 12:28:48 +01:00
Hanno Fleischer
574f8bb681 added java docs 2024-12-11 12:00:39 +01:00
Hanno Fleischer
c1641cdac1 added the possibility when someone rolls a 6 and then has no valid move he can dice again 2024-12-11 10:54:50 +01:00
Cedric Beck
f251bad97f fixed node selected after clear 2024-12-11 08:59:21 +00:00
Felix Koppe
f8a021b310 Fix error in notification syncronizer 2024-12-11 08:40:31 +01:00
Daniel Grigencha
aa44b84648 removed unused imports and reformatted the code for code style 2024-12-11 05:34:34 +01:00
Benjamin Feyer
d8816be811 fixed some tests 2024-12-11 01:03:18 +01:00
Benjamin Feyer
e61265fc99 fixed some tests 2024-12-11 00:25:14 +01:00
Benjamin Feyer
9e2a0819ca fixed some tests 2024-12-10 21:18:31 +01:00
Benjamin Feyer
cc756453a1 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-10 21:03:21 +01:00
Benjamin Feyer
f23f1f5abc fixed some tests 2024-12-10 21:03:07 +01:00
Benjamin Feyer
cc8b2abbde fixed some tests 2024-12-10 20:56:08 +01:00
Hanno Fleischer
8d7701cbf2 removed presentation die results 2024-12-10 20:50:48 +01:00
Hanno Fleischer
874bba0fe9 removed starting alone ability 2024-12-10 20:47:51 +01:00
Hanno Fleischer
3b73d1229b fixed ceremony statetransition 2024-12-10 19:30:58 +01:00
Hanno Fleischer
9f1dafece2 added Ceremony integration 2024-12-10 19:29:06 +01:00
Hanno Fleischer hanno.fleischer@unibw.de
997b31eba2 reverted turbo card percentages to normal 2024-12-10 15:56:16 +01:00
Felix Koppe
148b769232 Add missing sound 2024-12-10 15:43:35 +01:00
Hanno Fleischer
f0f4e0eb5e added presentation die results and powercards as well as fixed a bug where when a piece was thrown with a suppressed shield it wouldnt be cleared 2024-12-10 15:06:35 +01:00
Cedric Beck
bda1a40cdb Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-10 14:53:26 +01:00
Cedric Beck
0c8cb92fe8 fix anims 2024-12-10 14:53:16 +01:00
Fleischer Hanno
e952233d20 added a hashset to fix double checking of powercards in the visitor 2024-12-10 14:36:26 +01:00
Cedric Beck
9f8fd9c22f changed var name 2024-12-10 14:34:44 +01:00
Cedric Beck
0432dd6bd7 merge 2024-12-10 14:29:02 +01:00
Cedric Beck
4d31fc098b fixed swap bug 2024-12-10 14:27:50 +01:00
Benjamin Feyer
40a61daa58 added flag 2024-12-10 14:07:52 +01:00
Benjamin Feyer
6e54ad0196 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-10 14:06:25 +01:00
Benjamin Feyer
11fa303f1b added flag 2024-12-10 14:05:43 +01:00
Fleischer Hanno
d65111680b added RankingResponseNotification to be sent to the client 2024-12-10 13:55:58 +01:00
Felix Koppe
485b8f36d7 Merge commit7 2024-12-10 13:57:08 +01:00
Felix Koppe
4eee62079e Add RankingResponceNotification 2024-12-10 13:56:42 +01:00
Cedric Beck
888b52f314 moved timermanger to app 2024-12-10 13:38:26 +01:00
Cedric Beck
bc2c80dd27 added asfjiop 2024-12-10 13:28:40 +01:00
Cedric Beck
50f0cdfce6 added timermanager 2024-12-10 13:26:56 +01:00
Cedric Beck
0c7030659a removed fadeControl 2024-12-10 13:00:03 +01:00
Benjamin Feyer
30997eb571 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-10 12:47:22 +01:00
Benjamin Feyer
ea1978d5a8 edited flag=false in enter in rolldice 2024-12-10 12:46:56 +01:00
Cedric Beck
1ead0e2e9e fixed uuid reference bug 2024-12-10 12:46:04 +01:00
Benjamin Feyer
70c821f2ac added logger and simpliefied logic 2024-12-10 12:06:21 +01:00
Cedric Beck
8867e8156f merge 2024-12-10 11:55:17 +01:00
Cedric Beck
36c2f2efec commit 2024-12-10 11:54:45 +01:00
Benjamin Feyer
b8d992590f added logger for swap-card 2024-12-10 11:52:52 +01:00
Benjamin Feyer
a86a146091 added logger for swap-card 2024-12-10 11:52:05 +01:00
Benjamin Feyer
3e060897fc added the flag in the client roldice-states, so you can't roll twice 2024-12-10 11:18:10 +01:00
Benjamin Feyer
fe95a7c159 added the piecetest and implemented more logic in the moveLogic 2024-12-10 10:47:06 +01:00
Benjamin Feyer
d60c0347cc Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-10 08:13:33 +01:00
Benjamin Feyer
bbde17aa27 initial test commit for clientStateTest and ServerStatetest 2024-12-10 08:13:11 +01:00
Benjamin Feyer
38c865d135 reformatted code 2024-12-10 02:23:19 +01:00
Benjamin Feyer
91d4718179 fixed the move-logic 2024-12-10 02:19:48 +01:00
Benjamin Feyer
bb1bf22713 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 22:22:49 +01:00
Benjamin Feyer
380341114c minor changes 2024-12-09 22:21:52 +01:00
Cedric Beck
f56eb8cd60 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 22:03:39 +01:00
Cedric Beck
3797da1246 fixed crash get bonus 2024-12-09 22:03:34 +01:00
Benjamin Feyer
e79a1168c0 corrected movelogic 2024-12-09 21:02:46 +01:00
Fleischer Hanno
6ab8f2d90d fixed missing check on shield state after swap 2024-12-09 19:55:03 +01:00
Fleischer Hanno
ece249cf66 fixed bug in no turn state with double next color itteration 2024-12-09 19:50:22 +01:00
Fleischer Hanno
e95f0866d5 fixed shield state for waiting state 2024-12-09 19:43:50 +01:00
Fleischer Hanno
0fce2fb5d2 added the possiblity when the drawpile has only 1 card the discard pile will be shuffeled and then put into the draw pile. 2024-12-09 19:11:45 +01:00
Fleischer Hanno
0010717411 when triggering BonusNode it will now be addded to the hand 2024-12-09 19:05:28 +01:00
Felix Koppe
cf9acf981f Merge commit 2024-12-09 19:06:08 +01:00
Felix Koppe
e2a4f7f85c Fix serialize error 2024-12-09 19:05:59 +01:00
Felix Koppe
1ffabe6b19 Merge commit 2024-12-09 19:05:02 +01:00
Felix Koppe
0ba5a2f9fd Add serialization of SpectatorMessage 2024-12-09 19:04:47 +01:00
Cedric Beck
d0afaa57f5 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 18:59:56 +01:00
Cedric Beck
00a79ddce3 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 18:59:42 +01:00
Cedric Beck
bce6a1e0eb added cardlayerhandler back and fixed clear selectable 2024-12-09 18:59:38 +01:00
Benjamin Feyer
37dcc0122c Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 18:51:04 +01:00
Benjamin Feyer
4007036cb2 bug fixes 2024-12-09 18:50:54 +01:00
Hanno Fleischer
5b958740c4 Merge remote-tracking branch 'origin/development2' into development2 2024-12-09 18:45:58 +01:00
Hanno Fleischer
06cb25b6a9 fixed card selection, to use an already selected and discarded card 2024-12-09 18:45:23 +01:00
Cedric Beck
afec74416f fixed ChoosePowerCardState 2024-12-09 18:45:00 +01:00
Hanno Fleischer
ceb9e48f55 updated Error messages 2024-12-09 18:36:42 +01:00
Cedric Beck
f8179f191f Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 18:12:08 +01:00
Cedric Beck
ec77b9a6ef added more start cards for testing 2024-12-09 18:11:45 +01:00
Fleischer Hanno
2d01e4b31b Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 18:11:44 +01:00
Fleischer Hanno
0be25ecb29 made Intro state work with more PowerCards on the hand 2024-12-09 18:11:21 +01:00
Benjamin Feyer
1210324194 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 18:05:40 +01:00
Benjamin Feyer
569ce39d2a bug Fixed 2024-12-09 18:04:24 +01:00
Cedric Beck
80989310e5 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 17:52:53 +01:00
Cedric Beck
a2f57bcaae deleted node unselect in BoardHandler clearSelectable 2024-12-09 17:52:48 +01:00
Lukas Bauer
68702f11a4 Deleted the 'MdgaApp.run.xml. 2024-12-09 17:51:40 +01:00
Felix Koppe
13948ec4bb Fix error 2024-12-09 17:47:03 +01:00
Cedric Beck
570c915964 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 17:21:51 +01:00
Cedric Beck
ac719c55e6 revert commit 2024-12-09 17:20:34 +01:00
Hanno Fleischer
189e8a7ec3 fixed client shield state animation 2024-12-09 17:11:30 +01:00
Felix Koppe
5d2ece41b7 Merge commit 2024-12-09 17:05:55 +01:00
Felix Koppe
7f92d8183b Adjust delays 2024-12-09 17:05:42 +01:00
Cedric Beck
6bc769f5bb merge 2024-12-09 17:04:45 +01:00
Cedric Beck
a21794ddc1 added new card order in CardLayerHandler 2024-12-09 17:03:35 +01:00
Felix Koppe
e699f4556e Fix error 2024-12-09 16:58:05 +01:00
Fleischer Hanno
a56f68efdc fixed Turbo card with zero modifier 2024-12-09 16:54:26 +01:00
Felix Koppe
55328e9e69 Fixe dice 2024-12-09 16:43:21 +01:00
Felix Koppe
50dc634a94 Add powercard drawing 2024-12-09 16:37:08 +01:00
Felix Koppe
d37b9ee269 Add powercard drawing 2024-12-09 16:36:07 +01:00
Benjamin Feyer
3937b75bf7 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 16:11:32 +01:00
Benjamin Feyer
7d5b8a6b13 404 IQ-Move added move logic 2024-12-09 16:10:56 +01:00
Felix Koppe
39d5b43cb8 Quality of live improvement 2024-12-09 16:10:15 +01:00
Felix Koppe
de0f04b5b7 Quality of live improvement 2024-12-09 16:07:26 +01:00
Felix Koppe
6a4bdfa455 Fix swap card issue 2024-12-09 14:50:29 +01:00
Felix Koppe
db16b0d8b6 Fix shield card issue 2024-12-09 14:45:41 +01:00
Benjamin Feyer
08db05a7d6 added more logic for the move 2024-12-09 14:15:05 +01:00
Cedric Beck
e47fcd1643 merge 2024-12-09 14:14:43 +01:00
Cedric Beck
dfd361d8be added isStart + (DU) 2024-12-09 14:14:15 +01:00
Felix Koppe
bf3d800c10 Add turboCardLogic 2024-12-09 13:57:16 +01:00
Felix Koppe
8943dfb15e Allow all bonusCards 2024-12-09 13:48:05 +01:00
Felix Koppe
64f11eb99b Adjust diceRoll time 2024-12-09 13:42:15 +01:00
Hanno Fleischer
0e9ff609ec fixed a bug where if two player rolled the same number in DSP u would be stuck in an infinite loop 2024-12-09 12:57:47 +01:00
Hanno Fleischer
d37db68838 fixed bug with too early state transition after playing a powercard 2024-12-09 12:05:28 +01:00
Benjamin Feyer
25fff99ff0 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2
# Conflicts:
#	Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java
#	Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/ChoosePieceAutomatonState.java
#	Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/SelectPieceState.java
2024-12-09 04:50:01 +01:00
Cedric Beck
2dbdb1e17b revert 2 dicenow 2024-12-09 04:42:55 +01:00
Fleischer Hanno
f954a24b32 fixed in firstroll catching of endanimation messages by non active palyers 2024-12-09 04:36:08 +01:00
Cedric Beck
c7a05011ff Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 04:34:52 +01:00
Cedric Beck
15b7aa9e8c fixed 2 dicenow notification 2024-12-09 04:34:47 +01:00
Felix Koppe
84a50ec215 Fix something 2024-12-09 04:33:21 +01:00
Benjamin Feyer
e05b057190 reenvented the wheel (; , rewrite the canMove-logic, etc 2024-12-09 04:32:55 +01:00
Cedric Beck
9ea6837e89 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 04:21:11 +01:00
Felix Koppe
a26a3d171f 99,99 IQ 2024-12-09 04:26:16 +01:00
Felix Koppe
a2e85cebc9 99,9 IQ 2024-12-09 04:25:36 +01:00
Cedric Beck
3fe2d90d75 added toString 2024-12-09 04:21:06 +01:00
Felix Koppe
4181456598 Adjust delay 2024-12-09 04:13:30 +01:00
Felix Koppe
6f34b1fe33 Adjust delay 2024-12-09 04:10:14 +01:00
Felix Koppe
659fef6c50 Add bonus sounds 2024-12-09 04:07:52 +01:00
Cedric Beck
9c7a13c568 fixed bug 2024-12-09 03:57:53 +01:00
Cedric Beck
14699e3edf fixed bug 2024-12-09 03:55:51 +01:00
Cedric Beck
961da990ce fixed no broadcast bug 2024-12-09 03:46:09 +01:00
Fleischer Hanno
be8d4b2d6e made turbo flag work with only one flag 2024-12-09 03:39:24 +01:00
Cedric Beck
38687b6d25 added turboflag 2024-12-09 03:37:35 +01:00
Cedric Beck
c038073bad Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 03:23:06 +01:00
Cedric Beck
5bccee96a2 working on turbo not 2024-12-09 03:23:02 +01:00
Fleischer Hanno
ecb751824c created two flags to be able to determine if a turbo card has been played 2024-12-09 03:20:54 +01:00
Felix Koppe
a7969d7a68 Minor change+ 2024-12-09 03:25:04 +01:00
Felix Koppe
3a1b17ed01 Merge commit 2024-12-09 03:17:47 +01:00
Felix Koppe
3dd6fc9f37 Add DEBUG_MULTIPLIER 2024-12-09 03:17:28 +01:00
Cedric Beck
3ae9028b82 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 03:11:49 +01:00
Cedric Beck
536c14bf7c working on turbocard 2024-12-09 03:11:43 +01:00
Fleischer Hanno
fb3a663db1 added overwrite of dicemodifier when receiving PlayCard Turbo message 2024-12-09 03:07:12 +01:00
Cedric Beck
b91d448ee6 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 02:55:57 +01:00
Cedric Beck
935577462b added shieldRing move 2024-12-09 02:55:52 +01:00
Felix Koppe
f79d590620 Merge commit 2024-12-09 02:50:57 +01:00
Felix Koppe
69d160d0fd Java23 2024-12-09 02:50:45 +01:00
Felix Koppe
de592cfa48 Move receive DrawCardMessage to GameState 2024-12-09 02:43:02 +01:00
Fleischer Hanno
8922cb8f1c added removeshield notification 2024-12-09 02:41:44 +01:00
Felix Koppe
f10df60ad3 Merge commit 2024-12-09 02:40:57 +01:00
Felix Koppe
1c87b566e9 Add DrawCardMessage logic 2024-12-09 02:40:45 +01:00
Cedric Beck
6ecf5a66bf added animation end in playCardNotification 2024-12-09 02:30:15 +01:00
Cedric Beck
3f93d6e569 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 02:18:35 +01:00
Cedric Beck
cc72b82be9 added shield Messages 2024-12-09 02:18:30 +01:00
Fleischer Hanno
41ac04f69d added in can infield move to return false when occupant is shielded 2024-12-09 02:15:45 +01:00
Felix Koppe
cb60cb1c42 Add bonus node logic 2024-12-09 02:19:43 +01:00
Fleischer Hanno
61d67fd833 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-09 02:04:11 +01:00
Felix Koppe
4ca7c38170 Minor change in notification processing 2024-12-09 02:09:09 +01:00
Fleischer Hanno
e457fe23d4 added a reset for the dice modifier in the server 2024-12-09 02:03:57 +01:00
Felix Koppe
b86aeb63e6 Merge commit 2024-12-09 01:53:33 +01:00
Felix Koppe
daa8c0bf9d 500IQ 2024-12-09 01:53:18 +01:00
Felix Koppe
6487bafed1 Merge commit 2024-12-09 01:47:47 +01:00
Felix Koppe
8af3b2d9d4 Fix uuid serialisation error 2024-12-09 01:47:32 +01:00
Cedric Beck
d38690ea48 merge 2024-12-09 01:43:25 +01:00
Cedric Beck
daa7d31bdd working on shield 2024-12-09 01:42:59 +01:00
Fleischer Hanno
5e79a4a64c added remove handcard 2024-12-09 01:35:37 +01:00
Felix Koppe
8e2fc6c1a1 Merge commit 2024-12-09 01:18:47 +01:00
Felix Koppe
5a12d8e96f Fix dice more than once error 2024-12-09 01:18:29 +01:00
Fleischer Hanno
3af6e94920 added DrawCardMessageSupport 2024-12-09 01:16:31 +01:00
Cedric Beck
4efc557849 added node hover/select with piece 2024-12-09 01:06:12 +01:00
Felix Koppe
1646526ce1 Try fix error 2024-12-09 00:36:38 +01:00
Cedric Beck
904aa17358 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-08 23:23:27 +01:00
Felix Koppe
f4e774ee5b Minor change 2024-12-08 23:28:26 +01:00
Cedric Beck
76b3e18dbe added jet_noGear 2024-12-08 23:23:21 +01:00
Cedric Beck
d4cbd0dda6 added swapnotification 2024-12-08 23:08:59 +01:00
Felix Koppe
7a189a98e3 Merge commit 2024-12-08 23:05:44 +01:00
Felix Koppe
00902d2e6b Add move throw sync 2024-12-08 23:05:30 +01:00
Fleischer Hanno
7256cde020 changed the ionput list for selectableMoveNotification 2024-12-08 22:52:42 +01:00
Cedric Beck
b817af29b5 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-08 22:28:57 +01:00
Cedric Beck
fa18ae4280 added swap functionality in model for server & client 2024-12-08 22:28:51 +01:00
Felix Koppe
521c7439c2 Add error in animation logixc 2024-12-08 22:04:16 +01:00
Fleischer Hanno
84c5553154 fixed former bug 2024-12-08 21:47:28 +01:00
Fleischer Hanno
2c94737023 fixed bug when moving pieces from waiting to infield for non active players 2024-12-08 21:37:22 +01:00
Fleischer Hanno
d3d75d7f49 added missing error messages 2024-12-08 21:23:16 +01:00
Fleischer Hanno
5e67b2d0c7 fixed a bug where the home index of piece was wrong 2024-12-08 21:18:34 +01:00
Fleischer Hanno
992efd403d fixed waiting piece move bug 2024-12-08 21:14:20 +01:00
Cedric Beck
2d7fddf09a fixed swap select 2024-12-08 21:13:44 +01:00
Felix Koppe
f7c886f084 333IQ 2024-12-08 21:12:09 +01:00
Fleischer Hanno
a1d85177c6 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-08 20:46:58 +01:00
Fleischer Hanno
e27d325faa added serializable tag to choosepiecestatemessage 2024-12-08 20:45:53 +01:00
Cedric Beck
bd98f301c8 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-08 20:44:28 +01:00
Cedric Beck
a7850f7d43 fixed rotation 2024-12-08 20:42:57 +01:00
Fleischer Hanno
3040595193 minor fixes to initialize method in noPiece state of server 2024-12-08 20:28:09 +01:00
Fleischer Hanno
5d45cf2934 fixed an error in clientstates where a missing servermessage received istn overwritte 2024-12-08 20:24:05 +01:00
Fleischer Hanno
a5d949b7e5 added the functionality of multiple roll dice when all pieces in waiting 2024-12-08 20:17:53 +01:00
Cedric Beck
f4a224621e deleted unwanted code (next Color) 2024-12-08 20:05:37 +01:00
Felix Koppe
876c238db3 Fix colorNext 2024-12-08 19:48:26 +01:00
Felix Koppe
b61b8214fe Fix colorNext 2024-12-08 19:46:09 +01:00
Felix Koppe
5dc3124533 Fix colorNext 2024-12-08 19:40:10 +01:00
Fleischer Hanno
c25e17fd90 fixed waitingpiece move 2024-12-08 19:14:48 +01:00
Cedric Beck
5e27473875 fixed bugs in MoveMessage 2024-12-08 19:10:25 +01:00
Cedric Beck
1be2d6aa13 Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2 2024-12-08 18:06:10 +01:00
Felix Koppe
ab9de3acf8 Replace waitMoveNotification with moveNotification 2024-12-08 18:09:13 +01:00
Cedric Beck
2ab19d0fc8 200 iq move 2024-12-08 18:05:35 +01:00
Cedric Beck
f489357bbb fixed calcTargetIndex 2024-12-08 17:24:36 +01:00
Felix Koppe
34cde15a0d Fix error 2024-12-08 17:24:18 +01:00
Felix Koppe
1e52df2812 Fix error 2024-12-08 17:14:22 +01:00
Felix Koppe
884c5afc4e Remove moveOccupant 2024-12-08 17:12:35 +01:00
Cedric Beck
d6e44c2d29 added logger 2024-12-08 16:44:28 +01:00
Felix Koppe
d593233fa3 Fix error 2024-12-08 15:29:23 +01:00
Felix Koppe
d1b4aa9dda Fix error 2024-12-08 15:24:59 +01:00
Felix Koppe
25b6480c42 Fix error 2024-12-08 15:10:14 +01:00
Felix Koppe
3dd81ea02c Add trace statement 2024-12-08 14:58:07 +01:00
Felix Koppe
e6dbedab0f Try fix active player logic 2024-12-08 14:33:37 +01:00
Felix Koppe
f5b0481d3c Adjust print statements 2024-12-08 14:25:38 +01:00
Felix Koppe
f9f381ac2d Fix color.next 2024-12-08 14:16:14 +01:00
Felix Koppe
ee94d901f4 Adjust print statements 2024-12-08 13:54:39 +01:00
Felix Koppe
bca02bfe4b Adjust print statements 2024-12-08 13:51:05 +01:00
Felix Koppe
acdf5ec6a9 Add missing registration of SelectPieceMessage 2024-12-08 13:29:44 +01:00
Cedric Beck
41d6f70d51 added logger 2024-12-08 12:50:58 +01:00
Felix Koppe
4c064cb615 Merge commit+ 2024-12-08 12:45:36 +01:00
Felix Koppe
121f47d070 Fix selectPieceState and startPieceState logic 2024-12-08 12:45:08 +01:00
Cedric Beck
ae436589a2 edited MoveMessage in WaitingState 2024-12-08 12:38:59 +01:00
Cedric Beck
bc399b1bf9 edited String queals in Piece 2024-12-08 12:03:05 +01:00
Cedric Beck
98a6f2e689 added debug 2024-12-08 11:57:30 +01:00
Cedric Beck
9a07375fed Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-08 11:39:42 +01:00
Felix Koppe
498c2eb054 Merge remote-tracking branch 'origin/development' into development 2024-12-08 11:44:38 +01:00
Cedric Beck
ce55ca8bb5 added further node select implementation 2024-12-08 11:39:37 +01:00
Felix Koppe
9c729059bf Merge branch 'refs/heads/dev/server_h' into development 2024-12-08 11:30:09 +01:00
Cedric Beck
3b7ef37364 added selectNode when right piece is selected 2024-12-08 11:27:56 +01:00
Fleischer Hanno
ec295c94f1 fixed the equals method in piece 2024-12-08 11:23:53 +01:00
Cedric Beck
adfe2b94b8 fixed cardLayer shutdown bug 2024-12-08 11:19:00 +01:00
Cedric Beck
69108063a0 fixed Notification bug 2024-12-08 10:33:56 +01:00
Hanno Fleischer
16e7488fae Merge branch 'dev/server_h' into 'development'
added more communication fixes, states now use correct messages

See merge request progproj/gruppen-ht24/Gruppe-01!38
2024-12-08 09:13:47 +00:00
Hanno Fleischer
c9c99709ba added more communication fixes, states now use correct messages 2024-12-08 09:52:23 +01:00
Felix Koppe
e069017375 Merge remote-tracking branch 'origin/dev/server_h' into development 2024-12-08 09:44:23 +01:00
Hanno Fleischer
8b27ccce22 adjusted stattransition methods to work correctly 2024-12-08 03:08:47 +01:00
Hanno Fleischer
8c22d935a9 implemented rest of the server logic in choosepiece substates, and began to fix bugs after testing 2024-12-08 01:59:29 +01:00
Cedric Beck
c8d7d91de0 added import in NotiSync 2024-12-07 21:57:41 +01:00
Cedric Beck
389d1b6056 merge development into dev/client_beck 2024-12-07 17:04:43 +01:00
Cedric Beck
4430b37581 fixed wrong dice rotation because of fps drop 2024-12-07 17:00:42 +01:00
Cedric Beck
e5abcbdc8c added jet_noGear.j3o 2024-12-07 16:51:38 +01:00
Cedric Beck
e14b8cb510 added converted assets 2024-12-07 16:50:43 +01:00
Felix Koppe
bf84bfa0f9 Update animations and remove test setup 2024-12-07 16:40:45 +01:00
Hanno Fleischer
0c49d7ed1c Merge branch 'dev/server_h' of https://athene1.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into dev/server_h 2024-12-07 15:37:02 +01:00
Hanno Fleischer
2ba6a22422 Merge branch 'development' into 'dev/server_h'
Development

See merge request progproj/gruppen-ht24/Gruppe-01!37
2024-12-07 14:36:25 +00:00
Hanno Fleischer
c37bac4614 replaced DicaAgain message with DicveNow 2024-12-07 15:34:34 +01:00
Felix Koppe
06b37584cb Merge dev/client_beck into development 2024-12-07 15:05:03 +01:00
Felix Koppe
0c42a2df88 Merge branch 'dev/client_beck' into development
# Conflicts:
#	Projekte/mdga/client/src/main/java/pp/mdga/client/Asset.java
#	Projekte/mdga/client/src/main/java/pp/mdga/client/InputSynchronizer.java
#	Projekte/mdga/client/src/main/java/pp/mdga/client/acoustic/AcousticHandler.java
#	Projekte/mdga/client/src/main/java/pp/mdga/client/acoustic/MdgaSound.java
#	Projekte/mdga/client/src/main/java/pp/mdga/client/acoustic/SoundAsset.java
#	Projekte/mdga/client/src/main/java/pp/mdga/client/animation/JetAnimation.java
#	Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java
#	Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/GameStates.java
2024-12-07 15:00:27 +01:00
Felix Koppe
d75d704878 Add smoke effekt to missileAnimation 2024-12-07 14:55:08 +01:00
Cedric Beck
6d3c733f91 added effect for shell flying 2024-12-07 14:45:39 +01:00
Felix Koppe
f96da2c46c Add notification delay 2024-12-07 14:37:19 +01:00
Cedric Beck
1a079dad44 added shell asset for ShellAnimation 2024-12-07 14:22:36 +01:00
Cedric Beck
32f49a6181 added shellAnimation without shell asset 2024-12-07 13:30:30 +01:00
Felix Koppe
525809899e Minor improvements 2024-12-07 11:03:30 +01:00
Felix Koppe
fd9708752c Merge dev/model into development 2024-12-06 18:49:15 +01:00
Hanno Fleischer
5a9f7a8118 added AnimationEndMessages to 'RollDiceState', 'MovePieceState' and 'PlayPowerCardState' 2024-12-06 18:45:14 +01:00
Felix Koppe
236d3db930 Add ambience 2024-12-06 18:10:09 +01:00
Cedric Beck
29c6b13300 added MatrixAnimation 2024-12-06 17:09:06 +01:00
Felix Koppe
6059e93276 Fix interruptDialog 2024-12-06 16:52:08 +01:00
Felix Koppe
f2eeb6dab4 Fix logic error regarding cardSelection 2024-12-06 16:27:01 +01:00
Hanno Fleischer
2e1fe3c050 fixed a missing method call ind TurnState and removed debug sout statements ind 'RollDiceMessage' 2024-12-06 15:19:04 +01:00
Cedric Beck
2ac2de645b working on matrix-animation 2024-12-06 14:56:04 +01:00
Felix Koppe
d39f85fbe9 Add some javaDoc to client 2024-12-06 14:26:13 +01:00
Felix Koppe
960a57caba Fix broken lose sound 2024-12-06 13:28:38 +01:00
Felix Koppe
36631df2e9 Fix broken jet-sound 2024-12-06 13:26:28 +01:00
Felix Koppe
df27c23cd5 Fix shadercode 2024-12-06 13:19:17 +01:00
Felix Koppe
acd64d1507 Fix shadercode 2024-12-06 13:14:54 +01:00
Felix Koppe
76f86c8a66 Improve audioSettings 2024-12-06 11:35:05 +01:00
Hanno Fleischer
308b592b65 Merge branch 'development' into 'dev/model'
Development merge

See merge request progproj/gruppen-ht24/Gruppe-01!36
2024-12-06 09:55:19 +00:00
Felix Koppe
c4e7fb1d41 Fix logic in modelSyncronizer 2024-12-06 10:54:02 +01:00
Felix Koppe
aacc0440b3 Update .gitignore 2024-12-06 10:33:13 +01:00
Hanno Fleischer
43c0e3bcc7 Merge branch 'development' into 'dev/model'
Development

See merge request progproj/gruppen-ht24/Gruppe-01!35
2024-12-06 09:09:29 +00:00
Felix Koppe
95635f5fb7 Fix ownColor in gameView 2024-12-06 09:59:28 +01:00
Felix Koppe
e337b1f888 Fix card select issue 2024-12-06 09:57:28 +01:00
Felix Koppe
0237bcc4be Fix card select issue 2024-12-06 09:51:17 +01:00
Felix Koppe
26836d16cc Fix card select issue 2024-12-06 09:48:24 +01:00
Felix Koppe
a6c8cc33f4 Make cardSelect trigger needCconfirm 2024-12-06 09:31:02 +01:00
Felix Koppe
7f5f4b8c68 Fix broken sound 2024-12-06 09:24:49 +01:00
Felix Koppe
7f3483aa6b Add broken sound 2024-12-06 09:22:10 +01:00
Felix Koppe
8422b7be1e Merge branch 'development' into dev/client_koppe2 2024-12-06 09:11:09 +01:00
Felix Koppe
f0b23ab9c2 Readd broken files 2024-12-06 09:10:47 +01:00
Felix Koppe
78f1dbb3d3 Remove broken files 2024-12-06 09:08:52 +01:00
Daniel Grigencha
4904b32ea3 Updated 'ChoosePieceState' class.
Updated the 'ChoosePieceState' class by adding the 'RequestMoveMessage' handling to it.
2024-12-06 08:58:51 +01:00
Daniel Grigencha
b00219c4fb Updated 'PlayPowerCardState' class.
Updated the 'PlayPowerCardState' class by adding the 'AnimationEndMessage' handling to it.
2024-12-06 08:58:01 +01:00
Daniel Grigencha
12cf5f3e71 Updated 'PowerCardState' class.
Updated the 'PowerCardState' class by adding the 'SelectedPiecesMessage' handling to it.
2024-12-06 08:57:08 +01:00
Daniel Grigencha
77b0207214 Updated 'TurnState' class.
Updated the 'TurnState' class by adding the 'SelectedPiecesMessage', 'NoPowerCardMessage', 'RequestDieMessage' and 'ReuqestMoveMessage' handling to it.
2024-12-06 08:56:21 +01:00
Daniel Grigencha
a18165bc02 Updated 'Game' class.
Updated the 'Game' class by commenting out the creation of turbo and shield cards. This is only for testing purposes.
2024-12-06 08:55:01 +01:00
Felix Koppe
9e758e4417 Merge branch 'dev/model' into dev/client_koppe2 2024-12-06 08:11:37 +01:00
Daniel Grigencha
62ceff822f Updated 'DetermineStartPlayerState' class.
Updated the 'DetermineStartPlayerState' class by adding logic for the roll again event to the 'RequestDieMessage' handling.
2024-12-06 04:54:14 +01:00
Hanno Fleischer
33afc4ab3b added selectDice method in RollDiceState 2024-12-06 04:48:05 +01:00
Daniel Grigencha
322d539cfd Merge branch 'dev/model' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into dev/model 2024-12-06 04:28:40 +01:00
Daniel Grigencha
9c4f2387ee Updated 'FirstRollState', 'SecondRollState' and 'ThirdROllState' classes.
Updated the 'FirstRollState', 'SecondRollState' and 'ThirdROllState' class by adding the 'received(RequestDieMessage msg, int from)' method to them.
2024-12-06 04:28:33 +01:00
Daniel Grigencha
9d1430e488 Updated 'AnimationState' class.
Updated the 'AnimationState' class by setting the data type of 'messageReceived' from 'Map' to 'Set'.
2024-12-06 04:27:10 +01:00
Daniel Grigencha
dd2146d417 Updated 'DetermineStartPlayerState' class.
Updated the 'DetermineStartPlayerState' class by setting the data type of 'messageReceived' from 'Map' to 'Set'.
2024-12-06 04:26:38 +01:00
Daniel Grigencha
d9ad0f0a4b Updated 'LobbyState' class.
Updated the 'LobbyState' class by setting the first waiting piece on the start node.
2024-12-06 04:25:45 +01:00
Hanno Fleischer
0368ec8541 implemented the correct transition, when the player can play no powercard 2024-12-06 04:18:58 +01:00
Daniel Grigencha
72f0bc5a2f Updated 'RollDiceState' class.
Updated the 'RollDiceState' class by adding the 'received(RequestDieMessage msg, int from)' method to it.
2024-12-06 04:17:29 +01:00
Daniel Grigencha
23ae4a3080 Updated 'DetermineStartPlayaerState' class.
Updated the 'DetermineStartPlayerState' class by calling the right method of the 'entry' inside the 'RequestDieMessage' handling.
2024-12-06 04:14:42 +01:00
Daniel Grigencha
765b1884fe Updated 'AnimationState' class.
Updated the 'AnimationState' class by removing the unused 'DiceNowMessage' call from it.
2024-12-06 03:57:42 +01:00
Daniel Grigencha
e3febd6ba1 Updated 'DetermineStartPlayerState' class.
Updated the 'DetermineStartPlayerState' class by removing the 'rolls' attribute and its usage from it.
2024-12-06 03:49:39 +01:00
Daniel Grigencha
1a562a8d38 Updated 'DeterminStartPlayerState' class.
Updated the 'DetermineStartPlayerState' class by adding the multi roll support to it. In Addition, the server model will be updated correctly.
2024-12-06 03:29:11 +01:00
Daniel Grigencha
39ed4238b5 Updated 'AnimationState' class.
Updated the 'AnimationState' class by adding a missing semicolon.
2024-12-06 03:27:55 +01:00
Daniel Grigencha
620063e894 Updated 'AnimationState' class.
Updated the 'AnimationState' class by updating the 'messageReceived' attribute in it. In Addition, the 'AnimationEndMessage' handling was updated.
2024-12-06 03:22:25 +01:00
Daniel Grigencha
2d0788eb72 Updated 'TurnState' class.
Updated the 'TurnState' class by updating the imports in it.
2024-12-06 03:20:28 +01:00
Daniel Grigencha
8470a96908 Updated 'DetermineStartPlayerState' class.
Updated the 'DetermineStartPlayerState' class by updating the 'AnimationEndMessage' handling in it. In Addition, the 'RequestDieMessage' handling was updated as well.
2024-12-06 02:55:14 +01:00
Hanno Fleischer
a6205c982a now sending AnimationEndMessage when in Waitranking State 2024-12-06 02:40:16 +01:00
Daniel Grigencha
58b9298c91 Merge branch 'dev/model' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into dev/model 2024-12-06 02:38:53 +01:00
Daniel Grigencha
1e6856744b Updated 'DetermineStartPlayerState' class.
Updated the 'DetermineStartPlayerState' class by adding the 'received(AnimationEndMessage msg, int from)' method to it.
2024-12-06 02:38:46 +01:00
Hanno Fleischer
f713e00c36 made all 'PowerCards' serializable 2024-12-06 02:30:13 +01:00
Daniel Grigencha
81ae896ae8 Updated 'TurnState' class.
Updated the 'TurnState' class by removing the start state of this state machine of the constructor.
2024-12-06 02:22:46 +01:00
Daniel Grigencha
5b55d39c9a Updated 'AnimationState' class.
Updated the 'AnimationState' class by solving the transition error due to the separat state change.
2024-12-06 02:22:07 +01:00
Hanno Fleischer
f36e2ff7bb adjusted the getter for the card in the intro to get BonusCards instead of PowerCards 2024-12-06 02:16:58 +01:00
Hanno Fleischer
16afe95aa6 Merge branch 'dev/model' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into dev/model 2024-12-06 02:13:08 +01:00
Hanno Fleischer
55d398b428 adjusted all useages of the SelectedPieces consturctor to transfer the right parameters 2024-12-06 02:12:59 +01:00
Daniel Grigencha
affa2ecd7e Added 'ChoosePowerCardState', 'ShieldCardState', 'SwapCardState' and 'TurboCardState' classes.
Updated the 'ChoosePowerCardState', 'ShieldCardState', 'SwapCardState' and 'TurboCardState' classes to this project. They will be used inside the power card state. In Addition, the abstract 'PowerCardAutomatonState' class was added.
2024-12-06 02:11:32 +01:00
Hanno Fleischer
0a1bd1f503 adjusted all State containing 'received(PlayCardMessage msg)' to work with the new message 2024-12-06 02:04:55 +01:00
Daniel Grigencha
a2867fc88a Added 'ServerCardVisitor' class.
Added the 'ServerCardVisitor' class to this project. It will be used as a visitor on the server to differentiate between all types of power cards.
2024-12-06 01:41:45 +01:00
Daniel Grigencha
c6761d91d1 Updated 'PowerCardState' class.
Updated the 'PowerCardState' class by updating the content of the 'enter' in it.
2024-12-06 01:37:24 +01:00
Daniel Grigencha
5708ee6ffe Updated 'PlayCardMessage' class.
Updated the 'PlayCardMessage' class by removing the 'ownPieceID' and 'enemyPieceID' attributes and their getter methods from it. In Addition, the 'pieces' attribute and its getter method was added.
2024-12-06 01:28:44 +01:00
Hanno Fleischer
d61b68aa41 overrode hachCode and equals method of Piece 2024-12-06 01:15:06 +01:00
Daniel Grigencha
e98418b274 Merge branch 'dev/model' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into dev/model 2024-12-06 01:06:20 +01:00
Daniel Grigencha
66dc9c02ea Updated 'PowerCardState' class.
Updated the 'PowerCardState' class by adding the 'currentState', 'choosePowerCardState', 'shieldCardState', 'swapCardState' and 'turboCardState' attributes and its getter methods to it. In Addition, logic was written into the 'enter' method.
2024-12-06 00:53:11 +01:00
Daniel Grigencha
dd95356abd Updated 'TurnState' class.
Updated the 'TurnState' class by adding the 'player' attribute and its getter method to it.
2024-12-06 00:50:48 +01:00
Daniel Grigencha
84776c71b2 Updated 'SelectedPiecesMessage' class.
Updated the 'SelectedPiecesMessage' class by removing 'pieceIdentifier' attribute and its getter method from it. In Addition, the 'pieces' attribute and its getter method was added.
2024-12-06 00:47:33 +01:00
Daniel Grigencha
d07eee6251 Updated 'Piece' class.
Updated the 'Piece' class by overwriting the 'toString' method in it.
2024-12-06 00:45:56 +01:00
Hanno Fleischer
b601ff2cf7 renamed 'PossibleCardMEssage' to 'PossibleCardsMessage' and completed JavaDocs for method 'getPowerCardByType' in 'Player' 2024-12-06 00:36:06 +01:00
Hanno Fleischer
04119d2f3e modified 'ChoosePowerCardState' to work with PowerCards as well as adjusted 'SelectcardMessage' to use 'PowerCards' 2024-12-06 00:31:12 +01:00
Hanno Fleischer
a92c06a70e added a method in 'Player' to return the first 'PowerCard' of a specific Type 2024-12-06 00:30:08 +01:00
Daniel Grigencha
50f9c0ef0c Updated 'PossibleCardMessage' class.
Updated the 'PossibleCardMessage' class by replacing all 'BonusCard' with 'PowerCard' in it.
2024-12-06 00:19:11 +01:00
Daniel Grigencha
f7f246daaa Merge branch 'dev/model' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into dev/model 2024-12-06 00:16:42 +01:00
Daniel Grigencha
8a738a3633 Updated 'Game' class.
Updated the 'Game' class by replacing all 'BonusCard' with 'PowerCard' in it.
2024-12-06 00:16:38 +01:00
Daniel Grigencha
3a32a7ebf7 Updated 'Player' class.
Updated the 'Player' class by replacing all 'BonusCard' with 'PowerCard' in it.
2024-12-06 00:11:50 +01:00
Daniel Grigencha
6894802c00 Added 'HiddenCard', 'ShieldCard', 'SwapCard' and 'TurboCard' classes.
Updated the 'HiddenCard', 'ShieldCard', 'SwapCard' and 'TurboCard' classes to this project. They will be used to display different types of power cards.
2024-12-06 00:04:21 +01:00
Daniel Grigencha
a09211da5f Updated abstract 'PowerCard' class.
Updated the abstract 'PowerCard' class by setting the 'card' attribute to 'protected' in it.
2024-12-06 00:03:16 +01:00
Daniel Grigencha
c9c9c5dcf6 Added abstract 'PowerCard' class.
Added the abstract 'PowerCard' class to this project. It will be used to display different types of hand cards.
2024-12-05 23:58:43 +01:00
Daniel Grigencha
1e46b1dc59 Added 'Visitor' interface.
Added the 'Visitor' interface to this project. It will be used to handle all types of power cards.
2024-12-05 23:54:55 +01:00
Hanno Fleischer
6c74acc334 added a getter for the BonusCrad in PowerCard 2024-12-05 23:07:22 +01:00
Hanno Fleischer
421231aa12 made BonusCard Serializable and added the method calls to display handcards during the intro 2024-12-05 22:46:48 +01:00
Daniel Grigencha
d8bb458e9c Updated 'LobbyState' class.
Updated the 'LobbyState' class by updating the 'initializeGame' method in it.
2024-12-05 23:45:24 +01:00
Hanno Fleischer
f0080118d0 Changed and :
removed the selectAnimationEnd Method from Waitranking and moved logic into the receivedActivePlayerMessage. Added in selectStart to always send a StartGameMessage in order to trigger incorrectRequestMEssage
2024-12-05 22:34:53 +01:00
Daniel Grigencha
8a438ab069 Updated 'DetermineStartPlayerState' class.
Updated the 'DetermineStartPlayerState' class by updating the whole start player determination process in it.
2024-12-05 23:29:21 +01:00
Daniel Grigencha
0ce8184069 Updated 'Game' class.
Updated the 'Game' class by adding the 'draw' method to it. In Addition, the 'initializeDrawPile' method was updated by shuffling the 'drawPile' attribute after filling it.
2024-12-05 23:27:06 +01:00
Felix Koppe
2c524477d7 Merge branch 'dev/model' into dev/client_koppe2 2024-12-05 22:18:00 +01:00
Felix Koppe
587af466e8 Merge branch 'development' into dev/client_koppe2
# Conflicts:
#	Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java
2024-12-05 22:17:53 +01:00
Felix Koppe
8d398450f1 Minor changes 2024-12-05 22:15:59 +01:00
Felix Koppe
0a96dd6f9f Repair sounds 2024-12-05 22:07:36 +01:00
Felix Koppe
e8a556de27 Add missle 2024-12-05 22:02:02 +01:00
Hanno Fleischer
1214d3c87c added an getter for the error id in the IncorrectrequestMessage and implemeted how to handle it in the client game logic. 2024-12-05 21:11:40 +01:00
Daniel Grigencha
f2c34aee2d Updated 'DetermineStartPlayerState' class.
Updated the 'DetermineStartPlayerState' class by updating the 'received(RequestDieMessage msg, int from)' method in it.
2024-12-05 22:03:48 +01:00
Daniel Grigencha
2da1fec7dd Updated 'RankingResponseMessage' class.
Updated the 'RankingResponseMessage' class by removing the 'startingPlayerId' attribute and its getter method from it. In Addition the 'rankingResults' attribute and its getter method were added.
2024-12-05 22:01:05 +01:00
Daniel Grigencha
5d76a89b95 Updated 'LobbyState' class.
Updated the 'LobbyState' class by updating the 'JoinedLobbyMessage' and 'LobbyReadyMessage' handlings in it.
2024-12-05 21:58:20 +01:00
Daniel Grigencha
60ebef3518 Updated 'LobbyState' class.
Updated the 'LobbyState' class by adding an 'IncorrectRequestMessage' to the start game handling.
2024-12-05 19:58:23 +01:00
Felix Koppe
a399b14291 Improve interrupt 2024-12-05 18:11:57 +01:00
Felix Koppe
9d21e2ce87 Merge commit 2024-12-05 18:00:27 +01:00
Felix Koppe
2255bfd648 Remove test binding 2024-12-05 18:00:04 +01:00
Hanno Fleischer
74194d8514 Merge branch 'development' into 'dev/model'
Development

See merge request progproj/gruppen-ht24/Gruppe-01!34
2024-12-05 16:58:50 +00:00
Fleischer Hanno
cabd98a24a adjusted a broadcast in lobby state to a send to reduce traffic (original commit f1124f32) and removed souts as well as added comments back into the code 2024-12-05 17:51:18 +01:00
Cedric Beck
f3816cb2a5 added particle_cir.png 2024-12-05 17:49:56 +01:00
Cedric Beck
997c4c589e removed setOwnColor 2024-12-05 17:23:15 +01:00
Cedric Beck
d14a0aef86 fixed ownColor sync problem 2024-12-05 17:22:37 +01:00
Felix Koppe
ac5d7ed74b Add sounds 2024-12-05 17:11:07 +01:00
Felix Koppe
f1124f3245 Fix missing ready update from server on join of new player in LobbyState 2024-12-05 16:38:09 +01:00
Felix Koppe
fc4a357e9e Merge branch 'dev/model' into dev/client_koppe2 2024-12-05 16:25:23 +01:00
Felix Koppe
a8b02faa96 Merge branch 'development' into dev/client_koppe2
# Conflicts:
#	Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java
2024-12-05 16:25:11 +01:00
Felix Koppe
4a7c23708c Add jetAnimation 2024-12-05 16:21:13 +01:00
Hanno Fleischer
4478291852 added the movement of pieces in the intro state to be also done in the model 2024-12-05 15:22:38 +01:00
Hanno Fleischer
0622c35303 fixed state transitions and implemented the Intro state to move the pieces to the correct start setup
added some logic so that the client only transitions to the intro state when the animation has finished at it received the new active Player, and after animating the setup it switches to the corresponding state baserd on  the active player and displays the now new active player.
2024-12-05 14:02:02 +01:00
Daniel Grigencha
3b0cd9ebdb Updated the JavaDocs in multiple classes, to improve readability. 2024-12-05 05:21:33 +01:00
Daniel Grigencha
e81aa67d36 Updated the JavaDocs in multiple classes, to improve readability. 2024-12-05 05:09:15 +01:00
Daniel Grigencha
4fb848420b Updated the 'DisconnectedMessage' class.
Updated the 'DisconnectedMessage' class by adding JavaDocs.
2024-12-05 05:03:39 +01:00
Daniel Grigencha
07a833afe7 Updated the 'ClientInterpreter' interface.
Updated the 'ClientInterpreter' interface by adjusting the JavaDocs.
2024-12-05 05:00:29 +01:00
Daniel Grigencha
6576250113 Updated the 'Player' class.
Updated the 'Player' class by adjusting the JavaDocs and writing the logic for the 'isFinished()' method.
2024-12-05 04:54:12 +01:00
Daniel Grigencha
154efccf31 Updated 'Game' class.
Updated the 'Game' class by adjusting the JavaDocs and rewriting the constructor for maintainability and readability.
2024-12-05 04:52:59 +01:00
Daniel Grigencha
f90aed7bbb Updated 'Color' enum.
Updated the 'Color' enum by adjusting the JavaDocs and adding a new static method 'getColor(int)'
2024-12-05 04:51:55 +01:00
Daniel Grigencha
3a86837307 Updated the JavaDocs in multiple classes, to improve readability. 2024-12-05 04:50:34 +01:00
Daniel Grigencha
da0756452c Updated the JavaDocs in multiple classes, to improve readability. 2024-12-05 04:49:49 +01:00
Daniel Grigencha
bfe8a20f92 Updated 'Board' class.
Updated the 'Board' class by rewriting the constructor, to make it maintainable and scalable.
2024-12-05 04:46:01 +01:00
Felix Koppe
0e6a2499b7 Fix fullscreen issue 2024-12-04 18:38:35 +01:00
Hanno Fleischer
354cdc0a9c added Intro state and its logic 2024-12-04 17:03:57 +01:00
Felix Koppe
00d86c5c10 Improve ceremonyView 2024-12-04 15:33:34 +01:00
Felix Koppe
990e476753 Add Q/E rotation 2024-12-04 15:27:33 +01:00
Felix Koppe
71fc08a05c Add interrupt 2024-12-04 15:11:31 +01:00
Cedric Beck
9e1ca584c7 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-04 13:56:08 +01:00
Cedric Beck
9199fbffd8 removed tests, fixed null exception in CardLayer 2024-12-04 13:56:03 +01:00
Felix Koppe
5c71531277 Merge branch 'development' into dev/client_koppe2 2024-12-04 13:43:33 +01:00
Felix Koppe
6f7c5346d2 Merge commit 2024-12-04 13:34:14 +01:00
Felix Koppe
ef1ce63db6 Try to make server stop on leave 2024-12-04 13:33:39 +01:00
Hanno Fleischer
e8d1442e5b made the model checkstyle compliant 2024-12-04 12:10:48 +01:00
Hanno Fleischer
bdacc4aad3 created the Intro state and renamed all packages to be checkstyle compliant 2024-12-04 12:08:38 +01:00
Cedric Beck
44ef21e6af added handCard Num to playerName display + added remove card in guiHandler 2024-12-04 11:38:35 +01:00
Hanno Fleischer
8e8104b672 forgot to add StartGameMessage in previous commit 2024-12-04 11:10:26 +01:00
Hanno Fleischer
de899cef35 removed from every Message the getInfoTest method and only overrode the toString method in messages with content, in every other message it is handled through the parent class 2024-12-04 11:07:55 +01:00
Felix Koppe
11d6dd4500 Improve video dialog 2024-12-04 10:00:41 +01:00
Felix Koppe
d71f824ca6 Add fullscreen option 2024-12-04 09:41:08 +01:00
Felix Koppe
8e6cb27662 Fix lobbyView ready behavior on tskChange 2024-12-04 07:53:18 +01:00
Daniel Grigencha
29711d6210 Updated 'ClientStartGameMessage' class.
Updated the 'ClientStartGameMesssage' class by preparing it for the correct BPMN diagram.
2024-12-04 02:46:07 +01:00
Daniel Grigencha
29d8e791f6 Updated 'Player' class.
Updated the 'Player' class by adding the 'setPieceInHome' method to it.
2024-12-04 02:44:28 +01:00
Daniel Grigencha
4440341f79 Updated 'LobbyState' class.
Updated the 'LobbyState' class by updating the creation of the 'ServerStartGameMessage' object. In Addition, the start process if all players are ready was removed.
2024-12-04 02:44:03 +01:00
Daniel Grigencha
de5c8bf44c Updated 'Game' class.
Updated the 'Game' class by adding the 'getPlayersAsList' method to it.
2024-12-04 02:43:29 +01:00
Daniel Grigencha
ab5cece1b3 Updated 'StartGameMessage' class.
Updated the 'StartGameMessage' class by removing the unused 'forceStartGame' attribute from it.
2024-12-04 02:42:57 +01:00
Daniel Grigencha
b8ed5060d6 Updated 'Board' class.
Updated the 'Board' class by removing the 'playerData' attribute and its getter method from it.
2024-12-04 02:42:16 +01:00
Daniel Grigencha
c0b72ae4da Updated 'ServerStartGameMessage' class.
Updated the 'ServerStartGameMessage' class by adding the 'players' attribute and its getter method to it.
2024-12-04 02:41:44 +01:00
Daniel Grigencha
c1b4caa82b Updated 'LobbyState' class.
Updated the 'LobbyState' class by updating the 'received(ServerStartGameMessage msg)' method in it after updating the 'ServerStartGameMessage' class.
2024-12-04 02:22:58 +01:00
Daniel Grigencha
a757158477 Updated 'MdgaServer' class.
Updated the 'MdgaServer' class by removing the serializer registration in it.
2024-12-04 02:09:20 +01:00
Daniel Grigencha
964ff87b11 Updated client states.
Updated the client states by removing all references to the 'PlayerData' class.
2024-12-04 01:47:31 +01:00
Hanno Fleischer
7053b163e5 adjusted LobbyState in the client to use the correct Data 2024-12-03 18:19:55 +01:00
Hanno Fleischer
81cb2f33ff adjusted all constuctors of nodes so that if someone creates a node the piece will be null and the option for a constuctor without arguments is still given for serialization purposes 2024-12-03 17:56:39 +01:00
Hanno Fleischer
69865bb504 added the playeringamenotification to be created from the right dataset 2024-12-03 16:48:08 +01:00
Felix Koppe
db50986f3f Fix serialisation issue 2024-12-03 15:38:13 +01:00
Felix Koppe
a0a088a0c4 Fix minor error in notification processing 2024-12-03 15:00:00 +01:00
Cedric Beck
c4d11ff961 added window title 2024-12-03 09:15:14 +01:00
Daniel Grigencha
bb51976127 Updated 'Node' class.
Updated the 'Node' class by overload the 'isOccupied' method in it.
2024-12-03 04:57:30 +01:00
Daniel Grigencha
0db1f08f3c Updated abstract 'GameAutomatonState' class.
Updated the abstract 'GameAutomatonState' class by adding the 'getGameAutomaton' method to it.
2024-12-03 04:49:16 +01:00
Daniel Grigencha
336f1ec316 Updated 'Resources' class.
Updated the 'Resources' class by adding the 'MAX_EYES' constant to it.
2024-12-03 04:29:16 +01:00
Daniel Grigencha
a1e687912a Updated abstract 'TurnAutomatonState' class.
Updated the abstract 'TurnAutomatonState' class by adding the 'getTurnAutomaton' method to it.
2024-12-03 04:09:35 +01:00
Daniel Grigencha
2248d044c1 Updated 'AnimationState' class.
Updated the 'AnimationState' class by updating the content inside the 'received(AnimationEndMessage msg, int from) method in it.
2024-12-03 03:41:58 +01:00
Daniel Grigencha
79bf1c16e8 Updated 'Game' class.
Updated the 'Game' class by adding the 'getActivePlayerId' method to it.
2024-12-03 03:40:24 +01:00
Daniel Grigencha
3353a890d3 Updated 'Game' class.
Updated the 'Game' class by adding the 'getPlayerIdByColor' method to it.
2024-12-03 03:36:22 +01:00
Daniel Grigencha
a012402a85 Updated abstract 'TurnAutomatonState' class.
Updated the abstract 'TurnAutomatonState' class by updating the JavaDoc text of the constructor.
2024-12-03 02:15:10 +01:00
Daniel Grigencha
5aaf8d4850 Updated 'TurnState' class.
Updated the 'TurnState' class by setting the start state in it.
2024-12-03 01:31:22 +01:00
Daniel Grigencha
35ab777f04 Updated 'DetermineStartPlayerState' class.
Updated the 'DetermineStartPlayerState' class by fixing the logic inside the received(RequestDieMessage msg, int from)' method in it.
2024-12-03 01:30:39 +01:00
Daniel Grigencha
c707abc465 Updated 'Die' class.
Updated the 'Die' class by adding another constructor for test cases to it.
2024-12-03 01:04:02 +01:00
Daniel Grigencha
2a84e7cf65 Updated 'Player' class.
Updated the 'Player' class by moving all content of 'PlayerData' class in 'Player' class.
2024-12-03 00:51:45 +01:00
Daniel Grigencha
3a02edb944 Updated 'PlayerData' class.
Updated the 'PlayerData' class by updating the 'Piece' creation inside the constructor.
2024-12-03 00:50:53 +01:00
Daniel Grigencha
1870d4fe0e Updated 'ShieldState' enumeration.
Updated the 'ShieldState' enumeration by removing unused methods from it.
2024-12-03 00:49:09 +01:00
Daniel Grigencha
5cf9746931 Updated 'PieceState' enumeration.
Updated the 'PieceState' enumeration by removing unused methods from it.
2024-12-03 00:48:39 +01:00
Daniel Grigencha
5b9bc7aa36 Updated 'Piece' class.
Updated the 'Piece' class by removing the unused 'id' parameter from the constructor.
2024-12-03 00:38:24 +01:00
Daniel Grigencha
abe66aff5d Updated 'LobbyState' class.
Updated 'LobbyState' class by removed unused imports in it.
2024-12-03 00:37:24 +01:00
Fleischer Hanno
eea566cc8b added the logic for server shutdown 2024-12-02 23:25:54 +01:00
Daniel Grigencha
bd07a44607 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 23:24:02 +01:00
Daniel Grigencha
1f64676d31 Updated 'MdgaServer' class.
Updated the 'MdgaServer' class by adding the 'shutdown' message to it.
2024-12-02 23:23:56 +01:00
Daniel Grigencha
838f59b9aa Updated 'ServerState' class.
Updated the 'ServerState' class by filling the 'received(LeaveGameMessage msg, int from)' in it.
2024-12-02 23:22:45 +01:00
Daniel Grigencha
002a42be38 Updated 'LobbyState' class.
Updated the 'LobbyState' class by removing the 'received(LeaveGameMessage msg, int from)' from it.
2024-12-02 23:21:42 +01:00
Daniel Grigencha
a1d10521ac Updated 'ServerSener' interface.
Updated the 'ServerSender' interface by adding the 'shutdown' method to it.
2024-12-02 23:14:29 +01:00
Fleischer Hanno
4e6a272e7a added that when the client is in the game state and recieves the ceremony message it always changes to ceremony state 2024-12-02 23:08:56 +01:00
Daniel Grigencha
516848a67e Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 23:06:49 +01:00
Daniel Grigencha
659d69d3eb Updated 'GameState' class.
Updated the 'GameState' class by sending a broadcast message after a player left the game and only one player is remaining.
2024-12-02 23:06:44 +01:00
Daniel Grigencha
fb6cbeaaf5 Updated 'ServerStartGameMessage' class.
Updated the 'ServerStartGameMessage' class by adding the 'board' attribute and its getter method to it.
2024-12-02 23:00:39 +01:00
Cedric Beck
25f750c8b6 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 22:58:58 +01:00
Cedric Beck
3f49b432c4 added SSAO and FXAA 2024-12-02 22:58:52 +01:00
Daniel Grigencha
252c37ae9a Updated 'LobbyState' class.
Updated the 'LobbyState' class by sending the 'ServerStartGameMessage' with a 'Board' object.
2024-12-02 22:58:46 +01:00
Fleischer Hanno
4566d4c9a8 Merge remote-tracking branch 'origin/development' into development 2024-12-02 22:46:12 +01:00
Fleischer Hanno
e9ba888651 changed the logic so that the isHost is not decided by the client and instead by the server 2024-12-02 22:45:44 +01:00
Cedric Beck
cbbb98037b Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 22:43:16 +01:00
Cedric Beck
aa651ec62f added trees 2024-12-02 22:43:03 +01:00
Daniel Grigencha
e163b87cc4 Updated 'MdgaServer' class.
Updated the 'MdgaServer' class by updating the logic inside the 'connectionAdded' method in it.
2024-12-02 22:41:17 +01:00
Daniel Grigencha
1eb24b7a66 Updated 'MdgaServer' class.
Updated the 'MdgaServer' class by updating the logic inside the 'connectionAdded' method in it.
2024-12-02 22:37:46 +01:00
Daniel Grigencha
492f7422f5 Updated 'LobbyAcceptMessage' class.
Updated the 'LobbyAcceptMessage' class by adding the 'host' attribute and its getter method to it.
2024-12-02 22:36:48 +01:00
Daniel Grigencha
27f8af70f5 Updated 'Game' class.
Updated the 'Game' class by setting the default value of 'host' attribute. In Addition, the 'isHost' method was added.
2024-12-02 22:34:45 +01:00
Fleischer Hanno
5910fcc701 added the client logic to receive the LobbyAccept and LobbyDeny message 2024-12-02 21:52:07 +01:00
Felix Koppe
e94ed1e019 Fix syntax error 2024-12-02 21:51:09 +01:00
Felix Koppe
7d54a906dd Add some more names 2024-12-02 21:48:23 +01:00
Felix Koppe
5ae65921bf Add more random names 2024-12-02 21:42:12 +01:00
Daniel Grigencha
468e4005dc Updated 'LobbyState' class.
Updated the 'LobbyState' class by sending a broadcast update the new ready state of the client.
2024-12-02 21:23:53 +01:00
Daniel Grigencha
72321eab9a Updated 'LobbyState' class.
Updated the 'LobbyState' class by updating all received methods in it.
2024-12-02 21:22:49 +01:00
Daniel Grigencha
951c92d890 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 21:12:03 +01:00
Felix Koppe
e87eb569c2 Add showInfo to MdgaView 2024-12-02 21:16:50 +01:00
Felix Koppe
baa967ecfc Merge commit 2024-12-02 21:12:56 +01:00
Felix Koppe
8d39d61c71 Add infoNotification 2024-12-02 21:12:43 +01:00
Daniel Grigencha
7fcee3cac0 Updated 'MdgaServer' class.
Updated the 'MdgaServer' class by register the 'IncorrectRequestMessage' class to the serializer.
2024-12-02 21:11:59 +01:00
Daniel Grigencha
06d4b322e7 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 21:04:41 +01:00
Daniel Grigencha
1cf14f65bb Updated 'MdgaServer' class.
Updated the 'MdgaServer' class by updating the 'connectionAdded' method in it. In Addition, the JavaDoc text for this method was addded.
2024-12-02 21:04:36 +01:00
Fleischer Hanno
ebb9f839c7 added JavaDocs in Resources.java 2024-12-02 20:58:00 +01:00
Daniel Grigencha
3eef4b2a02 Updated 'PlayerData' class.
Updated the 'PlayerData' class by replacing the magic constants with the 'Resources' class. In Addition, some JavaDoc texts were updated.
2024-12-02 20:56:59 +01:00
Daniel Grigencha
c1fa679261 Updated 'Resources' class.
Updated the 'Resources' class by adding the 'MAX_PIECES' constant to it.
2024-12-02 20:45:07 +01:00
Daniel Grigencha
c48f924ead Updated 'Resources' class.
Updated the 'Resources' class by adding the 'MAX_PLAYERS' constant to it.
2024-12-02 20:43:47 +01:00
Fleischer Hanno
73859d8c81 added methods for getting Boolean, String, Double and int 2024-12-02 20:34:52 +01:00
Felix Koppe
1918aa80ff Merge commit 2024-12-02 20:33:36 +01:00
Felix Koppe
d062b9dabc Add forceStartGameButton to host in lobby 2024-12-02 20:32:46 +01:00
Fleischer Hanno
7ddcdc3f48 added the first error.messages and adjusted 2024-12-02 20:24:17 +01:00
Fleischer Hanno
2cefc2c293 Merge remote-tracking branch 'origin/development' into development 2024-12-02 20:19:44 +01:00
Daniel Grigencha
c4304ae99a Updated 'Game' class.
Updated the 'Game' class by removing the 'allReady' attribute in it. In Addtion, the 'areAllReady' method was added.
2024-12-02 20:19:13 +01:00
Fleischer Hanno
005df94114 added Resources calss to access teh properties 2024-12-02 19:55:18 +01:00
Daniel Grigencha
44f893ccef Updated 'Game' class.
Updated the 'Game' class by setting the 'die' attribute correctly inside the constructor.
2024-12-02 19:45:11 +01:00
Daniel Grigencha
0d9a922f55 Removed 'PlayerDataMessage' and 'StartBriefingMessage'. 2024-12-02 19:16:01 +01:00
Daniel Grigencha
289158cf35 Updated 'MdgaServer' class.
Updated the 'MdgaServer' class by removing the 'PlayerDataMessage' and 'StartBriefingMessage' from the serializer.
2024-12-02 19:14:11 +01:00
Fleischer Hanno
0a0762b6c9 removed all instances of PlayerDataMEssage and StartBriefingMessage 2024-12-02 19:07:58 +01:00
Fleischer Hanno
90a21087df added logic for incorrectRequest message and removed messages playerdata and startbriefing and created javadocs 2024-12-02 19:02:00 +01:00
Daniel Grigencha
294ecdc56f Updated 'IncorrectRequestMessage' class.
Updated the 'IncorrectRequestMessage' class by updating the content inside the 'accept' method in it.
2024-12-02 19:00:21 +01:00
Daniel Grigencha
347ed152b8 Added 'IncorrectRequestMessage' class.
Added the 'IncorrectRequestMessage' class to this project. It will be used to send the client an incorrect request message to show they did something wrong.
2024-12-02 18:58:15 +01:00
Daniel Grigencha
3daafde9f1 Updated 'ServerInterpreter' class.
Updated the 'ServerInterpreter' class by adding the 'received(IncorrectRequestMessage msg)' method to it.
2024-12-02 18:50:42 +01:00
Daniel Grigencha
09fda6b167 Updated 'Game' class.
Updated the 'Game' class by adding the 'isColorTaken' method to it.
2024-12-02 18:18:04 +01:00
Cedric Beck
f21fd9b0a6 added setPauseOnLostFocus(false) 2024-12-02 17:28:37 +01:00
Cedric Beck
41e204b1f2 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 17:12:00 +01:00
Cedric Beck
208261c6bf added clickDice Action + modelSync 2024-12-02 17:11:55 +01:00
Hanno Fleischer
0411f2ead4 fixed state transitions in gamestateclient automaton 2024-12-02 17:08:46 +01:00
Cedric Beck
eb819d4d5e merge development 2024-12-02 16:49:37 +01:00
Cedric Beck
a2856bb157 added rollRankingResults 2024-12-02 16:47:28 +01:00
Daniel Grigencha
bcf17a0651 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 16:35:49 +01:00
Daniel Grigencha
eee6fccde5 Updated 'DetermineStartPlayerState' class.
Updated the 'DetermineStartPlayerState' class by setting the start state correctly and enter it.
2024-12-02 16:35:40 +01:00
Felix Koppe
2118c72891 Adjust RollDiceNotification 2024-12-02 16:34:55 +01:00
Daniel Grigencha
cb362c4d0c Used auto-reformate code. 2024-12-02 16:31:57 +01:00
Daniel Grigencha
1bcb73cff7 Updated 'PlayerData' class.
Updated the 'PlayerData' class by adding the 'isFinished' method to it. In Addition, the empty constructor was optimized to initalize all class attributes for serializable cases.
2024-12-02 16:29:32 +01:00
Daniel Grigencha
167d898a3c Updated 'StartNode' class.
Updated the 'StartNode' class by reverting all enumerations to its origin types in it.
2024-12-02 16:25:33 +01:00
Daniel Grigencha
6c136b78b8 Updated 'Piece' class.
Updated the 'Piece' class by reverting all enumeration to its orgin types.
2024-12-02 16:22:50 +01:00
Felix Koppe
82234a7ff9 Merge commit 2024-12-02 15:44:41 +01:00
Felix Koppe
92d2e74748 Fix error regarding color in lobbyState 2024-12-02 13:06:59 +01:00
Felix Koppe
4561a962d4 Fix lobby isSelf logic and no longer assign color on join 2024-12-02 12:52:07 +01:00
Hanno Fleischer
5db7b64cef fixed bug with seriliazation of Board, now sending playerdata seperate from teh board 2024-12-02 12:16:53 +01:00
Felix Koppe
bb1b721e77 Fix lobby in serverAutomaton and adjust TskUpdateMessage 2024-12-02 11:48:54 +01:00
Cedric Beck
206cad2f79 removed test card 2024-12-02 11:01:02 +01:00
Cedric Beck
3717e7b794 added javadocs to board 2024-12-02 03:48:11 +01:00
Cedric Beck
a15d7932d4 fixed bug 2024-12-02 03:15:18 +01:00
Cedric Beck
d649e41e75 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 03:13:48 +01:00
Cedric Beck
6d0552f5a7 added javadocs to animation; moved outline package 2024-12-02 03:13:42 +01:00
Fleischer Hanno
47f9f46277 Merge remote-tracking branch 'origin/development' into development 2024-12-02 03:03:47 +01:00
Felix Koppe
b87f5de5fb Fix error 2024-12-02 03:03:54 +01:00
Fleischer Hanno
c434bcb684 minor changes 2024-12-02 03:03:36 +01:00
Daniel Grigencha
b9617c0a14 Merge remote-tracking branch 'origin/development' into development 2024-12-02 02:53:05 +01:00
Daniel Grigencha
0aa73ca6ee added the received method for a Shutdown Message 2024-12-02 02:52:48 +01:00
Cedric Beck
fbc7246037 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 02:52:41 +01:00
Cedric Beck
2703084df1 added move/swap/throw animation; reworked waitingNodes logic in BoardHandler 2024-12-02 02:51:52 +01:00
Daniel Grigencha
31b1d535ac added a new 'ShutdownMessage' for the server 2024-12-02 02:32:50 +01:00
Daniel Grigencha
b3fb2f8fa4 added a new 'ShutdownMessage' for the server 2024-12-02 02:31:55 +01:00
Daniel Grigencha
8fcac9b809 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 02:15:29 +01:00
Daniel Grigencha
6985d988f4 Updated 'DetermineStartPlayerState' class.
Updated the 'DetermineStartPlayerState' class by updating the logic inside the 'received(RequestDieMessage msg, int from)' method in it.
2024-12-02 02:15:22 +01:00
Fleischer Hanno
6c3103b2ed fixing serialization error 2024-12-02 02:14:45 +01:00
Fleischer Hanno
3658c88d72 made all enums look like the color enum 2024-12-02 02:11:40 +01:00
Fleischer Hanno
bfc812b003 minas please help no serialization 2024-12-02 02:07:02 +01:00
Felix Koppe
413f35d7bf Merge commit 2024-12-02 01:59:49 +01:00
Felix Koppe
c5cb3d4dd0 Add restart on resolution change 2024-12-02 01:59:37 +01:00
Daniel Grigencha
efb4439431 Updated 'Game' class.
Updated the 'Game' class by adding the 'setDie' method to it.
2024-12-02 01:53:10 +01:00
Felix Koppe
601366f08d Merge commit 2024-12-02 01:40:58 +01:00
Felix Koppe
918c1f2a8a Add videoSettings 2024-12-02 01:40:45 +01:00
Daniel Grigencha
bf75b8afc9 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 01:39:07 +01:00
Daniel Grigencha
0b45727bd7 Updated 'Die' class.
Updated the 'Die' class by adding a third constructor for test cases.
2024-12-02 01:39:01 +01:00
Daniel Grigencha
a19ac2fc51 Updated 'GameState' class.
Updated the 'GameState' class by changing the data types of 'determineStartPlayerState, 'animationState' and 'turnState' attributes in it.
2024-12-02 01:27:21 +01:00
Daniel Grigencha
79f0e55c52 default value of playerData in 'Board' 2024-12-02 01:19:41 +01:00
Fleischer Hanno
44378486d4 Merge remote-tracking branch 'origin/development' into development 2024-12-02 01:17:14 +01:00
Fleischer Hanno
149931d2cb fixed PlayerData mistake 2024-12-02 01:16:33 +01:00
Daniel Grigencha
1250500558 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 01:01:49 +01:00
Daniel Grigencha
177bfe3001 Updated 'DetermineStartPlayerState' class.
Updated the 'DeterminStartPlayerState' class by removing the 'getDiceResults' method from it. In Addition, the logic inside the 'received(RequestDieMessage msg, int from)' was added.
2024-12-02 01:01:42 +01:00
Felix Koppe
138444439d Merge remote-tracking branch 'origin/development' into development 2024-12-02 00:53:58 +01:00
Felix Koppe
702f96b8db Add videoSettings 2024-12-02 00:53:11 +01:00
Fleischer Hanno
1b6407b75b fixed bug 2024-12-02 00:52:28 +01:00
Fleischer Hanno
c649b8f3ae creating MapCreation Notification 2024-12-02 00:44:11 +01:00
Daniel Grigencha
41a669d44d Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 00:42:17 +01:00
Daniel Grigencha
4b6b12c0ac Updated 'Board' class.
Updated the 'Board' class by adding the 'addPlayerData' method to it.
2024-12-02 00:42:07 +01:00
Daniel Grigencha
c1280ba089 Updated 'LobbyState' class.
Updated the 'LobbyState' class by adding 'initializeGame' method to it.
2024-12-02 00:40:21 +01:00
Felix Koppe
02f285a258 Remove cheat button 2024-12-02 00:39:58 +01:00
Daniel Grigencha
bcb0ebc0f8 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 00:29:21 +01:00
Daniel Grigencha
a19902f819 Updated 'LobbyState' class.
Updated the 'LobbyState' class by changing the method call 'isActive' to 'isReady'.
2024-12-02 00:28:59 +01:00
Fleischer Hanno
585687055c Merge remote-tracking branch 'origin/development' into development 2024-12-02 00:28:41 +01:00
Fleischer Hanno
a86319082c included the LobbyPlayerJoined MEssage parameter of isHost 2024-12-02 00:28:04 +01:00
Daniel Grigencha
7acc55fe25 Updated 'MdgaServer' class.
Updated the 'MdgaServer' class by saving the host into the 'Game' class.
2024-12-02 00:28:01 +01:00
Daniel Grigencha
3e56de2a17 Updated 'LobbyState' class.
Updated the 'LobbyState' class by changing the method call 'isActive' to 'isReady'.
2024-12-02 00:23:03 +01:00
Daniel Grigencha
468cd97374 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-02 00:20:41 +01:00
Daniel Grigencha
dee6bf9f9c Updated 'Game' class.
Updated the 'Game' class by adding the 'host' attribute and its getter method to it.
2024-12-02 00:19:46 +01:00
Daniel Grigencha
ea6431faa4 Updated 'LobbyPlayerJoinedMessage' class.
Updated the 'LobbyPlayerJoinedMessage' class by adding the 'host' attribute and its getter method to.
2024-12-02 00:12:46 +01:00
Cedric Beck
f272fd6f08 fixed bug again 2024-12-02 00:10:58 +01:00
Cedric Beck
bfc74ee126 fixed bug 2024-12-02 00:04:48 +01:00
Cedric Beck
d890d11978 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-01 23:58:57 +01:00
Daniel Grigencha
9af20346f1 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-01 23:58:44 +01:00
Cedric Beck
f853b0b54f Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-01 23:57:59 +01:00
Cedric Beck
9dd2d3f58b added finish text; edited Notifications 2024-12-01 23:57:53 +01:00
Daniel Grigencha
06e43903e6 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-01 23:57:39 +01:00
Fleischer Hanno
00a04c2403 fixed a bug 2024-12-01 23:57:39 +01:00
Daniel Grigencha
92cbd9202a Updated 'LobbyState' class.
Updated the 'LobbyState' class by fixing the error by sending the 'ServerStartGameMessage' after all players are ready.
2024-12-01 23:57:26 +01:00
Felix Koppe
9a06afe998 Merge commit 2024-12-01 23:56:33 +01:00
Felix Koppe
289390c528 Add comment 2024-12-01 23:56:24 +01:00
Fleischer Hanno
7712a23d00 added transition from Lobby to Game 2024-12-01 23:50:37 +01:00
Fleischer Hanno
8137a727f5 Merge remote-tracking branch 'origin/development' into development 2024-12-01 23:49:30 +01:00
Felix Koppe
d904a28ee0 Remove mock 2024-12-01 23:48:18 +01:00
Fleischer Hanno
2f2d9c7479 Merge remote-tracking branch 'origin/development' into development 2024-12-01 23:42:56 +01:00
Fleischer Hanno
c2b6e6e9e9 made all classes for ServerStartGameMEssage serializiable 2024-12-01 23:42:32 +01:00
Daniel Grigencha
697b974ce1 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-01 23:42:09 +01:00
Felix Koppe
f0cab64910 Minor change 2024-12-01 23:46:46 +01:00
Daniel Grigencha
adcf65d7aa Updated 'LobbyState' class.
Updated the 'LobbyState' class by sending a broadcast message after all players are ready. In Addition, the 'ServerStartGameMessage' getting the 'Board' object.
2024-12-01 23:41:10 +01:00
Daniel Grigencha
8f53b76a3e Updated 'ServerStartGameMessage' class.
Updated the 'ServerStartGameMessage' class by adding the 'board' attribute and its getter method to it.
2024-12-01 23:39:36 +01:00
Cedric Beck
eaef4b20ba Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-01 23:34:02 +01:00
Cedric Beck
d3fe2fec14 added show/hide functionality for select button 2024-12-01 23:33:28 +01:00
Daniel Grigencha
02d7ef1dd8 Updated 'ChoosePieceState' class.
Updated the 'ChoosePieceState' to work correctly as a state automaton.
2024-12-01 23:28:50 +01:00
Daniel Grigencha
23aa2db714 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-01 23:27:50 +01:00
Daniel Grigencha
e68369074f Updated 'RollDiceState' class.
Updated the 'RollDiceState' class by removing a spelling mistake.
2024-12-01 23:27:45 +01:00
Daniel Grigencha
aafc804c3f Updated 'ChoosePieceState' class.
Updated the 'ChoosePieceState' to work correctly as a state automaton.
2024-12-01 23:26:53 +01:00
Felix Koppe
bec199036c Minor change 2024-12-01 23:10:25 +01:00
Fleischer Hanno
a7e048d4b4 Merge remote-tracking branch 'origin/development' into development 2024-12-01 23:08:50 +01:00
Felix Koppe
bcd510804f Merge commit 2024-12-01 23:12:46 +01:00
Felix Koppe
7319f7a62c Process startMenuNotification in lobby 2024-12-01 23:12:36 +01:00
Fleischer Hanno
a1e51fb2f4 added logic to the leave game method 2024-12-01 23:08:25 +01:00
Daniel Grigencha
f15d0eb5d8 Merge branch 'development' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development 2024-12-01 23:06:31 +01:00
Daniel Grigencha
f484a4abc8 Updated server states.
Updated server stats by adding the logger to all states. In Addition, new joined clients should be updated correctly.
2024-12-01 23:06:02 +01:00
Felix Koppe
5905a232a5 Adjust state 2024-12-01 23:03:26 +01:00
Cedric Beck
12cb87ef70 added outline package back 2024-12-01 22:56:09 +01:00
Cedric Beck
9cb7a156bb Merge branch 'development' into dev/client_beck 2024-12-01 22:47:48 +01:00
Fleischer Hanno
76e2606847 reverted the client state machine 2024-12-01 22:47:13 +01:00
Cedric Beck
7762b97303 added init & taktical view by ownColor 2024-12-01 22:46:17 +01:00
Daniel Grigencha
eaf46f3e14 updated the project to pass the checkstyle 2024-12-01 22:37:49 +01:00
Fleischer Hanno
92be52b62a fixed server join logic 2024-12-01 22:33:30 +01:00
Fleischer Hanno
7a0a3589a5 trying to fix server ip to use outward ip 2024-12-01 22:14:09 +01:00
Cedric Beck
661c28f096 merge to dev/client_beck from development 2024-12-01 22:06:30 +01:00
Cedric Beck
4a94e85aac Merge branch 'dev/client' into dev/client_beck 2024-12-01 21:55:37 +01:00
Felix Koppe
799bd096a0 Merge development 2024-12-01 21:56:52 +01:00
Fleischer Hanno
5a68d3b146 fixed a method call for getMoveIndices 2024-12-01 21:52:28 +01:00
Cedric Beck
63fa692910 removed comments 2024-12-01 21:52:28 +01:00
Felix Koppe
638cb93d7b Merge dev/client_beck 2024-12-01 21:51:01 +01:00
Fleischer Hanno
133f900ec7 added the server and network functionality for mdga and fixed the communication in the Lobby 2024-12-01 21:50:28 +01:00
Fleischer Hanno
33ddea4221 Merge remote-tracking branch 'origin/development' into development 2024-12-01 21:49:30 +01:00
Daniel Grigencha
977a7294ad updated server state diagram and added missing classes 2024-12-01 21:49:11 +01:00
Cedric Beck
7db75a2ca1 added converted assets 2024-12-01 21:48:40 +01:00
Daniel Grigencha
71d5701cc7 added javadoc for the classes in the notification package 2024-12-01 21:44:35 +01:00
Fleischer Hanno
42feca466d Merge remote-tracking branch 'origin/development' into development 2024-12-01 21:05:41 +01:00
Daniel Grigencha
95a1f8d858 removed all inheritance of the automaton for testing purposes 2024-12-01 21:05:22 +01:00
Fleischer Hanno
76757c19a9 Merge remote-tracking branch 'origin/development' into development 2024-12-01 21:02:11 +01:00
Daniel Grigencha
c3fdcf4dc7 added the states of the server automaton for testing purposes 2024-12-01 21:01:37 +01:00
Fleischer Hanno
8ffab12f49 Merge remote-tracking branch 'origin/development' into development 2024-12-01 20:57:57 +01:00
Cedric Beck
da2b1af698 fixed shutdown guiHandler bug 2024-12-01 20:45:24 +01:00
Daniel Grigencha
8369797120 added JavaDocs for the 'InterruptState' classe 2024-12-01 20:41:30 +01:00
Daniel Grigencha
ef450a23f5 added logger to server state chart 2024-12-01 20:35:40 +01:00
Cedric Beck
e5b007accd debug commit 2024-12-01 20:24:26 +01:00
Daniel Grigencha
17f0aa0209 added the 'Die' class to the 'Game' class 2024-12-01 19:46:59 +01:00
Fleischer Hanno
1d8eff8ea9 Merge remote-tracking branch 'origin/development' into development 2024-12-01 19:45:06 +01:00
Daniel Grigencha
ff31335a98 added a new class 'Die' to handle the dice. added this class to the class 'Game' 2024-12-01 19:38:26 +01:00
Daniel Grigencha
3467dd2f04 added a new method getColorByIndex(int) and next() method to the enum 'Color' 2024-12-01 19:37:40 +01:00
Daniel Grigencha
fb6cfaa518 added JavaDocs for the classes in the package 'game' 2024-12-01 19:36:58 +01:00
Cedric Beck
c08c81ea46 edited map 2024-12-01 18:42:57 +01:00
Fleischer Hanno
e9d45f241f Merge remote-tracking branch 'origin/development' into development 2024-12-01 18:22:29 +01:00
Daniel Grigencha
bf38a7e00c added a new method 'disconnectClient' in 'ServerSender' interface 2024-12-01 18:21:54 +01:00
Fleischer Hanno
5d638a1da7 Merge remote-tracking branch 'origin/development' into development 2024-12-01 18:20:16 +01:00
Fleischer Hanno
b83279e835 Merge remote-tracking branch 'origin/development' into development 2024-12-01 18:16:05 +01:00
Daniel Grigencha
eb54cfbc80 adjusted constructor for mdga server 2024-12-01 18:15:56 +01:00
Cedric Beck
453aacfe1a fixed missing messages 2024-12-01 18:12:31 +01:00
Daniel Grigencha
1513576291 added javadocs to the 'ServerState' class 2024-12-01 18:03:46 +01:00
Cedric Beck
2732a89da6 fixed error with SelectObjectOutliner 2024-12-01 17:47:04 +01:00
Felix Koppe
5b8032bed9 Prepare for model 2024-12-01 17:44:37 +01:00
Felix Koppe
21f98de3e6 Minor adjustment 2024-12-01 17:32:05 +01:00
Cedric Beck
b099972656 merge from dev/client_beck 2024-12-01 17:10:04 +01:00
Fleischer Hanno
5206b03966 added java docs 2024-12-01 17:03:56 +01:00
Cedric Beck
eb703cbd2c fixed bad performancegit status!; edited GameNotification; fixed error because of changed 'Color' enum 2024-12-01 17:03:09 +01:00
Daniel Grigencha
8c03b282b3 deleted the color attribute and their usages 2024-12-01 16:58:37 +01:00
Daniel Grigencha
a29e942191 added logic to the 'MdgaServer' class 2024-12-01 16:57:48 +01:00
Daniel Grigencha
efc7a2f09d added logic to the 'LobbyState' class
- for leaving the lobby
2024-12-01 16:49:05 +01:00
Daniel Grigencha
121d668bf2 added logic to the 'LobbyState' class 2024-12-01 16:08:14 +01:00
Fleischer Hanno
ba5b9dc4b4 added the getter for the forcestartGame value in teh corresponding message 2024-12-01 16:04:55 +01:00
Daniel Grigencha
772c7a51e0 updated enum 'Color' 2024-12-01 15:54:06 +01:00
Fleischer Hanno
ed04bc1119 changed all messages to work with a UUID of a piece instead of a string identifier 2024-12-01 15:45:30 +01:00
Fleischer Hanno
7712ee2e7c renamed JoinServerMessage to JoinedLobbyMessage and wrote a getter for the name in the message 2024-12-01 15:14:42 +01:00
Fleischer Hanno
1d5733a4b9 added a method for getting a piece through a uuid 2024-12-01 15:05:26 +01:00
Fleischer Hanno
dfea7e8736 added java docs for choosepowercard 2024-12-01 14:37:04 +01:00
Felix Koppe
2c81665f80 Update startmenu.png 2024-12-01 14:22:18 +01:00
Felix Koppe
150e4e4c22 Merge development 2024-12-01 14:18:44 +01:00
Felix Koppe
4ff84e64ed Merge development 2024-12-01 14:11:10 +01:00
Felix Koppe
e6fb78507c Remove garbarge files 2024-12-01 14:10:04 +01:00
Felix Koppe
9067a9b04c Add javadoc 2024-12-01 14:08:33 +01:00
Felix Koppe
6758abd60e Add javadoc to buttons 2024-12-01 13:56:45 +01:00
Fleischer Hanno
e70331d85d changed parameter of DieMessage and included the force resumgame logic in intterrupt 2024-12-01 13:56:31 +01:00
Felix Koppe
c3ad8fe79a Gerneral improvements 2024-12-01 13:35:14 +01:00
Fleischer Hanno
26d2d0587d added the remaining logic for GameState and its substatemachines 2024-12-01 12:36:44 +01:00
Fleischer Hanno
00b3ef1d80 added selectNext in CLG 2024-12-01 12:12:37 +01:00
Fleischer Hanno
789868863f added some more client game logic 2024-12-01 12:06:06 +01:00
Fleischer Hanno
bdc527b83e added more logic to the client (choosepiece and powercard) 2024-12-01 08:40:16 +01:00
Fleischer Hanno
5ff56ed9d8 added all necessary logic for the turn waiting class and adjusted some messages 2024-11-30 22:23:40 +01:00
Fleischer Hanno
81d037d232 made the determinstartplayer machine fully functional 2024-11-30 20:50:57 +01:00
Fleischer Hanno
422e94ec48 Dialog state machine is now fully functional 2024-11-30 19:49:52 +01:00
Fleischer Hanno
b3d754e77f added all current State getter in every client state machine 2024-11-30 16:42:24 +01:00
Fleischer Hanno
0297193be1 added more functionality to the client state machine and implemeted the first notifications 2024-11-30 16:23:09 +01:00
Felix Koppe
a630ade2e1 Fix lobbyView leave 2024-11-30 14:21:45 +01:00
Felix Koppe
b197d70d44 Fix errors 2024-11-30 14:18:00 +01:00
Felix Koppe
67d120c278 Fix error 2024-11-30 14:10:42 +01:00
Felix Koppe
d53067f21a Merge dev/client 2024-11-30 14:03:54 +01:00
Felix Koppe
4313468a0c Finish merge 2024-11-30 14:00:42 +01:00
Felix Koppe
0393e9b534 Fixing errors 2024-11-30 13:47:34 +01:00
Felix Koppe
f3bc6bc2f0 Fixing errors 2024-11-30 13:38:08 +01:00
Felix Koppe
12abe081c9 Minor changes 2024-11-30 13:21:31 +01:00
Felix Koppe
02b536aa82 102IQ 2024-11-30 13:17:53 +01:00
Felix Koppe
99ffee749e 101IQ 2024-11-30 13:14:41 +01:00
Felix Koppe
6f71a8b16d Work# 2024-11-30 13:12:51 +01:00
Felix Koppe
a78b3acacd 100IQ 2024-11-30 13:10:46 +01:00
Fleischer Hanno
0487ff0238 modified messages to work with piece uuid instead of an identifier. 2024-11-30 13:02:23 +01:00
Felix Koppe
6a85aca970 Readd .run after some fool deleted it 2024-11-30 12:56:12 +01:00
Felix Koppe
c2cfd8c175 Merge remote-tracking branch 'origin/dev/client_beck' into dev/client_beck
# Conflicts:
#	Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java
#	Projekte/mdga/model/src/main/java/pp.mdga/server/Lobby.java
2024-11-30 12:48:49 +01:00
Felix Koppe
af5d4a95cd Remove notifications 2024-11-30 12:45:08 +01:00
Felix Koppe
129ce54dd8 Merge branch 'refs/heads/development' into dev/client_beck
# Conflicts:
#	Projekte/mdga/model/src/main/java/pp.mdga/server/DetermineStartPlayer.java
#	Projekte/mdga/model/src/main/java/pp.mdga/server/Lobby.java
#	Projekte/mdga/model/src/main/java/pp.mdga/server/Turn.java
#	Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableMoveNotification.java
#	Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectablePiecesNotification.java
#	Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableSwapNotification.java
2024-11-30 12:44:04 +01:00
Felix Koppe
8c8bd4db0d Add sounds 2024-11-30 12:37:18 +01:00
Cedric Beck
1c222ce0e0 tried mergee with development 2024-11-30 12:36:09 +01:00
Cedric Beck
f7a34d0d59 tried merge with dev/client 2024-11-30 12:34:39 +01:00
Cedric Beck
cbb21e92f8 added init/shutdown 2024-11-30 12:07:42 +01:00
Fleischer Hanno
4d6cd63a3d made all notifications constructors public 2024-11-30 11:24:46 +01:00
Felix Koppe
36d31e99e9 Fix error 2024-11-30 11:19:54 +01:00
Felix Koppe
28a2c9a448 Add confirm button 2024-11-30 11:17:42 +01:00
Felix Koppe
dd8b16f1ac Merge commit 2024-11-30 10:52:44 +01:00
Felix Koppe
be15b3bd63 Minor changes 2024-11-30 10:51:35 +01:00
Cedric Beck
07f0f55192 added further notification implemenation 2024-11-30 00:33:10 +01:00
Cedric Beck
13690cf73d added skybox; reworked guiHandler 2024-11-29 21:28:50 +01:00
Cedric Beck
220d8ff47e added activePlayer+diceNum text display 2024-11-29 17:26:04 +01:00
Cedric Beck
67bb30d124 added new notifications for client-view communication 2024-11-29 15:23:34 +01:00
Felix Koppe
184410ba31 Merge commit 2024-11-29 14:38:23 +01:00
Felix Koppe
3147f5b7a3 Fix some errors 2024-11-29 14:37:46 +01:00
Felix Koppe
0e79f35cb0 Merge dev/client_koppe2 2024-11-29 14:02:59 +01:00
Felix Koppe
f024ba4866 Add preferences and sounds 2024-11-29 14:01:18 +01:00
Felix Koppe
35270cce7b Fix ceremony statistics error 2024-11-29 12:49:07 +01:00
Felix Koppe
b0761082ce Fix error after merge 2024-11-29 12:42:03 +01:00
Felix Koppe
46182b33a8 Merge dev/client_koppe2 and development 2024-11-29 12:36:07 +01:00
Felix Koppe
457023ad93 Work 2024-11-29 12:30:59 +01:00
Felix Koppe
c3055a0646 Work 2024-11-29 12:29:20 +01:00
Felix Koppe
ae1ec74056 Merge dev/client_beck 2024-11-29 10:48:05 +01:00
Felix Koppe
24cc81d9d4 Merge remote-tracking branch 'origin/dev/client_beck' into dev/client_koppe2
# Conflicts:
#	Projekte/mdga/client/src/main/java/pp/mdga/client/MdgaApp.java
#	Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java
#	Projekte/mdga/client/src/main/java/pp/mdga/client/view/GameView.java
2024-11-29 10:13:15 +01:00
Felix Koppe
c25c12d0d6 Work on ceremony2 2024-11-29 09:45:36 +01:00
Felix Koppe
7b689d6bf6 Work on ceremony 2024-11-28 21:39:08 +01:00
Cedric Beck
2099e02567 added board dice; edited DiceControl; added high-res font; working on ActionTextHandler 2024-11-28 20:07:15 +01:00
Fleischer Hanno
7690340b8f added mor client state transitions
and renamed every client state with state as its suffix and renamed every message with messag as its suffix
2024-11-28 18:28:55 +01:00
Cedric Beck
3dcdbdf489 added display of 'colorÃ' to playerName 2024-11-28 17:29:59 +01:00
Felix Koppe
88cb87d4cd Merge commit 2024-11-28 16:25:57 +01:00
Felix Koppe
827e7aac86 Add stuff 2024-11-28 16:25:13 +01:00
Felix Koppe
eec68188ee Make use of parallelProjection 2024-11-28 16:08:33 +01:00
Hanno Fleischer
476ca82bda created the first part of the cliejnt state machine with its corresponding logic 2024-11-28 15:27:31 +01:00
Felix Koppe
3235a46788 Rewrite gui 2024-11-28 15:00:53 +01:00
Cedric Beck
7da388af37 added improved pieces model; added functionality to notifications + todos 2024-11-28 02:08:51 +01:00
Cedric Beck
304acf17a3 added full highlight functionality for bonuscards; added bonus Symbols display 2024-11-28 01:21:15 +01:00
Cedric Beck
9736dc828b added highlight to bonuscards 2024-11-27 19:50:29 +01:00
Cedric Beck
0b9fc90274 added dice, started adding notification implementation, added hover, highlight and select functionality for pieces 2024-11-27 03:05:35 +01:00
Cedric Beck
6528e5c2b6 started adding notifications 2024-11-26 20:53:29 +01:00
Cedric Beck
c204a3a4cb change shader folder structure 2024-11-26 17:05:38 +01:00
Cedric Beck
d794ba9d03 added smooth outline 2024-11-26 16:54:40 +01:00
Cedric Beck
e97147d0e9 merge from koppe 2024-11-26 16:47:24 +01:00
Cedric Beck
1b151aabdd added select nodes, cards & pieces 2024-11-26 16:45:13 +01:00
Felix
3e7d3dbc1b Fix 2024-11-26 16:18:33 +01:00
Cedric Beck
7a482b74ab fixed shaders in/out 2024-11-26 13:29:40 +01:00
Cedric Beck
5cc1888794 merge dev/client_koppe into dev/client_beck for camera movement 2024-11-26 13:13:32 +01:00
Cedric Beck
9dd70a96a0 added outline for bonuscards 2024-11-26 12:56:26 +01:00
Cedric Beck
80f5c4ce90 tried adding shield outline, but there is a bug -> black screen 2024-11-26 07:40:41 +01:00
Cedric Beck
b9986ded87 try push 2024-11-24 22:41:17 +01:00
Cedric Beck
fd09460d61 try push 2024-11-24 22:40:50 +01:00
Cedric Beck
e5dca013d1 try push 2024-11-24 22:38:23 +01:00
Cedric Beck
7bfc6e7c3e try push 2024-11-24 22:37:37 +01:00
Cedric Beck
10428deedd added resource restructuring 2024-11-24 19:54:29 +01:00
Cedric Beck
a196d3d7f2 added basic player name display 2024-11-24 19:49:54 +01:00
570 changed files with 35520 additions and 55847 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
.run/
.gradle
build/
#!gradle/wrapper/gradle-wrapper.jar

Binary file not shown.

View File

@@ -1,5 +0,0 @@
plugins {
id 'buildlogic.java-library-conventions'
}
description = 'Common classes'

View File

@@ -1,7 +0,0 @@
handlers=java.util.logging.ConsoleHandler
.level=INFO
;pp.level=FINE
pp.util.triangulation.Polygon.level=FINE
java.util.logging.ConsoleHandler.level=FINER
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format=[%4$s %2$s] %5$s%6$s%n

View File

@@ -1,257 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
import java.util.Objects;
import static pp.util.FloatMath.DEG_TO_RAD;
import static pp.util.FloatMath.FLT_EPSILON;
import static pp.util.FloatMath.RAD_TO_DEG;
import static pp.util.FloatMath.abs;
import static pp.util.FloatMath.atan2;
import static pp.util.FloatMath.cos;
import static pp.util.FloatMath.sin;
import static pp.util.FloatMath.sqrt;
/**
* A class for representing angles by unit vectors where angles define
* polar coordinates.
*/
public class Angle implements Comparable<Angle> {
/**
* 0 degrees, i.e., along the x-axis
*/
public static final Angle ZERO = new Angle(1f, 0f);
/**
* 180 degrees, i.e., along the negative x-axis
*/
public static final Angle PI = new Angle(-1f, 0f);
/**
* Returns the minimum of the specified angles with respect to
* {@linkplain #compareTo(Angle)}.
*
* @param u first angle to compare
* @param v second angle to compare
*/
public static Angle min(Angle u, Angle v) {
return u.compareTo(v) <= 0 ? u : v;
}
/**
* The x-coordinate of the unit vector.
*/
public final float x;
/**
* The y-coordinate of the unit vector.
*/
public final float y;
/**
* Creates a new angle represented by the vector with the specified
* coordinates. Note that the vector must have length 1.
*/
private Angle(float x, float y) {
this.x = x;
this.y = y;
}
/**
* Returns the polar coordinates angle of the specified vector.
*
* @param x the vectors x value
* @param y the vectors y value
*/
public static Angle fromVector(float x, float y) {
final float len = sqrt(x * x + y * y);
if (len < FLT_EPSILON)
throw new IllegalArgumentException("null vector");
return new Angle(x / len, y / len);
}
/**
* Returns the polar coordinates angle when looking from the first to the second
* specified position.
*
* @param from first position
* @param to second position
*/
public static Angle direction(Position from, Position to) {
return fromVector(to.getX() - from.getX(),
to.getY() - from.getY());
}
/**
* Returns an Angle object for the specified angle in radians.
*
* @param radians the specified radian value
*/
public static Angle fromRadians(float radians) {
return new Angle(cos(radians), sin(radians));
}
/**
* Returns an Angle object for the specified angle in degrees.
*
* @param degrees the specified degrees value
*/
public static Angle fromDegrees(float degrees) {
return fromRadians(degrees * DEG_TO_RAD);
}
/**
* Returns the value of this angle in radians in the range (-pi,pi].
*/
public float radians() {
return atan2(y, x);
}
/**
* Returns the value of this angle in degrees in the range (-180,180].
*/
public float degrees() {
return radians() * RAD_TO_DEG;
}
/**
* Returns the x-coordinate of the unit vector, that is the cosine of the angle.
*/
public float getX() {
return x;
}
/**
* Returns the y-coordinate of the unit vector, that is the sinus of the angle.
*/
public float getY() {
return y;
}
/**
* Returns the angle obtained by adding the specified angle to this angle.
*
* @param o the other angle
*/
public Angle plus(Angle o) {
return new Angle(x * o.x - y * o.y,
x * o.y + y * o.x);
}
/**
* Returns the angle obtained by subtracting the specified angle from this angle.
*
* @param o the other angle
*/
public Angle minus(Angle o) {
return new Angle(y * o.y + x * o.x,
y * o.x - x * o.y);
}
/**
* Returns the bisector angle between this angle as left angle and the
* specified right angle, that is, the angle halfway from the right to this
* angle when turning from right to left.
*
* @param right right angle
* @return the bisector angle between this as left and the specified right angle
*/
public Angle bisector(Angle right) {
// compute vector of this.minus(right)
final float dx = y * right.y + x * right.x;
final float dy = y * right.x - x * right.y;
if (abs(dy) < FLT_EPSILON) {
// the difference is either 0° or 180°
if (dx > 0f)
return this;
else
return new Angle(-right.y, right.x);
}
final float mid = 0.5f * atan2(dy, dx);
final float sum = right.radians() + mid;
if (mid > 0f)
return new Angle(cos(sum), sin(sum));
else
return new Angle(-cos(sum), -sin(sum));
}
/**
* Returns true if turning left from the specified angle towards this angle is
* shorter than turning right towards this angle.
*
* @param o another angle
*/
public boolean leftOf(Angle o) {
return y * o.x - x * o.y > 0f;
}
/**
* Returns true if turning right from the specified angle towards this angle is
* shorter than turning left towards this angle.
*
* @param o another angle
*/
public boolean rightOf(Angle o) {
return y * o.x - x * o.y < 0f;
}
/**
* Compares this angle with the specified one and returns -1, 0, or 1 if
* the value of this angle is less than, equal to, or greater than the value
* of the specified angle, respectively, where angle values are in the
* range [0,2*pi) and 0 means along the x-axis.
*
* @param o the other angle
*/
@Override
public int compareTo(Angle o) {
if (y == 0f) {
if (o.y < 0f)
return -1;
if (o.y > 0f)
return x > 0f ? -1 : 1;
if (x > 0f)
return o.x > 0f ? 0 : 1;
return o.x > 0f ? -1 : 0;
}
if (y > 0f) {
if (o.y < 0f)
return -1;
if (o.y == 0f)
return o.x > 0f ? 1 : -1;
}
else if (o.y >= 0f)
return 1;
final float det = x * o.y - y * o.x;
if (det == 0f)
return 0;
return det > 0f ? -1 : 1;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof Angle angle)
return compareTo(angle) == 0;
return false;
}
@Override
public int hashCode() {
return Objects.hash(x, y);
}
/**
* Returns a string representation of this angle in degrees in the range [0,2*pi).
*/
@Override
public String toString() {
if (degrees() < 0f)
return (degrees() + 360f) + "°";
return degrees() + "°";
}
}

View File

@@ -1,460 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
/**
* Provides mathematical functions using float precision.
*/
public class FloatMath {
private FloatMath() { /* don't instantiate */ }
public static final double DBL_EPSILON = 2.220446049250313E-16d;
/**
* A "close to zero" float epsilon value for use
*/
public static final float FLT_EPSILON = 1.1920928955078125E-7f;
/**
* A "close to zero" float epsilon value for use
*/
public static final float ZERO_TOLERANCE = 0.0001f;
/**
* The value 1/3, as a float.
*/
public static final float ONE_THIRD = 1f / 3f;
/**
* The value PI as a float. (180 degrees)
*/
public static final float PI = (float) Math.PI;
/**
* The value 2PI as a float. (360 degrees)
*/
public static final float TWO_PI = 2.0f * PI;
/**
* The value PI/2 as a float. (90 degrees)
*/
public static final float HALF_PI = 0.5f * PI;
/**
* The value PI/4 as a float. (45 degrees)
*/
public static final float QUARTER_PI = 0.25f * PI;
/**
* The value 1/PI as a float.
*/
public static final float INV_PI = 1.0f / PI;
/**
* The value 1/(2PI) as a float.
*/
public static final float INV_TWO_PI = 1.0f / TWO_PI;
/**
* A value to multiply a degree value by, to convert it to radians.
*/
public static final float DEG_TO_RAD = PI / 180.0f;
/**
* A value to multiply a radian value by, to convert it to degrees.
*/
public static final float RAD_TO_DEG = 180.0f / PI;
/**
* Linear interpolation from startValue to endValue by the given percent.
* Basically: ((1 - percent) * startValue) + (percent * endValue)
*
* @param scale scale value to use. if 1, use endValue, if 0, use startValue.
* @param startValue Beginning value. 0% of f
* @param endValue ending value. 100% of f
* @return The interpolated value between startValue and endValue.
*/
public static float interpolateLinear(float scale, float startValue, float endValue) {
if (startValue == endValue) {
return startValue;
}
if (scale <= 0f) {
return startValue;
}
if (scale >= 1f) {
return endValue;
}
return ((1f - scale) * startValue) + (scale * endValue);
}
/**
* Linear extrapolation from startValue to endValue by the given scale.
* if scale is between 0 and 1 this method returns the same result as interpolateLinear
* if the scale is over 1 the value is linearly extrapolated.
* Note that the end value is the value for a scale of 1.
*
* @param scale the scale for extrapolation
* @param startValue the starting value (scale = 0)
* @param endValue the end value (scale = 1)
* @return an extrapolation for the given parameters
*/
public static float extrapolateLinear(float scale, float startValue, float endValue) {
return ((1f - scale) * startValue) + (scale * endValue);
}
/**
* Returns the arc cosine of a value.<br>
* Special cases:
* <ul><li>If fValue is smaller than -1, then the result is PI.
* <li>If the argument is greater than 1, then the result is 0.</ul>
*
* @param fValue The value to arc cosine.
* @return The angle, in radians.
* @see Math#acos(double)
*/
public static float acos(float fValue) {
if (-1.0f < fValue) {
if (fValue < 1.0f) {
return (float) Math.acos(fValue);
}
return 0.0f;
}
return PI;
}
/**
* Returns the arc sine of a value.<br>
* Special cases:
* <ul><li>If fValue is smaller than -1, then the result is -HALF_PI.
* <li>If the argument is greater than 1, then the result is HALF_PI.</ul>
*
* @param fValue The value to arc sine.
* @return the angle in radians.
* @see Math#asin(double)
*/
public static float asin(float fValue) {
if (-1.0f < fValue) {
if (fValue < 1.0f) {
return (float) Math.asin(fValue);
}
return HALF_PI;
}
return -HALF_PI;
}
/**
* Returns the arc tangent of an angle given in radians.<br>
*
* @param fValue The angle, in radians.
* @return fValue's atan
* @see Math#atan(double)
*/
public static float atan(float fValue) {
return (float) Math.atan(fValue);
}
/**
* A direct call to Math.atan2.
*
* @param fY ordinate
* @param fX abscissa
* @return Math.atan2(fY, fX)
* @see Math#atan2(double, double)
*/
public static float atan2(float fY, float fX) {
return (float) Math.atan2(fY, fX);
}
/**
* A direct call to Math.sinh.
*
* @param x The value for which to compute the hyperbolic sine
* @return Math.sinh(x)
* @see Math#sinh(double)
*/
public static float sinh(float x) {
return (float) Math.sinh(x);
}
/**
* A direct call to Math.cosh.
*
* @param x The value for which to compute the hyperbolic cosine
* @return Math.cosh(x)
* @see Math#cosh(double)
*/
public static float cosh(float x) {
return (float) Math.cosh(x);
}
/**
* A direct call to Math.tanh.
*
* @param x The value for which to compute the hyperbolic tangent
* @return Math.tanh(x)
* @see Math#tanh(double)
*/
public static float tanh(float x) {
return (float) Math.tanh(x);
}
/**
* Returns the hyperbolic cotangent of a value.
* @param x The value for which to compute the hyperbolic cotangent.
* @return The hyperbolic cotangent of x.
* @see Math#tanh(double)
*/
public static float coth(float x) {
return (float) (1d / Math.tanh(x));
}
public static float arsinh(float x) {
return log(x + sqrt(x * x + 1f));
}
public static float arcosh(float x) {
return log(x + sqrt(x * x - 1f));
}
public static float artanh(float x) {
return 0.5f * log((1f + x) / (1f - x));
}
public static float arcoth(float x) {
return 0.5f * log((x + 1f) / (x - 1f));
}
/**
* Rounds a fValue up. A call to Math.ceil
*
* @param fValue The value.
* @return The fValue rounded up
* @see Math#ceil(double)
*/
public static float ceil(float fValue) {
return (float) Math.ceil(fValue);
}
/**
* Returns cosine of an angle. Direct call to Math
*
* @param v The angle to cosine.
* @return the cosine of the angle.
* @see Math#cos(double)
*/
public static float cos(float v) {
return (float) Math.cos(v);
}
/**
* Returns the sine of an angle. Direct call to Math
*
* @param v The angle to sine.
* @return the sine of the angle.
* @see Math#sin(double)
*/
public static float sin(float v) {
return (float) Math.sin(v);
}
/**
* Returns E^fValue
*
* @param fValue Value to raise to a power.
* @return The value E^fValue
* @see Math#exp(double)
*/
public static float exp(float fValue) {
return (float) Math.exp(fValue);
}
/**
* Returns e^fValue - 1.
* This is equivalent to calling Math.expm1.
*
* @param fValue The exponent to raise e to, minus 1.
* @return The result of e^fValue - 1.
* @see Math#expm1(double)
*/
public static float expm1(float fValue) {
return (float) Math.expm1(fValue);
}
/**
* Returns Absolute value of a float.
*
* @param fValue The value to abs.
* @return The abs of the value.
* @see Math#abs(float)
*/
public static float abs(float fValue) {
if (fValue < 0) {
return -fValue;
}
return fValue;
}
/**
* Returns a number rounded down.
*
* @param fValue The value to round
* @return The given number rounded down
* @see Math#floor(double)
*/
public static float floor(float fValue) {
return (float) Math.floor(fValue);
}
/**
* Returns 1/sqrt(fValue)
*
* @param fValue The value to process.
* @return 1/sqrt(fValue)
* @see Math#sqrt(double)
*/
public static float invSqrt(float fValue) {
return (float) (1.0f / Math.sqrt(fValue));
}
/**
* Quickly estimate 1/sqrt(fValue).
*
* @param x the input value (&ge;0)
* @return an approximate value for 1/sqrt(x)
*/
public static float fastInvSqrt(float x) {
float halfX = 0.5f * x;
int i = Float.floatToIntBits(x); // get bits for floating value
i = 0x5f375a86 - (i >> 1); // gives initial guess y0
x = Float.intBitsToFloat(i); // convert bits back to float
x = x * (1.5f - halfX * x * x); // Newton step, repeating increases accuracy
return x;
}
/**
* Returns the log base E of a value.
*
* @param fValue The value to log.
* @return The log of fValue base E
* @see Math#log(double)
*/
public static float log(float fValue) {
return (float) Math.log(fValue);
}
/**
* Returns a number raised to an exponent power. fBase^fExponent
*
* @param fBase The base value (IE 2)
* @param fExponent The exponent value (IE 3)
* @return base raised to exponent (IE 8)
* @see Math#pow(double, double)
*/
public static float pow(float fBase, float fExponent) {
return (float) Math.pow(fBase, fExponent);
}
/**
* Returns the value squared. fValue ^ 2
*
* @param fValue The value to square.
* @return The square of the given value.
*/
public static float sqr(float fValue) {
return fValue * fValue;
}
/**
* Returns the square root of a given value.
*
* @param fValue The value to sqrt.
* @return The square root of the given value.
* @see Math#sqrt(double)
*/
public static float sqrt(float fValue) {
return (float) Math.sqrt(fValue);
}
/**
* Returns the tangent of the specified angle.
*
* @param fValue The value to tangent, in radians.
* @return The tangent of fValue.
* @see Math#tan(double)
*/
public static float tan(float fValue) {
return (float) Math.tan(fValue);
}
/**
* Returns 1 if the number is positive, -1 if the number is negative, and 0 otherwise
*
* @param iValue The integer to examine.
* @return The integer's sign.
*/
public static int sign(int iValue) {
return Integer.compare(iValue, 0);
}
/**
* Returns 1 if the number is positive, -1 if the number is negative, and 0 otherwise
*
* @param fValue The float to examine.
* @return The float's sign.
*/
public static float sign(float fValue) {
return Math.signum(fValue);
}
/**
* Take a float input and clamp it between min and max.
*
* @param input the value to be clamped
* @param min the minimum output value
* @param max the maximum output value
* @return clamped input
*/
public static float clamp(float input, float min, float max) {
return Math.max(min, Math.min(input, max));
}
/**
* Clamps the given float to be between 0 and 1.
*
* @param input the value to be clamped
* @return input clamped between 0 and 1.
*/
public static float saturate(float input) {
return clamp(input, 0f, 1f);
}
/**
* Determine if two floats are approximately equal.
* This takes into account the magnitude of the floats, since
* large numbers will have larger differences be close to each other.
* <p>
* Should return true for a=100000, b=100001, but false for a=10000, b=10001.
*
* @param a The first float to compare
* @param b The second float to compare
* @return True if a and b are approximately equal, false otherwise.
*/
public static boolean approximateEquals(float a, float b) {
if (a == b) {
return true;
}
else {
return (abs(a - b) / Math.max(abs(a), abs(b))) <= 0.00001f;
}
}
/**
* Normalizes the specified angle to lie in the interval (-pi,pi] and returns the normalized value in radians.
*
* @param angle the specified angle in radians
*/
public static float normalizeAngle(float angle) {
final float res = angle % TWO_PI;
if (res <= -FloatMath.PI) return res + TWO_PI;
else if (res > FloatMath.PI) return res - TWO_PI;
return res;
}
}

View File

@@ -1,47 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
/**
* A trivial implementation of points in the plane with float coordinates.
*
* @param x x-coordinate
* @param y y-coordinate
*/
public record FloatPoint(float x, float y) implements Position {
public static final FloatPoint ZERO = new FloatPoint(0f, 0f);
/**
* Create a new FloatPoint object for the given position.
*
* @param p a position
*/
public FloatPoint(Position p) {
this(p.getX(), p.getY());
}
/**
* Returns the x-coordinate.
*/
@Override
public float getX() {
return x;
}
/**
* Returns the y-coordinate.
*/
@Override
public float getY() {
return y;
}
public static Position p(float x, float y) {
return new FloatPoint(x, y);
}
}

View File

@@ -1,77 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
import static pp.util.FloatMath.ZERO_TOLERANCE;
import static pp.util.FloatMath.abs;
/**
* Represents an interval. The start value must not be greater than the end value.
*
* @param from the start value of the interval
* @param to the end value of the interval
*/
public record Interval(float from, float to) {
/**
* Creates a new interval between two specified values.
*
* @param from the specified start value
* @param to the specified end value
*/
public Interval {
if (from > to)
throw new IllegalArgumentException(from + " > " + to);
}
/**
* Checks whether this interval has length 0, i.e., from and to are equal.
*/
public boolean isEmpty() {
return to == from;
}
/**
* Checks whether the specified value is contained in this interval. Note that an empty interval may
* contain the value if the value is the start and the end value of the interval.
*
* @param value the specified value to check
*/
public boolean contains(float value) {
return from - value <= ZERO_TOLERANCE && value - to <= ZERO_TOLERANCE;
}
/**
* Checks whether the specified interval is contained as a sub-interval.
*
* @param other the potential sub-interval
*/
public boolean contains(Interval other) {
return from - other.from < ZERO_TOLERANCE && other.to - to < ZERO_TOLERANCE;
}
/**
* Returns a string representation of this interval.
*/
@Override
public String toString() {
return "[" + from + "; " + to + "]";
}
/**
* Checks whether the specified interval is almost equal to this
* interval up to the specified epsilon value.
*
* @param other the other interval to check
* @param eps the allowed epsilon value
*/
public boolean matches(Interval other, float eps) {
return abs(from - other.from) < eps &&
abs(to - other.to) < eps;
}
}

View File

@@ -1,84 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
import static pp.util.FloatMath.sqrt;
/**
* Interface for all objects that provide a position in the plane.
*/
public interface Position extends Comparable<Position> {
/**
* Returns the x-coordinate of the position
*
* @return x-coordinate as float
*/
float getX();
/**
* Returns the y-coordinate of the position
*
* @return y-coordinate as float
*/
float getY();
/**
* Returns the distance of this position from the specified position.
*
* @param x x-coordinate of the position
* @param y y-coordinate of the position
* @return distance
*/
default float distanceTo(float x, float y) {
return sqrt(distanceSquaredTo(x, y));
}
/**
* Returns the distance of this position from the specified position.
* This is just a convenience method for {@linkplain #distanceTo(float, float)}.
*
* @param other the other position
* @return distance
*/
default float distanceTo(Position other) {
return distanceTo(other.getX(), other.getY());
}
/**
* Returns the squared distance of this position from the specified position.
*
* @param x x-coordinate of the position
* @param y y-coordinate of the position
* @return squared distance
*/
default float distanceSquaredTo(float x, float y) {
final float dx = getX() - x;
final float dy = getY() - y;
return dx * dx + dy * dy;
}
/**
* Returns the squared distance of this position from the specified position.
*
* @param p the other position
* @return squared distance
*/
default float distanceSquaredTo(Position p) {
return distanceSquaredTo(p.getX(), p.getY());
}
/**
* Compares positions in the plane from top to bottom
* (y coordinates grow downwards) and then from left ro right.
*/
@Override
default int compareTo(Position other) {
final int c = Float.compare(getY(), other.getY());
return c != 0 ? c : Float.compare(getX(), other.getX());
}
}

View File

@@ -1,30 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
import java.util.prefs.Preferences;
/**
* A class with convenience methods for preferences.
*/
public class PreferencesUtils {
private PreferencesUtils() {
// don't instantiate
}
/**
* Returns a preferences node for the specified class object. The path of the
* preference node corresponds to the fully qualified name of the class.
*
* @param clazz a class object
* @return a preference node for the specified class
*/
public static Preferences getPreferences(Class<?> clazz) {
return Preferences.userNodeForPackage(clazz).node(clazz.getSimpleName());
}
}

View File

@@ -1,90 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Random;
/**
* An iterator that creates a random permutation of positions (x, y) where x and y are integer values
* in the range {0, ..., width-1} x {0, ..., height-1}. All permutations are uniformly distributed
* using the FisherYates shuffle (also known as Knuth shuffle).
*
* @param <T> the type of elements returned by this iterator
*/
public class RandomPositionIterator<T> implements Iterator<T> {
private final Random random = new Random();
private final int height;
private final Map<Integer, T> movedMap = new HashMap<>();
private int remaining;
private final Creator<T> creator;
/**
* Functional interface to create instances of type T.
*
* @param <T> the type of elements created by this creator
*/
public interface Creator<T> {
T create(int x, int y);
}
/**
* Creates a RandomPositionIterator for Position instances with float coordinates.
*
* @param width the width of the rectangle
* @param height the height of the rectangle
* @return a RandomPositionIterator for Position instances
*/
public static RandomPositionIterator<Position> floatPoints(int width, int height) {
return new RandomPositionIterator<>(FloatPoint::new, width, height);
}
/**
* Creates a new permutation iterator generating a random permutation of positions (x, y)
* where x and y are integer values in the range {0, ..., width-1} x {0, ..., height-1}.
*
* @param creator the creator to create instances of type T
* @param width the width of the rectangle
* @param height the height of the rectangle
*/
public RandomPositionIterator(Creator<T> creator, int width, int height) {
this.height = height;
this.remaining = width * height;
this.creator = creator;
}
@Override
public boolean hasNext() {
return remaining > 0;
}
@Override
public T next() {
if (hasNext()) {
final int idx = random.nextInt(remaining--); // note that remaining is decremented
final T result = getWhere(idx);
if (idx < remaining)
movedMap.put(idx, getWhere(remaining));
movedMap.remove(remaining);
return result;
}
throw new NoSuchElementException();
}
private T getWhere(int idx) {
final T movedWhere = movedMap.get(idx);
if (movedWhere != null)
return movedWhere;
final int x = idx / height;
final int y = idx % height;
return creator.create(x, y);
}
}

View File

@@ -1,16 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
/**
* A directed straight line segment between two positions in the plane.
*
* @param from the start position of the segment
* @param to the end position of the segment
*/
public record Segment(Position from, Position to) implements SegmentLike {}

View File

@@ -1,396 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
import static java.lang.Float.max;
import static java.lang.Float.min;
import static pp.util.FloatMath.FLT_EPSILON;
import static pp.util.FloatMath.ZERO_TOLERANCE;
import static pp.util.FloatMath.abs;
import static pp.util.FloatMath.atan2;
import static pp.util.FloatMath.cos;
import static pp.util.FloatMath.sin;
import static pp.util.FloatMath.sqr;
import static pp.util.FloatMath.sqrt;
/**
* Interface of geometrical objects like segments, i.e., having a start and an end position.
*/
public interface SegmentLike {
/**
* Returns the start position of the segment.
*/
Position from();
/**
* Returns the end position of the segment.
*/
Position to();
/**
* Returns the length, i.e., the distance between the start and the end point of this segment.
*
* @return length of the line segment
*/
default float length() {
return sqrt(lengthSquared());
}
/**
* Returns the length squared where the length is the distance between the start and the
* end point of this segment.
*
* @return length squared of the line segment
*/
default float lengthSquared() {
return lengthSquared(from(), to());
}
/**
* Returns the squared length of the vector between the specified points.
*/
static float lengthSquared(Position from, Position to) {
final float dx = to.getX() - from.getX();
final float dy = to.getY() - from.getY();
return dx * dx + dy * dy;
}
/**
* Returns the length of the vector between the specified points.
*/
static float length(Position from, Position to) {
return sqrt(lengthSquared(from, to));
}
/**
* Returns the angle of this line segment with the x-axis.
*
* @return angle with the x-axis
*/
default float angle() {
final float dx = to().getX() - from().getX();
final float dy = to().getY() - from().getY();
return atan2(dy, dx);
}
/**
* Returns the distance of the specified point from this segment.
* The distance is the length of the shortest connection between the specified
* point and any point of the line segment.
*
* @param x x-coordinate of the point
* @param y y-coordinate of the point
* @return the distance
*/
default float distanceTo(float x, float y) {
return distance(from().getX(), from().getY(), to().getX(), to().getY(), x, y);
}
/**
* Returns the distance of the point from the segment between the specified points.
* The distance is the length of the shortest connection between the specified
* point and any point of the line segment.
*
* @param from the segment start point
* @param to the segment end point
* @param p the point
* @return the distance
*/
static float distance(Position from, Position to, Position p) {
return distance(from.getX(), from.getY(), to.getX(), to.getY(), p.getX(), p.getY());
}
/**
* Returns the distance of the point (x,y) from the segment from (x1,y1) to (x2,y2)
* The distance is the length of the shortest connection between the specified
* point and any point of the line segment.
*
* @param x1 x-coordinate of the segment start point
* @param y1 y-coordinate of the segment start point
* @param x2 x-coordinate of the segment end point
* @param y2 y-coordinate of the segment end point
* @param x x-coordinate of the point
* @param y y-coordinate of the point
* @return the distance
*/
static float distance(float x1, float y1, float x2, float y2, float x, float y) {
final float dx = x2 - x1;
final float dy = y2 - y1;
final float dx1 = x - x1;
final float dy1 = y - y1;
if (dx * dx1 + dy * dy1 <= 0f)
return sqrt(dx1 * dx1 + dy1 * dy1);
final float dx2 = x - x2;
final float dy2 = y - y2;
if (dx * dx2 + dy * dy2 >= 0f)
return sqrt(dx2 * dx2 + dy2 * dy2);
final float len = sqrt(dx * dx + dy * dy);
return FloatMath.abs(dx1 * dy - dy1 * dx) / len;
}
/**
* Returns the distance of the specified position from this segment.
* This is just a convenience method for {@linkplain #distanceTo(float, float)}.
*
* @param pos a position
* @return the distance
*/
default float distanceTo(Position pos) {
return distanceTo(pos.getX(), pos.getY());
}
/**
* Returns the point of this segment with the specified quotient, i.e., q*from()+(1-q)*to().
*
* @param q the quotient
*/
default Position pointAt(float q) {
if (q == 0f) return from();
if (q == 1f) return to();
return new FloatPoint((1f - q) * from().getX() + q * to().getX(),
(1f - q) * from().getY() + q * to().getY());
}
/**
* Shoots a ray from the specified position in the direction of the specified angle and returns the distance
* of the specified position from the intersection point of the ray with the straight line determined by the
* end points of this segment. Returns {@linkplain Float#NaN} if there is no intersection.
*
* @param pos the specified position
* @param angle the specified angle
*/
default float dist(Position pos, float angle) {
return quotientDist(pos, quotient(pos, angle));
}
/**
* Shoots a ray from the specified position in the direction of the specified angle and returns the distance
* of the specified position from the intersection point of the ray with the straight line determined by the
* end points of this segment. Returns {@linkplain Float#NaN} if there is no intersection.
*
* @param pos the specified position
* @param angle the specified angle
*/
default float dist(Position pos, Angle angle) {
return quotientDist(pos, quotient(pos, angle.x, angle.y));
}
/**
* Shoots a ray from the specified position in the direction of the point of this segment with the specified
* quotient, i.e., the point at q*from()+(1-q)*to(), and returns the distance
* of the specified position from the intersection point of the ray with the straight line determined by the
* end points of this segment. Returns {@linkplain Float#NaN} if there is no intersection.
*
* @param pos the specified position
* @param q the specified quotient
*/
default float quotientDist(Position pos, float q) {
final float dx = (1f - q) * from().getX() + q * to().getX() - pos.getX();
final float dy = (1f - q) * from().getY() + q * to().getY() - pos.getY();
return sqrt(dx * dx + dy * dy);
}
/**
* Shoots a ray from the specified position in the direction of the specified angle and returns the
* quotient q such that the intersection point of the ray with the straight line determined by the
* end points of this segment is at q*from()+(1-q)*to().
*
* @param pos the specified position
* @param angle the specified angle
*/
default float quotient(Position pos, float angle) {
final float ux = cos(angle);
final float uy = sin(angle);
return quotient(pos, ux, uy);
}
/**
* Shoots a ray from the specified position in the direction of the specified vector and returns the
* quotient q such that the intersection point of the ray with the straight line determined by the
* end points of this segment is at q*from()+(1-q)*to().
*
* @param pos the specified position
* @param ux the vectors x value
* @param uy the vectors y value
*/
private float quotient(Position pos, float ux, float uy) {
final float nom = nominator(pos, ux, uy);
final float det = determinant(ux, uy);
// the following is for dealing with floating point imprecision
if (abs(det) > FLT_EPSILON)
return nom / det;
if (abs(nom) > FLT_EPSILON)
return Float.NaN;
final float q = project(pos);
if (q > -FLT_EPSILON && q - 1f < FLT_EPSILON)
// pos lies (almost) within the segment
return q;
final float distFrom = isCandidate(pos, ux, uy, from());
final float distTo = isCandidate(pos, ux, uy, to());
if (distFrom >= 0f) {
if (distTo >= 0f)
return distFrom < distTo ? 0f : 1f;
else
return 0f;
}
if (distTo >= 0f)
return 1f;
return Float.NaN;
}
/**
* Returns the determinant of a specified vector.
*
* @param ux the vectors x value
* @param uy the vectors y value
*/
private float determinant(float ux, float uy) {
return diffX() * uy - diffY() * ux;
}
/**
* Returns the nominator of the specified vector starting at a specified position.
*
* @param pos the specified position
* @param ux the vectors x value
* @param uy the vectors y value
*/
private float nominator(Position pos, float ux, float uy) {
final float dx = pos.getX() - from().getX();
final float dy = pos.getY() - from().getY();
return dx * uy - dy * ux;
}
/**
* Checks whether the (ux,uy) ray starting at pos hits (or almost hits) target.
*
* @param pos the specified start position
* @param ux the rays x value
* @param uy the rays y value
* @param target the specified target position
*/
private float isCandidate(Position pos, float ux, float uy, Position target) {
final float lambda = lambda(pos, target, ux, uy);
if (lambda < -FLT_EPSILON) return -1f;
final float dx = target.getX() - pos.getX() - lambda * ux;
final float dy = target.getY() - pos.getY() - lambda * uy;
return dx * dx + dy * dy;
}
private float lambda(Position p1, Position p2, float ux, float uy) {
return ux * (p2.getX() - p1.getX()) + uy * (p2.getY() - p1.getY());
}
/**
* Returns the quotient q such that the specified point projected onto this
* segment is at q*from()+(1-q)*to().
*
* @param pos the specified points position
*/
default float project(Position pos) {
return ((pos.getX() - from().getX()) * diffX() + (pos.getY() - from().getY()) * diffY()) / lengthSquared();
}
/**
* Returns the interval of quotients between leftAngle and rightAngle
* looking from the specified position. The starting point of the
* segment must be left of its end point when looking from the
* specified position.
*
* @param pos the specified position to look from
* @param leftAngle the specified left angle
* @param rightAngle the specified right angle
*/
default Interval interval(Position pos, Angle leftAngle, Angle rightAngle) {
final float nomLeft = nominator(pos, leftAngle.x, leftAngle.y);
final float detLeft = determinant(leftAngle.x, leftAngle.y);
final float nomRight = nominator(pos, rightAngle.x, rightAngle.y);
final float detRight = determinant(rightAngle.x, rightAngle.y);
if (abs(detLeft) <= FLT_EPSILON || abs(detRight) <= FLT_EPSILON)
return new Interval(0f, 0f);
final float q1 = nomLeft / detLeft;
final float q2 = nomRight / detRight;
if (q1 > q2)
return new Interval(0f, 0f);
final float lower = q1 < ZERO_TOLERANCE ? 0f : min(1f, q1);
final float upper = q2 > 1f - ZERO_TOLERANCE ? 1f : max(0f, q2);
return new Interval(lower, upper);
}
/**
* Returns the x-coordinate of the vector from the start to the end point.
*/
default float diffX() {
return to().getX() - from().getX();
}
/**
* Returns the y-coordinate of the vector from the start to the end point.
*/
default float diffY() {
return to().getY() - from().getY();
}
/**
* Computes the determinant of the matrix whose first column vector is this segment and the
* second column vector is the specified segment.
*
* @param other the specified segment
*/
default float determinantWith(SegmentLike other) {
return diffX() * other.diffY() - diffY() * other.diffX();
}
/**
* Computes the square of the minimal distance between this and the specified segment.
*
* @param other other segment
* @return squared distance
*/
default float minDistanceSquared(SegmentLike other) {
final float rx = other.from().getX() - from().getX();
final float ry = other.from().getY() - from().getY();
final float ux = diffX();
final float uy = diffY();
final float vx = other.diffX();
final float vy = other.diffY();
final float ru = rx * ux + ry * uy;
final float rv = rx * vx + ry * vy;
final float uu = ux * ux + uy * uy;
final float uv = ux * vx + uy * vy;
final float vv = vx * vx + vy * vy;
if (uu < ZERO_TOLERANCE) { // this segment is in fact a single point
if (vv < ZERO_TOLERANCE) // other is a point, too
return rx * rx + ry * ry;
else
return sqr(other.distanceTo(from()));
}
if (vv < ZERO_TOLERANCE) // other is in fact a point
return sqr(distanceTo(other.from()));
final float det = uu * vv - uv * uv;
final float s;
final float t;
if (det < ZERO_TOLERANCE * uu * vv) {
s = min(max(ru / uu, 0f), 1f);
t = 0f;
}
else {
s = min(max((ru * vv - rv * uv) / det, 0f), 1f);
t = min(max((ru * uv - rv * uu) / det, 0f), 1f);
}
final float mu1 = min(max((t * uv + ru) / uu, 0f), 1f);
final float mu2 = min(max((s * uv - rv) / vv, 0f), 1f);
return pointAt(mu1).distanceSquaredTo(other.pointAt(mu2));
}
}

View File

@@ -1,90 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* A class with auxiliary functions.
*/
public class Util {
private Util() { /* do not instantiate */ }
/**
* Calculates and returns the area of a polygon defined by a list of points, using the shoelace formula.
* The result is positive if the sequence of vertices is in clockwise order, and negative
* otherwise.
*
* @param points A list of positions that define the vertices of the polygon in planar coordinates.
* @return The calculated area of the polygon.
*/
public static float getArea(List<? extends Position> points) {
float sum = 0;
Position prev = getLast(points);
for (var next : points) {
sum += prev.getX() * next.getY() - next.getX() * prev.getY();
prev = next;
}
return 0.5f * sum;
}
/**
* Returns the last element of the given list.
*
* @param list the list from which to retrieve the last element
* @param <T> the type of elements in the list
* @return the last element of the list
* @throws IndexOutOfBoundsException if the list is empty
*/
public static <T> T getLast(List<T> list) {
return list.get(list.size() - 1);
}
/**
* Reverses the order of elements in the given list.
*
* @param list the list to be reversed
* @param <T> the type of elements in the list
* @return a new list with elements in reversed order
*/
public static <T> List<T> reverse(List<T> list) {
final List<T> reversed = new ArrayList<>(list);
Collections.reverse(reversed);
return reversed;
}
/**
* Creates a copy of the given list.
*
* @param list the list to be copied, may be null
* @param <T> the type of elements in the list
* @return a new list containing the elements of the original list, or null if the original list is null
*/
public static <T> List<T> copy(List<T> list) {
return list == null ? null : new ArrayList<>(list);
}
/**
* Adds an element to a set and returns a new set containing the original elements and the new element.
*
* @param set the original set, must not be null
* @param element the element to be added to the set
* @param <T> the type of elements in the set
* @param <E> the type of the element being added, must extend T
* @return a new set containing the original elements and the new element
*/
public static <T, E extends T> Set<T> add(Set<T> set, E element) {
final Set<T> newSet = new HashSet<>(set);
newSet.add(element);
return newSet;
}
}

View File

@@ -1,286 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util.config;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.function.Function;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Abstract base class for representing configurations that can be read from properties files.
* Subclasses can define fields annotated with {@link Property} to specify the configuration keys
* and optionally {@link Separator} to specify custom separators for array values.
*/
public abstract class Config {
private static final String BLANK_SEQ = " *";
/**
* Annotation for specifying the property key for a field.
*/
@Retention(RUNTIME)
@Target(FIELD)
@Documented
protected @interface Property {
/**
* The key of the property.
*/
String value();
}
/**
* Annotation for specifying a custom separator for array values.
*/
@Retention(RUNTIME)
@Target(FIELD)
@Documented
protected @interface Separator {
/**
* The separator for array values.
*/
String value();
}
private static final Logger LOGGER = System.getLogger(Config.class.getName());
private static final Map<Class<?>, Function<String, ?>> CONVERTER_MAP = new HashMap<>();
static {
CONVERTER_MAP.put(String.class, x -> x);
CONVERTER_MAP.put(byte.class, Byte::parseByte);
CONVERTER_MAP.put(short.class, Short::parseShort);
CONVERTER_MAP.put(int.class, Integer::parseInt);
CONVERTER_MAP.put(long.class, Long::parseLong);
CONVERTER_MAP.put(boolean.class, Boolean::parseBoolean);
CONVERTER_MAP.put(float.class, Float::parseFloat);
CONVERTER_MAP.put(double.class, Double::parseDouble);
CONVERTER_MAP.put(Byte.class, Byte::parseByte);
CONVERTER_MAP.put(Short.class, Short::parseShort);
CONVERTER_MAP.put(Integer.class, Integer::parseInt);
CONVERTER_MAP.put(Long.class, Long::parseLong);
CONVERTER_MAP.put(Boolean.class, Boolean::parseBoolean);
CONVERTER_MAP.put(Float.class, Float::parseFloat);
CONVERTER_MAP.put(Double.class, Double::parseDouble);
}
/**
* Reads the specified properties file and sets the values of this config using {@link #readFrom(Properties)}.
*
* @param file the properties file to read
* @throws IOException if an I/O error occurs
* @see #readFrom(Properties)
*/
public void readFrom(File file) throws IOException {
try (Reader reader = new FileReader(file)) {
final Properties properties = new Properties();
properties.load(reader);
readFrom(properties);
}
}
/**
* Sets the values of fields annotated with {@link Property} using the specified properties.
* Array fields can be split into components using the default separator (",") or a custom separator
* specified with {@link Separator}.
*
* @param props the properties to read from
*/
public void readFrom(Properties props) {
for (Class<?> clazz = getClass(); Config.class.isAssignableFrom(clazz); clazz = clazz.getSuperclass()) {
for (Field field : clazz.getDeclaredFields()) {
final Property keyAnnot = field.getAnnotation(Property.class);
if (keyAnnot != null && props.containsKey(keyAnnot.value())) {
try {
final String text = props.getProperty(keyAnnot.value());
final Object value = createValue(text, field);
setField(field, value);
}
catch (IllegalAccessException ex) {
LOGGER.log(Level.ERROR, "Cannot access " + field, ex); //NON-NLS
}
}
}
}
}
/**
* Reads the specified properties file and sets the values of this config if the file exists,
* otherwise uses default values. This method is a convenience version of {@link #readFrom(File)}
* that checks the existence of the specified file and does nothing if the file does not exist.
*
* @param file the properties file to read, if it exists
*/
public void readFromIfExists(File file) {
if (!file.exists()) {
LOGGER.log(Level.INFO, "There is no config file {0}; using default configuration", //NON-NLS
file.getAbsolutePath());
return;
}
try {
readFrom(file);
LOGGER.log(Level.INFO, "Successfully read config from {0}", file.getAbsolutePath()); //NON-NLS
}
catch (IOException e) {
LOGGER.log(Level.WARNING, "Cannot read config file " + file.getAbsolutePath(), e); //NON-NLS
}
}
/**
* Converts a string value from the properties file into an object that can be assigned to the specified field.
* For array fields, the string value is first split into components.
*
* @param value the string value to convert
* @param field the field to set with the converted value
* @return an object of the appropriate type for the field
*/
private Object createValue(String value, Field field) {
if (!field.getType().isArray())
return convertToType(value, field.getType());
// the field is an array
final Separator sepAnn = field.getDeclaredAnnotation(Separator.class);
final String sep = sepAnn == null ? "," : sepAnn.value();
final String[] split = value.split(BLANK_SEQ + sep + BLANK_SEQ, -1);
final Object array = Array.newInstance(field.getType().componentType(), split.length);
for (int i = 0; i < split.length; i++)
Array.set(array, i, convertToType(split[i], field.getType().componentType()));
return array;
}
/**
* Converts a string value into an object of the specified type.
*
* @param value the string value to convert
* @param targetType the target type to convert to
* @return an object of the specified type
*/
protected Object convertToType(String value, Class<?> targetType) {
Function<String, ?> handler = CONVERTER_MAP.get(targetType);
if (handler != null)
return handler.apply(value);
throw new IllegalArgumentException("Cannot translate " + value + " to " + targetType);
}
/**
* Returns a string representation of the configuration object, including all properties and their values.
*
* @return a string representation of the configuration object
*/
@Override
public String toString() {
final List<String> propertyStrings = getPropertyStrings();
propertyStrings.sort(String.CASE_INSENSITIVE_ORDER);
return "[\n" + String.join(",\n", propertyStrings) + "\n]";
}
/**
* Retrieves all property strings of the configuration object.
*
* @return a list of property strings
*/
private List<String> getPropertyStrings() {
final List<String> propertyStrings = new ArrayList<>();
for (Class<?> clazz = getClass(); Config.class.isAssignableFrom(clazz); clazz = clazz.getSuperclass()) {
for (Field field : clazz.getDeclaredFields()) {
final String stringRepresentation = getStringRepresentation(field);
if (stringRepresentation != null)
propertyStrings.add(stringRepresentation);
}
}
return propertyStrings;
}
/**
* Retrieves the string representation of a field annotated with {@link Property}.
*
* @param field the field to retrieve the string representation for
* @return the string representation of the field, or null if the field is not annotated with {@link Property}
*/
private String getStringRepresentation(Field field) {
final Property keyAnnotation = field.getAnnotation(Property.class);
if (keyAnnotation != null) {
try {
final Object fieldValue = getField(field);
final String valueString = asString(fieldValue);
return keyAnnotation.value() + " -> " + field.getName() + " = " + valueString;
}
catch (IllegalAccessException e) {
LOGGER.log(Level.ERROR, "Cannot access " + field, e); //NON-NLS
}
}
return null;
}
/**
* Converts an object to its string representation. For arrays, string representations of their components are produced.
*
* @param value the object to convert
* @return the string representation of the object
*/
private String asString(Object value) {
if (value == null)
return "null"; //NON-NLS
if (!value.getClass().isArray())
return value.toString();
final int length = Array.getLength(value);
final List<String> components = new ArrayList<>(length);
for (int i = 0; i < length; i++) {
final Object component = Array.get(value, i);
components.add(asString(component));
}
return "{" + String.join(", ", components) + "}";
}
/**
* Sets the value of a field, making it accessible if necessary.
*
* @param field the field to set
* @param value the value to set
* @throws IllegalAccessException if the field cannot be accessed
*/
private void setField(Field field, Object value) throws IllegalAccessException {
boolean inaccessible = !field.canAccess(this);
if (inaccessible)
field.setAccessible(true);
field.set(this, value);
if (inaccessible)
field.setAccessible(false);
LOGGER.log(Level.TRACE, "Set {0} to {1}", field, value); //NON-NLS
}
/**
* Retrieves the value of a field, making it accessible if necessary.
*
* @param field the field to retrieve the value from
* @return the value of the field
* @throws IllegalAccessException if the field cannot be accessed
*/
private Object getField(Field field) throws IllegalAccessException {
boolean inaccessible = !field.canAccess(this);
if (inaccessible)
field.setAccessible(true);
final Object value = field.get(this);
if (inaccessible)
field.setAccessible(false);
return value;
}
}

View File

@@ -1,109 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
import org.junit.Test;
import static java.lang.Math.min;
import static org.junit.Assert.assertEquals;
import static pp.util.FloatMath.DEG_TO_RAD;
import static pp.util.FloatMath.ZERO_TOLERANCE;
import static pp.util.FloatMath.cos;
import static pp.util.FloatMath.sin;
public class AngleTest {
@Test
public void compareAngles() {
for (int i = 0; i < 360; i++) {
final Angle u = Angle.fromDegrees(i);
for (int j = 0; j < 360; j++) {
final Angle v = Angle.fromDegrees(j);
assertEquals("compare " + i + "° and " + j + "°", Integer.compare(i, j), (Object) u.compareTo(v));
}
}
}
@Test
public void addAngles() {
for (int i = 0; i < 360; i++) {
final Angle u = Angle.fromDegrees(i);
for (int j = 0; j < 360; j++) {
final Angle v = Angle.fromDegrees(j);
final Angle sum = u.plus(v);
assertEquals(i + "° + " + j + "°, x coordinate", cos((i + j) * DEG_TO_RAD), sum.x, ZERO_TOLERANCE);
assertEquals(i + "° + " + j + "°, y coordinate", sin((i + j) * DEG_TO_RAD), sum.y, ZERO_TOLERANCE);
}
}
}
@Test
public void subtractAngles() {
for (int i = 0; i < 360; i++) {
final Angle u = Angle.fromDegrees(i);
for (int j = 0; j < 360; j++) {
final Angle v = Angle.fromDegrees(j);
final Angle diff = u.minus(v);
assertEquals(i + "° - " + j + "°, x coordinate", cos((i - j) * DEG_TO_RAD), diff.x, ZERO_TOLERANCE);
assertEquals(i + "° - " + j + "°, y coordinate", sin((i - j) * DEG_TO_RAD), diff.y, ZERO_TOLERANCE);
}
}
}
@Test
public void minAngle() {
for (int i = 0; i < 360; i++) {
final Angle u = Angle.fromDegrees(i);
for (int j = 0; j < 360; j++) {
final Angle v = Angle.fromDegrees(j);
final Angle diff = Angle.min(u, v);
assertEquals(i + "° - " + j + "°, x coordinate", cos(min(i, j) * DEG_TO_RAD), diff.x, ZERO_TOLERANCE);
assertEquals(i + "° - " + j + "°, y coordinate", sin(min(i, j) * DEG_TO_RAD), diff.y, ZERO_TOLERANCE);
}
}
}
@Test
public void bisector() {
for (int right = 0; right < 360; right++) {
final Angle rightAngle = Angle.fromDegrees(right);
for (int add = 0; add < 360; add++) {
final int left = right + add;
final Angle bisector = Angle.fromDegrees(left).bisector(rightAngle);
final float exp = (right + 0.5f * add) * DEG_TO_RAD;
assertEquals("left=" + left + "° / right=" + right + "°, x coordinate", cos(exp), bisector.x, ZERO_TOLERANCE);
assertEquals("left=" + left + "° / right=" + right + "°, y coordinate", sin(exp), bisector.y, ZERO_TOLERANCE);
}
}
}
@Test
public void leftOf() {
for (int right = 0; right < 360; right++) {
final Angle rightAngle = Angle.fromDegrees(right);
for (int add = 1; add < 360; add++)
if (add != 180) {
final int left = right + add;
final Angle leftAngle = Angle.fromDegrees(left);
assertEquals(left + "° left of " + right + "°", add < 180, leftAngle.leftOf(rightAngle));
}
}
}
@Test
public void rightOf() {
for (int right = 0; right < 360; right++) {
final Angle rightAngle = Angle.fromDegrees(right);
for (int add = 1; add < 360; add++)
if (add != 180) {
final int left = right + add;
final Angle leftAngle = Angle.fromDegrees(left);
assertEquals(left + "° right of " + right + "°", add > 180, leftAngle.rightOf(rightAngle));
}
}
}
}

View File

@@ -1,39 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static pp.util.FloatMath.ZERO_TOLERANCE;
public class IntervalTest {
private Interval interval;
@Before
public void setUp() {
interval = new Interval(0f, 1f);
}
@Test
public void contains() {
assertTrue(interval.contains(0.5f));
assertTrue(interval.contains(0f));
assertTrue(interval.contains(1f));
assertFalse(interval.contains(1.5f));
assertFalse(interval.contains(-0.5f));
}
@Test
public void matches() {
assertTrue(interval.matches(new Interval(0f, 1f), ZERO_TOLERANCE));
assertFalse(interval.matches(new Interval(0f, 0.99f), ZERO_TOLERANCE));
}
}

View File

@@ -1,36 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class RandomPositionIteratorTest {
public static final int WIDTH = 15;
public static final int HEIGHT = 25;
@Test
public void permutation() {
for (int i = 0; i < 10; i++) {
final List<Position> permutation = new ArrayList<>();
RandomPositionIterator.floatPoints(WIDTH, HEIGHT).forEachRemaining(permutation::add);
assertEquals(WIDTH * HEIGHT, permutation.size());
assertEquals(permutation.size(), new HashSet<>(permutation).size());
for (Position w : permutation) {
assertTrue(w.toString(), 0 <= w.getX() && w.getX() < WIDTH);
assertTrue(w.toString(), 0 <= w.getY() && w.getY() < HEIGHT);
}
}
}
}

View File

@@ -1,201 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static pp.util.FloatMath.FLT_EPSILON;
import static pp.util.FloatMath.PI;
import static pp.util.FloatMath.ZERO_TOLERANCE;
import static pp.util.FloatMath.cos;
import static pp.util.FloatMath.sqr;
import static pp.util.FloatMath.sqrt;
import static pp.util.FloatMath.tan;
public class SegmentTest {
private static final float SQRT2 = sqrt(2f);
private static final Segment segment1 = new Segment(new FloatPoint(1f, -1f), new FloatPoint(1f, 1f));
private static final Segment segment2 = new Segment(new FloatPoint(SQRT2, 0f), new FloatPoint(0f, SQRT2));
private static final Segment segment3 = new Segment(new FloatPoint(2f, -1f), new FloatPoint(2f, 1f));
private static final Segment segment4 = new Segment(new FloatPoint(SQRT2, -1f), new FloatPoint(SQRT2, 1f));
private static final Segment segment5 = new Segment(new FloatPoint(-SQRT2, 2f * SQRT2), new FloatPoint(2f * SQRT2, -SQRT2));
private static final Segment segment6 = new Segment(new FloatPoint(0f, 0f), new FloatPoint(SQRT2, 1f));
private static final FloatPoint ZERO = new FloatPoint(0f, 0f);
public static final FloatPoint ONE_UP = new FloatPoint(0f, 1f);
public static final FloatPoint ONE_DOWN = new FloatPoint(0f, -1f);
@Test
public void dist1() {
assertEquals(1f, segment1.dist(ZERO, 0f), FLT_EPSILON);
assertEquals(1f, segment1.dist(ONE_UP, 0f), FLT_EPSILON);
assertEquals(1f, segment1.dist(ONE_DOWN, 0f), FLT_EPSILON);
assertEquals(1f / cos(0.125f * PI), segment1.dist(ZERO, 0.125f * PI), FLT_EPSILON);
assertEquals(1f / cos(0.125f * PI), segment1.dist(ONE_UP, 0.125f * PI), FLT_EPSILON);
assertEquals(1f / cos(0.125f * PI), segment1.dist(ONE_DOWN, 0.125f * PI), FLT_EPSILON);
assertEquals(1f / cos(0.125f * PI), segment1.dist(ZERO, -0.125f * PI), FLT_EPSILON);
assertEquals(1f / cos(0.125f * PI), segment1.dist(ONE_UP, -0.125f * PI), FLT_EPSILON);
assertEquals(1f / cos(0.125f * PI), segment1.dist(ONE_DOWN, -0.125f * PI), FLT_EPSILON);
assertEquals(SQRT2, segment1.dist(ZERO, 0.25f * PI), FLT_EPSILON);
assertEquals(SQRT2, segment1.dist(ZERO, -0.25f * PI), FLT_EPSILON);
}
@Test
public void dist2() {
assertEquals(1f, segment2.dist(ZERO, 0.25f * PI), FLT_EPSILON);
assertEquals(SQRT2, segment2.dist(ZERO, 0f), FLT_EPSILON);
assertEquals(SQRT2, segment2.dist(ZERO, 0.5f * PI), FLT_EPSILON);
assertEquals(1f / cos(0.125f * PI), segment2.dist(ZERO, 0.375f * PI), FLT_EPSILON);
assertEquals(SQRT2, segment2.dist(ZERO, PI / 2f), FLT_EPSILON);
}
@Test
public void quotient1() {
assertEquals(0.5f, segment1.quotient(ZERO, 0f), FLT_EPSILON);
assertEquals(1f, segment1.quotient(ONE_UP, 0f), FLT_EPSILON);
assertEquals(0f, segment1.quotient(ONE_DOWN, 0f), FLT_EPSILON);
assertEquals(0.5f * tan(0.125f * PI) + 0.5f, segment1.quotient(ZERO, 0.125f * PI), FLT_EPSILON);
assertEquals(0.5f * tan(0.125f * PI) + 1f, segment1.quotient(ONE_UP, 0.125f * PI), FLT_EPSILON);
assertEquals(0.5f * tan(0.125f * PI), segment1.quotient(ONE_DOWN, 0.125f * PI), FLT_EPSILON);
assertEquals(0.5f - 0.5f * tan(0.125f * PI), segment1.quotient(ZERO, -0.125f * PI), FLT_EPSILON);
assertEquals(1f - 0.5f * tan(0.125f * PI), segment1.quotient(ONE_UP, -0.125f * PI), FLT_EPSILON);
assertEquals(-0.5f * tan(0.125f * PI), segment1.quotient(ONE_DOWN, -0.125f * PI), FLT_EPSILON);
assertEquals(1f, segment1.quotient(ZERO, 0.25f * PI), FLT_EPSILON);
assertEquals(0f, segment1.quotient(ZERO, -0.25f * PI), FLT_EPSILON);
}
@Test
public void quotient2() {
assertEquals(0.5f, segment2.quotient(ZERO, 0.25f * PI), FLT_EPSILON);
assertEquals(0f, segment2.quotient(ZERO, 0f), FLT_EPSILON);
assertEquals(1f, segment2.quotient(ZERO, 0.5f * PI), FLT_EPSILON);
assertEquals(0.5f * SQRT2, segment2.quotient(ZERO, 0.375f * PI), FLT_EPSILON);
assertEquals(1f - 0.5f * SQRT2, segment2.quotient(ZERO, 0.125f * PI), FLT_EPSILON);
}
@Test
public void project() {
assertEquals(0.5f, segment1.project(ZERO), FLT_EPSILON);
assertEquals(0.5f, segment2.project(ZERO), FLT_EPSILON);
}
@Test
public void minDistanceSquared1() {
assertEquals(0f, segment1.minDistanceSquared(segment1), ZERO_TOLERANCE);
assertEquals(0f, segment1.minDistanceSquared(segment2), ZERO_TOLERANCE);
assertEquals(0f, segment2.minDistanceSquared(segment1), ZERO_TOLERANCE);
assertEquals(1f, segment1.minDistanceSquared(segment3), ZERO_TOLERANCE);
assertEquals(1f, segment3.minDistanceSquared(segment1), ZERO_TOLERANCE);
assertEquals(sqr(SQRT2 - 1f), segment1.minDistanceSquared(segment4), ZERO_TOLERANCE);
assertEquals(sqr(SQRT2 - 1f), segment4.minDistanceSquared(segment1), ZERO_TOLERANCE);
assertEquals(0f, segment1.minDistanceSquared(segment5), ZERO_TOLERANCE);
assertEquals(0f, segment5.minDistanceSquared(segment1), ZERO_TOLERANCE);
assertEquals(0f, segment1.minDistanceSquared(segment6), ZERO_TOLERANCE);
assertEquals(0f, segment6.minDistanceSquared(segment1), ZERO_TOLERANCE);
assertEquals(0f, segment2.minDistanceSquared(segment2), ZERO_TOLERANCE);
assertEquals(sqr(2f - SQRT2), segment2.minDistanceSquared(segment3), ZERO_TOLERANCE);
assertEquals(sqr(2f - SQRT2), segment3.minDistanceSquared(segment2), ZERO_TOLERANCE);
assertEquals(0f, segment2.minDistanceSquared(segment4), ZERO_TOLERANCE);
assertEquals(0f, segment4.minDistanceSquared(segment2), ZERO_TOLERANCE);
assertEquals(0f, segment2.minDistanceSquared(segment5), ZERO_TOLERANCE);
assertEquals(0f, segment5.minDistanceSquared(segment2), ZERO_TOLERANCE);
assertEquals(0f, segment2.minDistanceSquared(segment6), ZERO_TOLERANCE);
assertEquals(0f, segment6.minDistanceSquared(segment2), ZERO_TOLERANCE);
assertEquals(0f, segment3.minDistanceSquared(segment3), ZERO_TOLERANCE);
assertEquals(sqr(2f - SQRT2), segment3.minDistanceSquared(segment4), ZERO_TOLERANCE);
assertEquals(sqr(2f - SQRT2), segment4.minDistanceSquared(segment3), ZERO_TOLERANCE);
assertEquals(0f, segment3.minDistanceSquared(segment5), ZERO_TOLERANCE);
assertEquals(0f, segment5.minDistanceSquared(segment3), ZERO_TOLERANCE);
assertEquals(sqr(2f - SQRT2), segment3.minDistanceSquared(segment6), ZERO_TOLERANCE);
assertEquals(sqr(2f - SQRT2), segment6.minDistanceSquared(segment3), ZERO_TOLERANCE);
assertEquals(0f, segment4.minDistanceSquared(segment4), ZERO_TOLERANCE);
assertEquals(0f, segment4.minDistanceSquared(segment5), ZERO_TOLERANCE);
assertEquals(0f, segment5.minDistanceSquared(segment4), ZERO_TOLERANCE);
assertEquals(0f, segment4.minDistanceSquared(segment6), ZERO_TOLERANCE);
assertEquals(0f, segment6.minDistanceSquared(segment4), ZERO_TOLERANCE);
assertEquals(0f, segment5.minDistanceSquared(segment5), ZERO_TOLERANCE);
assertEquals(0f, segment5.minDistanceSquared(segment6), ZERO_TOLERANCE);
assertEquals(0f, segment6.minDistanceSquared(segment5), ZERO_TOLERANCE);
assertEquals(0f, segment6.minDistanceSquared(segment6), ZERO_TOLERANCE);
}
@Test
public void minDistanceSquared2() {
final Segment s1 = new Segment(new FloatPoint(0f, 0f), new FloatPoint(2f, 1f));
for (int i = -20; i <= 40; i++) {
final float x = i * 0.1f;
final Segment s2 = new Segment(new FloatPoint(x, 2f), new FloatPoint(x + 2f, -2f));
final float dist;
if (i <= -10)
dist = 0.8f * sqr(1f + x);
else if (i <= 15)
dist = 0f;
else
dist = 0.8f * sqr(x - 1.5f);
assertEquals("x = " + x, dist, s1.minDistanceSquared(s2), ZERO_TOLERANCE);
assertEquals("x = " + x, dist, s2.minDistanceSquared(s1), ZERO_TOLERANCE);
}
}
@Test
public void minDistanceSquared3() {
final Segment s1 = new Segment(new FloatPoint(0f, 0f), new FloatPoint(2f, 1f));
for (float i = -30; i <= 30; i++) {
final float x = i * 0.1f;
final Segment s2 = new Segment(new FloatPoint(x, 0.5f * x), new FloatPoint(x + 2f, 0.5f * x + 1f));
final float dist;
if (i <= -20)
dist = 1.25f * sqr(2f + x);
else if (i <= 20)
dist = 0f;
else
dist = 1.25f * sqr(x - 2f);
assertEquals("x = " + x, dist, s1.minDistanceSquared(s2), ZERO_TOLERANCE);
assertEquals("x = " + x, dist, s2.minDistanceSquared(s1), ZERO_TOLERANCE);
}
}
@Test
public void minDistanceSquared4() {
final Segment s1 = new Segment(new FloatPoint(0f, 0f), new FloatPoint(3f, 1.5f));
for (float i = -30; i <= 50; i++) {
final float x = i * 0.1f;
final float y = 1f - 0.5f * x;
final Segment s2 = new Segment(new FloatPoint(x, 1f), new FloatPoint(x, 1f));
final float dist;
if (i <= -5)
dist = sqr(x) + 1f;
else if (i <= 32)
dist = 0.2f * sqr(x - 2f);
else
dist = sqr(x - 3f) + 0.25f;
assertEquals("x = " + x, dist, s1.minDistanceSquared(s2), ZERO_TOLERANCE);
assertEquals("x = " + x, dist, s2.minDistanceSquared(s1), ZERO_TOLERANCE);
}
}
}

View File

@@ -1,101 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util.config;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class ConfigTest {
private TestConfig config;
@Before
public void setUp() {
config = new TestConfig();
}
@Test
public void testReadFromProperties() {
Properties properties = new Properties();
properties.setProperty("test.string", "hello"); //NON-NLS
properties.setProperty("test.int", "42");
properties.setProperty("test.boolean", "true"); //NON-NLS
properties.setProperty("test.intArray", "1; 2 ;3;4");
config.readFrom(properties);
assertEquals("hello", config.getTestString());
assertEquals(42, config.getTestInt());
assertTrue(config.isTestBoolean());
assertArrayEquals(new int[]{1, 2, 3, 4}, config.getTestIntArray());
}
@Test
public void testReadFromFile() throws IOException {
Properties properties = new Properties();
properties.setProperty("test.string", "fileTest");
properties.setProperty("test.int", "24");
properties.setProperty("test.boolean", "false"); //NON-NLS
properties.setProperty("test.intArray", "10;20;30");
File tempFile = File.createTempFile("testConfig", ".properties");
try (FileWriter writer = new FileWriter(tempFile)) {
properties.store(writer, null);
}
config.readFrom(tempFile);
assertEquals("fileTest", config.getTestString());
assertEquals(24, config.getTestInt());
assertFalse(config.isTestBoolean());
assertArrayEquals(new int[]{10, 20, 30}, config.getTestIntArray());
// Clean up
tempFile.delete();
}
@Test
public void testConvertToType() {
assertEquals(42, config.convertToType("42", int.class));
assertEquals(true, config.convertToType("true", boolean.class)); //NON-NLS
assertEquals(3.14, config.convertToType("3.14", double.class));
}
@Test(expected = IllegalArgumentException.class)
public void testConvertToTypeWithUnsupportedType() {
config.convertToType("unsupported", Object.class); //NON-NLS
}
@Test
public void testToString() {
Properties properties = new Properties();
properties.setProperty("test.string", "stringValue");
properties.setProperty("test.int", "123");
properties.setProperty("test.boolean", "true"); //NON-NLS
properties.setProperty("test.intArray", "5;6;7");
config.readFrom(properties);
String expected = "[\ntest.boolean -> testBoolean = true,\n" +
"test.int -> testInt = 123,\n" +
"test.intArray -> testIntArray = {5, 6, 7},\n" +
"test.string -> testString = stringValue\n" +
"]";
assertEquals(expected, config.toString());
}
}

View File

@@ -1,40 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.util.config;
class TestConfig extends Config {
@Property("test.string")
private String testString;
@Property("test.int")
private int testInt;
@Property("test.boolean")
private boolean testBoolean;
@Property("test.intArray")
@Separator(";")
private int[] testIntArray;
// Getters for testing
public String getTestString() {
return testString;
}
public int getTestInt() {
return testInt;
}
public boolean isTestBoolean() {
return testBoolean;
}
public int[] getTestIntArray() {
return testIntArray;
}
}

View File

@@ -1,14 +0,0 @@
plugins {
id 'buildlogic.java-library-conventions'
}
description = 'Common classes used in jME applications'
dependencies {
implementation libs.jme3.core
api libs.lemur
api project(':common')
runtimeOnly libs.groovy.jsr223
runtimeOnly libs.slf4j.nop
}

View File

@@ -1,102 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.dialog;
import com.simsilica.lemur.Container;
/**
* Represents a dialog within a dialog manager system.
* Extends the Container class from the Lemur GUI library.
*/
public class Dialog extends Container {
/**
* The depth of the dialog within the dialog stack.
* Dialogs with lower depth values are considered to be "on top" of dialogs with higher values.
*/
protected final int depth;
/**
* The manager responsible for handling this dialog.
*/
protected final DialogManager manager;
/**
* Constructs a new Dialog with a depth automatically assigned by the DialogManager.
*
* @param manager The DialogManager that manages this dialog.
*/
public Dialog(DialogManager manager) {
this(manager, manager.nextDepth());
}
/**
* Constructs a new Dialog with the specified depth.
*
* @param manager The DialogManager that manages this dialog.
* @param depth The depth of this dialog within the dialog stack.
* @throws IllegalArgumentException if the specified depth is invalid (i.e., it is not greater than the depth of the top dialog in the manager's stack).
*/
public Dialog(DialogManager manager, int depth) {
this.manager = manager;
this.depth = depth;
// Ensure the dialog depth is greater than the depth of the current top dialog in the stack
if (!manager.getDialogStack().isEmpty() && manager.getDialogStack().getLast().depth >= depth)
throw new IllegalArgumentException("Invalid dialog depth " + depth);
}
/**
* Checks if this dialog is the topmost dialog in the dialog stack.
*
* @return true if this dialog is the topmost dialog, false otherwise.
*/
public boolean isTopDialog() {
return manager.isTop(this);
}
/**
* Runs the specified runnable if this dialog is the topmost dialog in the dialog stack.
*
* @param runnable the runnable.
* @see Dialog#isTopDialog()
*/
public void ifTopDialog(Runnable runnable) {
if (isTopDialog()) runnable.run();
}
/**
* Opens this dialog, centers it, and notifies the DialogManager to manage it.
*/
public void open() {
manager.centering(this, depth);
manager.open(this);
}
/**
* Closes this dialog and notifies the DialogManager to stop managing it.
*/
public void close() {
manager.close(this);
}
/**
* This method is called whenever the {@linkplain pp.dialog.DialogManager} would
* like to update this dialog.
*/
public void update() { /* empty */ }
/**
* This method is called by {@linkplain DialogManager#update(float)} for periodically
* updating this dialog. The default implementation does nothing.
*/
public void update(float delta) { /* empty */ }
/**
* This method calls the escape action if this dialog is the top dialog.
*/
public void escape() { /* empty */ }
}

View File

@@ -1,319 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.dialog;
import com.jme3.scene.Spatial;
import com.simsilica.lemur.Button;
import com.simsilica.lemur.Container;
import com.simsilica.lemur.Label;
import com.simsilica.lemur.component.BorderLayout;
import com.simsilica.lemur.style.ElementId;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;
import static com.simsilica.lemur.component.BorderLayout.Position.East;
import static com.simsilica.lemur.component.BorderLayout.Position.West;
/**
* A builder class for creating and customizing dialog boxes of type {@link SimpleDialog} or its subclasses.
* This builder pattern facilitates the construction of dialog boxes with various configurations,
* such as titles, text content, buttons, and additional custom behaviors.
*
* @param <D> the type of dialog to be built, typically extending {@link SimpleDialog}
*/
public class DialogBuilder<D extends SimpleDialog> {
/**
* Creates a {@link DialogBuilder} for a simple dialog with default settings.
*
* @param manager the dialog manager responsible for managing the dialog's lifecycle
* @return a {@link DialogBuilder} instance for creating simple dialogs
*/
public static DialogBuilder<SimpleDialog> simple(DialogManager manager) {
return new DialogBuilder<>(manager, SimpleDialog::new);
}
protected final DialogManager manager;
private final Function<DialogManager, D> dialogFactory;
private final List<Consumer<D>> extensionList = new ArrayList<>();
private String title;
private String text;
private String okLabel;
private String noLabel;
private Consumer<D> okAction = d -> {};
private Consumer<D> noAction = d -> {};
private boolean okClose = true;
private boolean noClose = true;
private Function<D, Spatial> focus;
/**
* Constructs a dialog builder with the specified dialog manager and dialog factory.
*
* @param manager the dialog manager responsible for managing the dialog's lifecycle
* @param dialogFactory a factory function to create instances of the dialog
*/
public DialogBuilder(DialogManager manager, Function<DialogManager, D> dialogFactory) {
this.manager = manager;
this.dialogFactory = dialogFactory;
}
/**
* Applies all registered extensions to the given dialog.
* Extensions allow for additional customizations beyond the standard configurations.
*
* @param dialog the dialog object to which the extensions will be applied
* @see #setExtension(java.util.function.Consumer)
*/
protected void extendDialog(D dialog) {
for (Consumer<D> extension : extensionList)
extension.accept(dialog);
}
/**
* Builds and returns the dialog with the specified configurations.
* This method creates a new dialog object and applies all the configured settings.
*
* @return the fully configured dialog object
*/
public D build() {
return build(dialogFactory.apply(manager));
}
/**
* Builds the dialog by configuring an existing dialog object with the specified settings.
* This method allows for further customization of a pre-existing dialog object.
*
* @param dialog the dialog object to configure
* @return the configured dialog object for chaining
*/
public D build(D dialog) {
configureTitle(dialog);
configureText(dialog);
extendDialog(dialog);
configureButtons(dialog);
configureFocus(dialog);
return dialog;
}
/**
* Configures the title of the dialog if a title has been set.
*
* @param dialog the dialog to which the title will be added
*/
private void configureTitle(D dialog) {
if (title != null)
dialog.addChild(new Label(title, new ElementId("header"))); // NON-NLS
}
/**
* Configures the main text content of the dialog if text has been set.
*
* @param dialog the dialog to which the text content will be added
*/
private void configureText(D dialog) {
if (text != null)
dialog.addChild(new Label(text));
}
/**
* Configures the OK and NO buttons for the dialog if labels for them have been set.
*
* @param dialog the dialog to which the buttons will be added
*/
private void configureButtons(D dialog) {
if (okLabel != null || noLabel != null) {
final Container buttons = dialog.addChild(new Container(new BorderLayout()));
if (okLabel != null) {
final Button okButton = buttons.addChild(new Button(okLabel), West);
dialog.setOkButton(okButton);
configureButton(okButton, okAction, okClose, dialog);
}
if (noLabel != null) {
final Button noButton = buttons.addChild(new Button(noLabel), East);
configureButton(noButton, noAction, noClose, dialog);
}
}
}
/**
* Configures a button with its action and whether the dialog should close after the action is performed.
*
* @param button the button to configure
* @param action the action to perform when the button is clicked
* @param close whether the dialog should close after the action is performed
* @param dialog the dialog that contains the button
*/
private void configureButton(Button button, Consumer<D> action, boolean close, D dialog) {
button.addClickCommands(s -> {
if (dialog.isTopDialog()) {
action.accept(dialog);
if (close) {
dialog.close();
}
}
});
}
/**
* Configures the initial focus for the dialog when it is displayed.
* The focus will be set to either a specified component or the OK button if available.
*
* @param dialog the dialog to configure focus for
*/
private void configureFocus(D dialog) {
final Spatial focusComponent = focus == null ? null : focus.apply(dialog);
if (focusComponent != null || dialog.getOkButton() != null)
manager.setFocus(focusComponent != null ? focusComponent : dialog.getOkButton());
}
/**
* Sets the title of the dialog.
*
* @param title the title text to be displayed at the top of the dialog
* @return this builder instance for chaining
*/
public DialogBuilder<D> setTitle(String title) {
this.title = title;
return this;
}
/**
* Sets the main text content of the dialog.
*
* @param text the main content text to be displayed in the dialog
* @return this builder instance for chaining
*/
public DialogBuilder<D> setText(String text) {
this.text = text;
return this;
}
/**
* Sets the label for the OK button.
*
* @param okLabel the text label to display on the OK button
* @return this builder instance for chaining
*/
public DialogBuilder<D> setOkButton(String okLabel) {
this.okLabel = okLabel;
return this;
}
/**
* Sets the label and action for the OK button.
* When the OK button is clicked, the specified action will be executed.
*
* @param okLabel the text label to display on the OK button
* @param okAction the action to perform when the OK button is clicked
* @return this builder instance for chaining
*/
public DialogBuilder<D> setOkButton(String okLabel, Consumer<D> okAction) {
this.okAction = okAction;
return setOkButton(okLabel);
}
/**
* Sets the label and action for the OK button.
* When the OK button is clicked, the specified runnable action will be executed.
*
* @param okLabel the text label to display on the OK button
* @param okAction the runnable action to perform when the OK button is clicked
* @return this builder instance for chaining
*/
public DialogBuilder<D> setOkButton(String okLabel, Runnable okAction) {
this.okAction = d -> okAction.run();
return setOkButton(okLabel);
}
/**
* Sets the label for the NO button.
*
* @param noLabel the text label to display on the NO button
* @return this builder instance for chaining
*/
public DialogBuilder<D> setNoButton(String noLabel) {
this.noLabel = noLabel;
return this;
}
/**
* Sets the label and action for the NO button.
* When the NO button is clicked, the specified action will be executed.
*
* @param noLabel the text label to display on the NO button
* @param noAction the action to perform when the NO button is clicked
* @return this builder instance for chaining
*/
public DialogBuilder<D> setNoButton(String noLabel, Consumer<D> noAction) {
this.noAction = noAction;
return setNoButton(noLabel);
}
/**
* Sets the label and action for the NO button.
* When the NO button is clicked, the specified runnable action will be executed.
*
* @param noLabel the text label to display on the NO button
* @param noAction the runnable action to perform when the NO button is clicked
* @return this builder instance for chaining
*/
public DialogBuilder<D> setNoButton(String noLabel, Runnable noAction) {
this.noAction = d -> noAction.run();
return setNoButton(noLabel);
}
/**
* Sets whether the dialog should automatically close when the OK button is clicked.
*
* @param okClose true to close the dialog when the OK button is clicked, false otherwise
* @return this builder instance for chaining
*/
public DialogBuilder<D> setOkClose(boolean okClose) {
this.okClose = okClose;
return this;
}
/**
* Sets whether the dialog should automatically close when the NO button is clicked.
*
* @param noClose true to close the dialog when the NO button is clicked, false otherwise
* @return this builder instance for chaining
*/
public DialogBuilder<D> setNoClose(boolean noClose) {
this.noClose = noClose;
return this;
}
/**
* Sets the component that should initially receive focus when the dialog is displayed.
* If a focus function is not provided, the focus defaults to the OK button.
*
* @param focus a function specifying which component of the dialog should receive focus
* @return this builder instance for chaining
*/
public DialogBuilder<D> setFocus(Function<D, Spatial> focus) {
this.focus = focus;
return this;
}
/**
* Adds an extension to the dialog.
* Extensions allow for additional customizations and behaviors beyond the basic configuration.
*
* @param extender a consumer that applies the extension to the dialog
* @return this builder instance for chaining
*/
public DialogBuilder<D> setExtension(Consumer<D> extender) {
extensionList.add(extender);
return this;
}
}

View File

@@ -1,157 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.dialog;
import com.jme3.app.SimpleApplication;
import com.jme3.math.Vector3f;
import com.jme3.scene.Spatial;
import com.jme3.system.AppSettings;
import com.simsilica.lemur.Panel;
import com.simsilica.lemur.focus.FocusManagerState;
import java.util.ArrayDeque;
import java.util.Deque;
import static java.lang.Math.max;
/**
* Manages dialog boxes within the application, handling their display, positioning, and focus.
*/
public class DialogManager {
/**
* The application instance.
*/
private final SimpleApplication app;
/**
* A stack to keep track of the dialogs.
*/
private final Deque<Dialog> dialogStack = new ArrayDeque<>();
/**
* Constructs a DialogManager for the specified application.
*
* @param app the SimpleApplication instance
*/
public DialogManager(SimpleApplication app) {
this.app = app;
}
/**
* Checks if any dialog is currently displayed.
*
* @return true if any dialog is currently shown, false otherwise
*/
public boolean showsDialog() {
return !dialogStack.isEmpty();
}
/**
* Retrieves the stack of dialogs.
*
* @return the dialog stack
*/
public Deque<Dialog> getDialogStack() {
return dialogStack;
}
/**
* Calculates the depth for the next dialog to be displayed.
*
* @return the next depth value
*/
public int nextDepth() {
return dialogStack.isEmpty() ? 10 : dialogStack.peek().depth + 10;
}
/**
* Positions the specified panel in the center of the screen, with a specified z coordinate.
*
* @param panel the panel to center
* @param z the z coordinate
*/
public void centering(Panel panel, float z) {
final Vector3f size = panel.getPreferredSize();
centering(panel, size.getX(), size.getY(), z);
}
/**
* Positions the specified spatial in the center of the screen, with specified width, height, and z coordinate.
*
* @param spatial the spatial to center
* @param width the width reserved for the spatial
* @param height the height reserved for the spatial
* @param z the z coordinate
*/
public void centering(Spatial spatial, float width, float height, float z) {
final AppSettings settings = app.getContext().getSettings();
spatial.setLocalTranslation(max(0f, 0.5f * (settings.getWidth() - width)),
max(0f, 0.5f * (settings.getHeight() + height)),
z);
}
/**
* Arranges for the specified spatial to receive the focus.
*
* @param spatial the spatial to focus
*/
public void setFocus(Spatial spatial) {
final var focusManager = app.getStateManager().getState(FocusManagerState.class);
if (focusManager != null)
focusManager.setFocus(spatial);
}
/**
* Opens the specified dialog and adds it to the dialog stack.
*
* @param dialog the dialog to open
*/
void open(Dialog dialog) {
dialogStack.push(dialog);
dialog.update();
app.getGuiNode().attachChild(dialog);
}
/**
* Checks if the specified dialog is the topmost dialog in the dialog stack.
*
* @param dialog a dialog.
* @return true if the dialog is the top dialog, false otherwise.
*/
boolean isTop(Dialog dialog) {
return !dialogStack.isEmpty() && dialogStack.peek() == dialog;
}
/**
* Closes the specified dialog, removing it from the dialog stack.
*
* @param dialog the dialog to close
* @throws IllegalArgumentException if the specified dialog is not the top dialog
*/
void close(Dialog dialog) {
if (!isTop(dialog))
throw new IllegalArgumentException(dialog + " is not the top dialog");
dialogStack.pop();
if (!dialogStack.isEmpty())
dialogStack.peek().update();
app.getGuiNode().detachChild(dialog);
}
/**
* Calls the escape action of the top dialog, if a dialog is shown.
*/
public void escape() {
if (dialogStack.isEmpty()) return;
dialogStack.peek().escape();
}
public void update(float delta) {
for (Dialog dialog : dialogStack)
dialog.update(delta);
}
}

View File

@@ -1,64 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.dialog;
import com.simsilica.lemur.Button;
/**
* Represents a simple dialog with OK and Cancel buttons.
* It extends the Dialog class and provides methods to get and set these buttons.
*/
public class SimpleDialog extends Dialog {
private Button okButton;
private Button cancelButton;
/**
* Constructs a SimpleDialog with the specified DialogManager.
*
* @param manager the DialogManager to manage this dialog
*/
public SimpleDialog(DialogManager manager) {
super(manager);
}
/**
* Returns the OK button of this dialog.
*
* @return the OK button
*/
public Button getOkButton() {
return okButton;
}
/**
* Sets the OK button of this dialog.
*
* @param okButton the OK button to set
*/
void setOkButton(Button okButton) {
this.okButton = okButton;
}
/**
* Returns the Cancel button of this dialog.
*
* @return the Cancel button
*/
public Button getCancelButton() {
return cancelButton;
}
/**
* Sets the Cancel button of this dialog.
*
* @param cancelButton the Cancel button to set
*/
void setCancelButton(Button cancelButton) {
this.cancelButton = cancelButton;
}
}

View File

@@ -1,53 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.dialog;
import com.jme3.app.Application;
import com.jme3.app.state.AppState;
import com.simsilica.lemur.DefaultCheckboxModel;
/**
* A checkbox model for enabling and disabling app states.
* This model links a checkbox with an AppState, so that checking
* or unchecking the box enables or disables the state, respectively.
*/
public class StateCheckboxModel extends DefaultCheckboxModel {
private final AppState state;
/**
* Constructs a StateCheckboxModel for the specified app state class.
*
* @param app the application containing the state manager
* @param stateClass the class of the app state to be controlled
*/
public StateCheckboxModel(Application app, Class<? extends AppState> stateClass) {
this(app.getStateManager().getState(stateClass));
}
/**
* Constructs a StateCheckboxModel for the specified app state.
*
* @param state the app state to be controlled
*/
public StateCheckboxModel(AppState state) {
this.state = state;
setChecked(state.isEnabled());
}
/**
* Sets the checked state of the checkbox and enables or disables
* the associated app state accordingly.
*
* @param checked true to check the box and enable the state, false to uncheck the box and disable the state
*/
@Override
public void setChecked(boolean checked) {
super.setChecked(checked);
state.setEnabled(checked);
}
}

View File

@@ -1,132 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.dialog;
import com.jme3.input.KeyInput;
import com.simsilica.lemur.Container;
import com.simsilica.lemur.Label;
import com.simsilica.lemur.TextField;
import com.simsilica.lemur.component.SpringGridLayout;
import com.simsilica.lemur.event.KeyAction;
/**
* A dialog class that asks for text input. Usually, this is a single-line
* text input.
*
* @see #getInput()
*/
public class TextInputDialog extends SimpleDialog {
// TextField for user input
private final TextField input = new TextField("");
/**
* Constructs a TextInputDialog associated with the specified dialog manager.
*
* @param manager the dialog manager to associate the dialog with
*/
private TextInputDialog(DialogManager manager) {
super(manager);
input.setSingleLine(true); // Set the input field to be single-line
input.setPreferredWidth(500f); // Set preferred width of the input field
}
/**
* Returns the input field.
*
* @return the input field
*/
public TextField getInput() {
return input;
}
/**
* Maps the specified key action to trigger a click on the OK button.
*
* @param action the key action to map
*/
private void clickOkOn(KeyAction action) {
input.getActionMap().put(action, (c, k) -> {
if (getOkButton() != null)
getOkButton().click();
});
}
/**
* Creates a builder for TextInputDialog.
*
* @param manager the dialog manager to associate the dialog with
* @return a TextInputDialogBuilder instance
*/
public static TextInputDialogBuilder builder(DialogManager manager) {
return new TextInputDialogBuilder(manager);
}
/**
* A builder class for creating TextInputDialog instances.
*/
public static class TextInputDialogBuilder extends DialogBuilder<TextInputDialog> {
private String label;
private boolean returnHitsOK = true;
/**
* Constructs a TextInputDialogBuilder with the specified dialog manager.
*
* @param manager the dialog manager to associate the dialog with
*/
private TextInputDialogBuilder(DialogManager manager) {
super(manager, TextInputDialog::new);
}
/**
* Extends the dialog with additional components like a label and input field.
*
* @param dialog the dialog to be extended
*/
@Override
protected void extendDialog(TextInputDialog dialog) {
final TextField textField = dialog.getInput();
if (label == null) {
dialog.addChild(textField);
}
else {
final Container c = dialog.addChild(new Container(new SpringGridLayout()));
c.addChild(new Label(label));
c.addChild(textField, 1);
}
if (returnHitsOK) {
// move the caret right so that it becomes visible at the end of a long text
textField.getDocumentModel().right();
// Hitting a return key is like pushing the ok button
dialog.clickOkOn(new KeyAction(KeyInput.KEY_RETURN));
dialog.clickOkOn(new KeyAction(KeyInput.KEY_NUMPADENTER));
}
}
/**
* Sets the label for the input field.
*
* @param label the label text
* @return this builder instance for chaining
*/
public TextInputDialogBuilder setLabel(String label) {
this.label = label;
return this;
}
/**
* Sets whether hitting the return key triggers the OK button.
*
* @param returnHitsOK true to trigger OK button on return key, false otherwise
* @return this builder instance for chaining
*/
public TextInputDialogBuilder setReturnHitsOK(boolean returnHitsOK) {
this.returnHitsOK = returnHitsOK;
return this;
}
}
}

View File

@@ -1,229 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.graphics;
import com.jme3.asset.AssetManager;
import com.jme3.material.Material;
import com.jme3.material.RenderState;
import com.jme3.material.RenderState.BlendMode;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.Mesh;
import com.jme3.scene.VertexBuffer;
import com.jme3.scene.shape.Quad;
import pp.util.Position;
import pp.util.SegmentLike;
import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.util.HashMap;
import java.util.Map;
import static pp.util.FloatMath.FLT_EPSILON;
import static pp.util.FloatMath.TWO_PI;
import static pp.util.FloatMath.cos;
import static pp.util.FloatMath.sin;
import static pp.util.FloatMath.sqr;
import static pp.util.FloatMath.sqrt;
/**
* Class for creating graphical primitives.
*/
public class Draw {
private static final Logger LOGGER = System.getLogger(Draw.class.getName());
private static final int NUM = 10;
private static final String UNSHADED = "Common/MatDefs/Misc/Unshaded.j3md"; //NON-NLS
private static final String COLOR = "Color"; //NON-NLS
private final AssetManager am;
private final Map<ColorRGBA, Geometry> lineMap = new HashMap<>();
private final Map<ColorRGBA, Geometry> rectangleMap = new HashMap<>();
private final Map<ColorRGBA, Geometry> circleMap = new HashMap<>();
private Mesh lineMesh;
private Mesh circleMesh;
/**
* Creates an in stance of the Draw class with the specified
* asset manager.
*
* @param assetManager the specified asset manager
*/
public Draw(AssetManager assetManager) {
am = assetManager;
}
private Geometry makeLine(ColorRGBA color) {
LOGGER.log(Level.DEBUG, "create line with color {0}", color); //NON-NLS
if (lineMesh == null) {
lineMesh = new Mesh();
lineMesh.setMode(Mesh.Mode.Lines);
lineMesh.setBuffer(VertexBuffer.Type.Position, 3, new float[]{0, 0, 0, 0, 1, 0});
lineMesh.setBuffer(VertexBuffer.Type.Index, 2, new short[]{0, 1});
}
final Geometry lineGeom = new Geometry("lineMesh", lineMesh.clone());
Material matWireframe = new Material(am, UNSHADED); //NON-NLS
matWireframe.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
matWireframe.setColor(COLOR, color); //NON-NLS
lineGeom.setMaterial(matWireframe);
return lineGeom;
}
/**
* Creates a line for the specified segment.
*
* @param segment the segment with its start and end point
* @param z depth information
* @param color line color
*/
public Geometry makeLine(SegmentLike segment, float z, ColorRGBA color) {
return makeLine(segment.from(), segment.to(), z, color);
}
/**
* Creates a straight line between the specified points with the specified color.
*
* @param p1 start point
* @param p2 end point
* @param z depth information
* @param color line color
*/
public Geometry makeLine(Position p1, Position p2, float z, ColorRGBA color) {
return makeLine(p1.getX(), p1.getY(), p2.getX(), p2.getY(), z, color);
}
/**
* Creates a straight line between the specified points with the specified color.
*
* @param x1 x-coordinate of the start point
* @param y1 y-coordinate of the start point
* @param x2 x-coordinate of the end point
* @param y2 y-coordinate of the end point
* @param z depth information
* @param color line color
*/
public Geometry makeLine(float x1, float y1, float x2, float y2, float z, ColorRGBA color) {
final Geometry line = lineMap.computeIfAbsent(color, this::makeLine).clone();
line.lookAt(Vector3f.UNIT_Z, new Vector3f(x2 - x1, y2 - y1, 0));
line.setLocalScale(sqrt(sqr(x2 - x1) + sqr(y2 - y1)));
line.setLocalTranslation(x1, y1, z);
return line;
}
/**
* Creates a straight line between the specified points with the specified width and color.
*
* @param p1 start point
* @param p2 end point
* @param z depth information
* @param color line color
* @param width width of the line
*/
public Geometry makeFatLine(Position p1, Position p2, float z, ColorRGBA color, float width) {
return makeFatLine(p1.getX(), p1.getY(), p2.getX(), p2.getY(), z, color, width);
}
/**
* Creates a straight line between the specified points with the specified width and color.
*
* @param x1 x-coordinate of the start point
* @param y1 y-coordinate of the start point
* @param x2 x-coordinate of the end point
* @param y2 y-coordinate of the end point
* @param z depth information
* @param color line color
* @param width width of the line
*/
public Geometry makeFatLine(float x1, float y1, float x2, float y2, float z, ColorRGBA color, float width) {
final Geometry line = rectangleMap.computeIfAbsent(color, this::makeRectangle).clone();
final float dx = x2 - x1;
final float dy = y2 - y1;
final float len = sqrt(dx * dx + dy * dy);
line.setLocalScale(width, len + width, 1f);
if (len <= FLT_EPSILON)
line.setLocalTranslation(x1 - 0.5f * width, y1 - 0.5f * width, z);
else {
final float f = 0.5f * width / len;
line.setLocalTranslation(x1 - f * (dy + dx), y1 - f * (dy - dx), z);
line.getLocalRotation().lookAt(Vector3f.UNIT_Z, new Vector3f(dx, dy, 0f));
}
return line;
}
private Geometry makeRectangle(ColorRGBA color) {
final Mesh quad = new Quad(1f, 1f);
final Geometry rectangle = new Geometry("quad", quad); //NON-NLS
Material mat = new Material(am, UNSHADED); //NON-NLS
mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
mat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
mat.setColor(COLOR, color); //NON-NLS
rectangle.setMaterial(mat);
return rectangle;
}
/**
* Creates an axis-parallel rectangle with the specified color.
*
* @param x x-coordinate of the bottom-left corner
* @param y y-coordinate of the bottom-left corner
* @param w width of the rectangle
* @param h height of the rectangle
* @param z depth information
* @param color line color
*/
public Geometry makeRectangle(float x, float y, float z, float w, float h, ColorRGBA color) {
final Geometry rectangle = rectangleMap.computeIfAbsent(color, this::makeRectangle).clone();
rectangle.setLocalScale(w, h, 1f);
rectangle.setLocalTranslation(x, y, z);
return rectangle;
}
private Geometry makeCircle(ColorRGBA color) {
if (circleMesh == null) {
circleMesh = new Mesh();
circleMesh.setMode(Mesh.Mode.LineLoop);
final float[] pointBuffer = new float[3 * NUM];
final short[] indexBuffer = new short[NUM];
int j = 0;
for (short i = 0; i < NUM; i++) {
final float a = TWO_PI / NUM * i;
pointBuffer[j++] = 0.5f * cos(a);
pointBuffer[j++] = 0.5f * sin(a);
pointBuffer[j++] = 0f;
indexBuffer[i] = i;
}
circleMesh.setBuffer(VertexBuffer.Type.Position, 3, pointBuffer);
circleMesh.setBuffer(VertexBuffer.Type.Index, 2, indexBuffer);
}
final Geometry circle = new Geometry("circleMesh", circleMesh.clone());
Material matWireframe = new Material(am, UNSHADED); //NON-NLS
matWireframe.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
matWireframe.setColor(COLOR, color); //NON-NLS
circle.setMaterial(matWireframe);
return circle;
}
/**
* Creates an ellipse with the specified color.
*
* @param x x-coordinate of the center point
* @param y y-coordinate of the center point
* @param w width of the ellipse
* @param h height of the ellipse
* @param z depth information
* @param color line color
*/
public Geometry makeEllipse(float x, float y, float z, float w, float h, ColorRGBA color) {
final Geometry ellipse = circleMap.computeIfAbsent(color, this::makeCircle).clone();
ellipse.setLocalScale(w, h, 1f);
ellipse.setLocalTranslation(x, y, z);
return ellipse;
}
}

View File

@@ -1,90 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.view;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.util.HashMap;
import java.util.Map;
/**
* Abstract base class for keeping the scene graph (=view) in sync with the model.
*/
public abstract class ModelViewSynchronizer<I> {
private static final Logger LOGGER = System.getLogger(ModelViewSynchronizer.class.getName());
private final Node itemNode = new Node("items"); //NON-NLS
private final Map<I, Spatial> itemMap = new HashMap<>();
/**
* Saves the game state and the node.
*
* @param root particular node
*/
protected ModelViewSynchronizer(Node root) {
root.attachChild(itemNode);
}
/**
* Returns the spatial representing the specified item,
* or null if the item has no view counterpart.
*/
public Spatial getSpatial(I item) {
return itemMap.get(item);
}
/**
* removes spatial from map
*
* @param item spatial that should be removed
*/
public void delete(I item) {
final Spatial spatial = itemMap.remove(item);
if (spatial != null) {
spatial.removeFromParent();
LOGGER.log(Level.DEBUG, "removed spatial for {0} in {1}", item, this); //NON-NLS
}
}
/**
* add spatial to map
*
* @param item spatial that schuld be added
*/
public void add(I item) {
if (itemMap.containsKey(item)) {
LOGGER.log(Level.WARNING, "Item {0} already managed by {1}", item, this); //NON-NLS
return;
}
final Spatial spatial = translate(item);
itemMap.put(item, spatial);
LOGGER.log(Level.DEBUG, "added spatial for {0} in {1}", item, this); //NON-NLS
if (spatial != null)
itemNode.attachChild(spatial);
}
/**
* Removed every item
*/
public void clear() {
LOGGER.log(Level.DEBUG, "clear"); //NON-NLS
itemMap.clear();
itemNode.detachAllChildren();
}
/**
* Creates the spatial for the specified item. Implementations may decide to return null. This
* means that the item shall not be represented in the scene graph.
*
* @param item the item whose representing spatial is asked for
* @return the spatial of the item, or null if the item shall not be represented by a spatial.
*/
protected abstract Spatial translate(I item);
}

View File

@@ -1,524 +0,0 @@
info face="Metropolis Bold" size=32 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2
common lineHeight=33 base=26 scaleW=512 scaleH=512 pages=1 packed=0
page id=0 file="Metropolis-Bold-32.png"
chars count=170
char id=0 x=0 y=0 width=14 height=35 xoffset=1 yoffset=-1 xadvance=16 page=0 chnl=0
char id=10 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=0 xadvance=0 page=0 chnl=0
char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=0 xadvance=9 page=0 chnl=0
char id=33 x=359 y=117 width=9 height=24 xoffset=0 yoffset=3 xadvance=10 page=0 chnl=0
char id=34 x=44 y=165 width=16 height=12 xoffset=0 yoffset=3 xadvance=17 page=0 chnl=0
char id=35 x=422 y=117 width=23 height=24 xoffset=-1 yoffset=3 xadvance=22 page=0 chnl=0
char id=36 x=281 y=35 width=22 height=29 xoffset=-1 yoffset=1 xadvance=20 page=0 chnl=0
char id=37 x=395 y=117 width=27 height=24 xoffset=0 yoffset=3 xadvance=27 page=0 chnl=0
char id=38 x=280 y=66 width=23 height=25 xoffset=-1 yoffset=3 xadvance=22 page=0 chnl=0
char id=39 x=503 y=141 width=8 height=12 xoffset=0 yoffset=3 xadvance=9 page=0 chnl=0
char id=40 x=48 y=35 width=13 height=30 xoffset=0 yoffset=3 xadvance=12 page=0 chnl=0
char id=41 x=61 y=35 width=12 height=30 xoffset=0 yoffset=3 xadvance=12 page=0 chnl=0
char id=42 x=490 y=141 width=13 height=16 xoffset=0 yoffset=1 xadvance=13 page=0 chnl=0
char id=43 x=471 y=141 width=19 height=18 xoffset=0 yoffset=6 xadvance=19 page=0 chnl=0
char id=44 x=16 y=165 width=9 height=13 xoffset=0 yoffset=19 xadvance=9 page=0 chnl=0
char id=45 x=142 y=165 width=12 height=6 xoffset=0 yoffset=14 xadvance=12 page=0 chnl=0
char id=46 x=85 y=165 width=9 height=8 xoffset=0 yoffset=19 xadvance=9 page=0 chnl=0
char id=47 x=243 y=35 width=19 height=29 xoffset=-2 yoffset=1 xadvance=15 page=0 chnl=0
char id=48 x=336 y=117 width=23 height=24 xoffset=0 yoffset=3 xadvance=23 page=0 chnl=0
char id=49 x=201 y=117 width=13 height=24 xoffset=-1 yoffset=3 xadvance=13 page=0 chnl=0
char id=50 x=214 y=117 width=19 height=24 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=51 x=239 y=66 width=21 height=25 xoffset=-1 yoffset=3 xadvance=19 page=0 chnl=0
char id=52 x=233 y=117 width=22 height=24 xoffset=-1 yoffset=3 xadvance=21 page=0 chnl=0
char id=53 x=260 y=66 width=20 height=25 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=54 x=255 y=117 width=21 height=24 xoffset=0 yoffset=3 xadvance=21 page=0 chnl=0
char id=55 x=276 y=117 width=19 height=24 xoffset=0 yoffset=3 xadvance=19 page=0 chnl=0
char id=56 x=295 y=117 width=20 height=24 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=57 x=315 y=117 width=21 height=24 xoffset=0 yoffset=3 xadvance=21 page=0 chnl=0
char id=58 x=375 y=141 width=9 height=19 xoffset=0 yoffset=8 xadvance=9 page=0 chnl=0
char id=59 x=386 y=117 width=9 height=24 xoffset=0 yoffset=8 xadvance=9 page=0 chnl=0
char id=60 x=384 y=141 width=18 height=19 xoffset=0 yoffset=6 xadvance=19 page=0 chnl=0
char id=61 x=25 y=165 width=19 height=13 xoffset=0 yoffset=9 xadvance=19 page=0 chnl=0
char id=62 x=402 y=141 width=18 height=19 xoffset=1 yoffset=6 xadvance=19 page=0 chnl=0
char id=63 x=368 y=117 width=18 height=24 xoffset=-1 yoffset=3 xadvance=16 page=0 chnl=0
char id=64 x=303 y=35 width=28 height=28 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=0
char id=65 x=21 y=92 width=26 height=24 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=66 x=47 y=92 width=22 height=24 xoffset=1 yoffset=3 xadvance=22 page=0 chnl=0
char id=67 x=69 y=92 width=23 height=24 xoffset=0 yoffset=3 xadvance=22 page=0 chnl=0
char id=68 x=92 y=92 width=23 height=24 xoffset=1 yoffset=3 xadvance=24 page=0 chnl=0
char id=69 x=115 y=92 width=20 height=24 xoffset=1 yoffset=3 xadvance=21 page=0 chnl=0
char id=70 x=135 y=92 width=20 height=24 xoffset=1 yoffset=3 xadvance=20 page=0 chnl=0
char id=71 x=155 y=92 width=23 height=24 xoffset=0 yoffset=3 xadvance=24 page=0 chnl=0
char id=72 x=178 y=92 width=22 height=24 xoffset=1 yoffset=3 xadvance=24 page=0 chnl=0
char id=73 x=200 y=92 width=7 height=24 xoffset=1 yoffset=3 xadvance=9 page=0 chnl=0
char id=74 x=207 y=92 width=18 height=24 xoffset=-1 yoffset=3 xadvance=17 page=0 chnl=0
char id=75 x=225 y=92 width=23 height=24 xoffset=1 yoffset=3 xadvance=22 page=0 chnl=0
char id=76 x=248 y=92 width=18 height=24 xoffset=1 yoffset=3 xadvance=19 page=0 chnl=0
char id=77 x=266 y=92 width=26 height=24 xoffset=1 yoffset=3 xadvance=28 page=0 chnl=0
char id=78 x=292 y=92 width=23 height=24 xoffset=1 yoffset=3 xadvance=25 page=0 chnl=0
char id=79 x=315 y=92 width=26 height=24 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=0
char id=80 x=341 y=92 width=21 height=24 xoffset=1 yoffset=3 xadvance=21 page=0 chnl=0
char id=81 x=362 y=92 width=26 height=24 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=0
char id=82 x=388 y=92 width=21 height=24 xoffset=1 yoffset=3 xadvance=22 page=0 chnl=0
char id=83 x=409 y=92 width=22 height=24 xoffset=-1 yoffset=3 xadvance=20 page=0 chnl=0
char id=84 x=431 y=92 width=21 height=24 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=85 x=452 y=92 width=23 height=24 xoffset=1 yoffset=3 xadvance=24 page=0 chnl=0
char id=86 x=475 y=92 width=26 height=24 xoffset=-1 yoffset=3 xadvance=24 page=0 chnl=0
char id=87 x=0 y=117 width=36 height=24 xoffset=-1 yoffset=3 xadvance=35 page=0 chnl=0
char id=88 x=36 y=117 width=25 height=24 xoffset=-1 yoffset=3 xadvance=23 page=0 chnl=0
char id=89 x=61 y=117 width=25 height=24 xoffset=-1 yoffset=3 xadvance=22 page=0 chnl=0
char id=90 x=86 y=117 width=21 height=24 xoffset=0 yoffset=3 xadvance=21 page=0 chnl=0
char id=91 x=73 y=35 width=11 height=30 xoffset=1 yoffset=2 xadvance=12 page=0 chnl=0
char id=92 x=262 y=35 width=19 height=29 xoffset=-2 yoffset=1 xadvance=15 page=0 chnl=0
char id=93 x=84 y=35 width=12 height=30 xoffset=0 yoffset=2 xadvance=12 page=0 chnl=0
char id=94 x=60 y=165 width=16 height=11 xoffset=0 yoffset=3 xadvance=16 page=0 chnl=0
char id=95 x=154 y=165 width=22 height=5 xoffset=-2 yoffset=27 xadvance=19 page=0 chnl=0
char id=96 x=94 y=165 width=10 height=7 xoffset=1 yoffset=2 xadvance=12 page=0 chnl=0
char id=97 x=128 y=141 width=18 height=19 xoffset=0 yoffset=8 xadvance=19 page=0 chnl=0
char id=98 x=107 y=117 width=20 height=24 xoffset=1 yoffset=3 xadvance=21 page=0 chnl=0
char id=99 x=146 y=141 width=18 height=19 xoffset=0 yoffset=8 xadvance=18 page=0 chnl=0
char id=100 x=127 y=117 width=21 height=24 xoffset=0 yoffset=3 xadvance=21 page=0 chnl=0
char id=101 x=164 y=141 width=19 height=19 xoffset=0 yoffset=8 xadvance=19 page=0 chnl=0
char id=102 x=357 y=35 width=14 height=26 xoffset=-1 yoffset=1 xadvance=12 page=0 chnl=0
char id=103 x=157 y=66 width=20 height=25 xoffset=0 yoffset=8 xadvance=21 page=0 chnl=0
char id=104 x=148 y=117 width=19 height=24 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=105 x=349 y=35 width=8 height=27 xoffset=0 yoffset=0 xadvance=9 page=0 chnl=0
char id=106 x=14 y=0 width=12 height=33 xoffset=-3 yoffset=0 xadvance=9 page=0 chnl=0
char id=107 x=167 y=117 width=20 height=24 xoffset=0 yoffset=3 xadvance=18 page=0 chnl=0
char id=108 x=501 y=92 width=7 height=24 xoffset=1 yoffset=3 xadvance=9 page=0 chnl=0
char id=109 x=183 y=141 width=29 height=19 xoffset=0 yoffset=8 xadvance=30 page=0 chnl=0
char id=110 x=212 y=141 width=19 height=19 xoffset=0 yoffset=8 xadvance=20 page=0 chnl=0
char id=111 x=231 y=141 width=21 height=19 xoffset=0 yoffset=8 xadvance=20 page=0 chnl=0
char id=112 x=177 y=66 width=20 height=25 xoffset=1 yoffset=8 xadvance=21 page=0 chnl=0
char id=113 x=197 y=66 width=21 height=25 xoffset=0 yoffset=8 xadvance=21 page=0 chnl=0
char id=114 x=491 y=117 width=13 height=20 xoffset=1 yoffset=7 xadvance=13 page=0 chnl=0
char id=115 x=252 y=141 width=17 height=19 xoffset=-1 yoffset=8 xadvance=16 page=0 chnl=0
char id=116 x=187 y=117 width=14 height=24 xoffset=-1 yoffset=3 xadvance=13 page=0 chnl=0
char id=117 x=269 y=141 width=19 height=19 xoffset=0 yoffset=8 xadvance=20 page=0 chnl=0
char id=118 x=288 y=141 width=21 height=19 xoffset=-1 yoffset=8 xadvance=19 page=0 chnl=0
char id=119 x=309 y=141 width=29 height=19 xoffset=-1 yoffset=8 xadvance=27 page=0 chnl=0
char id=120 x=338 y=141 width=20 height=19 xoffset=-1 yoffset=8 xadvance=18 page=0 chnl=0
char id=121 x=218 y=66 width=21 height=25 xoffset=-1 yoffset=8 xadvance=19 page=0 chnl=0
char id=122 x=358 y=141 width=17 height=19 xoffset=0 yoffset=8 xadvance=17 page=0 chnl=0
char id=123 x=96 y=35 width=13 height=30 xoffset=0 yoffset=3 xadvance=13 page=0 chnl=0
char id=124 x=502 y=0 width=6 height=29 xoffset=2 yoffset=1 xadvance=10 page=0 chnl=0
char id=125 x=109 y=35 width=13 height=30 xoffset=0 yoffset=3 xadvance=13 page=0 chnl=0
char id=126 x=104 y=165 width=14 height=7 xoffset=0 yoffset=11 xadvance=14 page=0 chnl=0
char id=161 x=497 y=35 width=8 height=25 xoffset=1 yoffset=8 xadvance=10 page=0 chnl=0
char id=162 x=303 y=66 width=18 height=25 xoffset=0 yoffset=5 xadvance=18 page=0 chnl=0
char id=163 x=445 y=117 width=21 height=24 xoffset=0 yoffset=3 xadvance=21 page=0 chnl=0
char id=165 x=466 y=117 width=25 height=24 xoffset=-1 yoffset=3 xadvance=22 page=0 chnl=0
char id=168 x=118 y=165 width=14 height=7 xoffset=1 yoffset=2 xadvance=15 page=0 chnl=0
char id=175 x=176 y=165 width=14 height=5 xoffset=1 yoffset=4 xadvance=15 page=0 chnl=0
char id=180 x=132 y=165 width=10 height=7 xoffset=1 yoffset=2 xadvance=12 page=0 chnl=0
char id=184 x=76 y=165 width=9 height=9 xoffset=1 yoffset=25 xadvance=11 page=0 chnl=0
char id=191 x=321 y=66 width=18 height=25 xoffset=-1 yoffset=8 xadvance=16 page=0 chnl=0
char id=192 x=94 y=0 width=26 height=31 xoffset=-1 yoffset=-4 xadvance=24 page=0 chnl=0
char id=193 x=120 y=0 width=26 height=31 xoffset=-1 yoffset=-4 xadvance=24 page=0 chnl=0
char id=194 x=146 y=0 width=26 height=31 xoffset=-1 yoffset=-4 xadvance=24 page=0 chnl=0
char id=195 x=172 y=0 width=26 height=31 xoffset=-1 yoffset=-4 xadvance=24 page=0 chnl=0
char id=196 x=198 y=0 width=26 height=31 xoffset=-1 yoffset=-4 xadvance=24 page=0 chnl=0
char id=197 x=26 y=0 width=26 height=33 xoffset=-1 yoffset=-6 xadvance=24 page=0 chnl=0
char id=198 x=0 y=141 width=36 height=24 xoffset=-1 yoffset=3 xadvance=34 page=0 chnl=0
char id=199 x=122 y=35 width=23 height=30 xoffset=0 yoffset=3 xadvance=22 page=0 chnl=0
char id=200 x=224 y=0 width=20 height=31 xoffset=1 yoffset=-4 xadvance=21 page=0 chnl=0
char id=201 x=244 y=0 width=20 height=31 xoffset=1 yoffset=-4 xadvance=21 page=0 chnl=0
char id=202 x=264 y=0 width=20 height=31 xoffset=1 yoffset=-4 xadvance=21 page=0 chnl=0
char id=203 x=284 y=0 width=20 height=31 xoffset=1 yoffset=-4 xadvance=21 page=0 chnl=0
char id=204 x=304 y=0 width=12 height=31 xoffset=-3 yoffset=-4 xadvance=9 page=0 chnl=0
char id=205 x=316 y=0 width=12 height=31 xoffset=1 yoffset=-4 xadvance=9 page=0 chnl=0
char id=206 x=328 y=0 width=13 height=31 xoffset=-2 yoffset=-4 xadvance=9 page=0 chnl=0
char id=207 x=341 y=0 width=17 height=31 xoffset=-3 yoffset=-4 xadvance=9 page=0 chnl=0
char id=208 x=36 y=141 width=26 height=24 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=0
char id=209 x=358 y=0 width=23 height=31 xoffset=1 yoffset=-4 xadvance=25 page=0 chnl=0
char id=210 x=381 y=0 width=26 height=31 xoffset=0 yoffset=-4 xadvance=26 page=0 chnl=0
char id=211 x=407 y=0 width=26 height=31 xoffset=0 yoffset=-4 xadvance=26 page=0 chnl=0
char id=212 x=145 y=35 width=26 height=30 xoffset=0 yoffset=-3 xadvance=26 page=0 chnl=0
char id=213 x=171 y=35 width=26 height=30 xoffset=0 yoffset=-3 xadvance=26 page=0 chnl=0
char id=214 x=197 y=35 width=26 height=30 xoffset=0 yoffset=-3 xadvance=26 page=0 chnl=0
char id=215 x=0 y=165 width=16 height=16 xoffset=1 yoffset=7 xadvance=18 page=0 chnl=0
char id=216 x=62 y=141 width=26 height=24 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=0
char id=217 x=433 y=0 width=23 height=31 xoffset=1 yoffset=-4 xadvance=24 page=0 chnl=0
char id=218 x=456 y=0 width=23 height=31 xoffset=1 yoffset=-4 xadvance=24 page=0 chnl=0
char id=219 x=479 y=0 width=23 height=31 xoffset=1 yoffset=-4 xadvance=24 page=0 chnl=0
char id=220 x=0 y=35 width=23 height=31 xoffset=1 yoffset=-4 xadvance=24 page=0 chnl=0
char id=221 x=23 y=35 width=25 height=31 xoffset=-1 yoffset=-4 xadvance=22 page=0 chnl=0
char id=222 x=88 y=141 width=21 height=24 xoffset=1 yoffset=3 xadvance=21 page=0 chnl=0
char id=223 x=339 y=66 width=19 height=25 xoffset=1 yoffset=2 xadvance=20 page=0 chnl=0
char id=224 x=371 y=35 width=18 height=26 xoffset=0 yoffset=1 xadvance=19 page=0 chnl=0
char id=225 x=389 y=35 width=18 height=26 xoffset=0 yoffset=1 xadvance=19 page=0 chnl=0
char id=226 x=358 y=66 width=18 height=25 xoffset=0 yoffset=2 xadvance=19 page=0 chnl=0
char id=227 x=376 y=66 width=18 height=25 xoffset=0 yoffset=2 xadvance=19 page=0 chnl=0
char id=228 x=394 y=66 width=18 height=25 xoffset=0 yoffset=2 xadvance=19 page=0 chnl=0
char id=229 x=331 y=35 width=18 height=28 xoffset=0 yoffset=-1 xadvance=19 page=0 chnl=0
char id=230 x=420 y=141 width=30 height=19 xoffset=0 yoffset=8 xadvance=30 page=0 chnl=0
char id=231 x=412 y=66 width=18 height=25 xoffset=0 yoffset=8 xadvance=18 page=0 chnl=0
char id=232 x=407 y=35 width=19 height=26 xoffset=0 yoffset=1 xadvance=19 page=0 chnl=0
char id=233 x=426 y=35 width=19 height=26 xoffset=0 yoffset=1 xadvance=19 page=0 chnl=0
char id=234 x=430 y=66 width=19 height=25 xoffset=0 yoffset=2 xadvance=19 page=0 chnl=0
char id=235 x=449 y=66 width=19 height=25 xoffset=0 yoffset=2 xadvance=19 page=0 chnl=0
char id=236 x=445 y=35 width=12 height=26 xoffset=-3 yoffset=1 xadvance=9 page=0 chnl=0
char id=237 x=457 y=35 width=12 height=26 xoffset=1 yoffset=1 xadvance=9 page=0 chnl=0
char id=238 x=469 y=35 width=13 height=26 xoffset=-2 yoffset=1 xadvance=9 page=0 chnl=0
char id=239 x=482 y=35 width=15 height=26 xoffset=-3 yoffset=1 xadvance=9 page=0 chnl=0
char id=240 x=0 y=66 width=20 height=26 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0
char id=241 x=20 y=66 width=19 height=26 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0
char id=242 x=39 y=66 width=21 height=26 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0
char id=243 x=60 y=66 width=21 height=26 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0
char id=244 x=468 y=66 width=21 height=25 xoffset=0 yoffset=2 xadvance=20 page=0 chnl=0
char id=245 x=489 y=66 width=21 height=25 xoffset=0 yoffset=2 xadvance=20 page=0 chnl=0
char id=246 x=0 y=92 width=21 height=25 xoffset=0 yoffset=2 xadvance=20 page=0 chnl=0
char id=247 x=109 y=141 width=19 height=20 xoffset=0 yoffset=5 xadvance=19 page=0 chnl=0
char id=248 x=450 y=141 width=21 height=19 xoffset=0 yoffset=8 xadvance=20 page=0 chnl=0
char id=249 x=81 y=66 width=19 height=26 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0
char id=250 x=100 y=66 width=19 height=26 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0
char id=251 x=119 y=66 width=19 height=26 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0
char id=252 x=138 y=66 width=19 height=26 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0
char id=253 x=52 y=0 width=21 height=32 xoffset=-1 yoffset=1 xadvance=19 page=0 chnl=0
char id=254 x=223 y=35 width=20 height=30 xoffset=1 yoffset=3 xadvance=21 page=0 chnl=0
char id=255 x=73 y=0 width=21 height=32 xoffset=-1 yoffset=1 xadvance=19 page=0 chnl=0
kernings count=349
kerning first=244 second=119 amount=-1
kerning first=86 second=225 amount=-1
kerning first=119 second=245 amount=-1
kerning first=253 second=243 amount=-1
kerning first=111 second=89 amount=-4
kerning first=248 second=86 amount=-2
kerning first=84 second=211 amount=-1
kerning first=84 second=194 amount=-2
kerning first=221 second=235 amount=-4
kerning first=192 second=221 amount=-1
kerning first=121 second=44 amount=-3
kerning first=65 second=89 amount=-1
kerning first=75 second=216 amount=-1
kerning first=87 second=248 amount=-2
kerning first=89 second=242 amount=-4
kerning first=221 second=111 amount=-4
kerning first=233 second=221 amount=-4
kerning first=75 second=195 amount=1
kerning first=234 second=86 amount=-2
kerning first=121 second=233 amount=-1
kerning first=119 second=235 amount=-1
kerning first=111 second=119 amount=-1
kerning first=76 second=86 amount=-3
kerning first=246 second=221 amount=-4
kerning first=86 second=198 amount=-3
kerning first=118 second=242 amount=-1
kerning first=89 second=194 amount=-1
kerning first=92 second=92 amount=-4
kerning first=119 second=111 amount=-1
kerning first=86 second=232 amount=-2
kerning first=194 second=221 amount=-1
kerning first=89 second=101 amount=-4
kerning first=87 second=234 amount=-2
kerning first=192 second=86 amount=-3
kerning first=86 second=246 amount=-2
kerning first=233 second=86 amount=-2
kerning first=197 second=84 amount=-2
kerning first=92 second=47 amount=3
kerning first=75 second=193 amount=1
kerning first=118 second=101 amount=-1
kerning first=243 second=221 amount=-4
kerning first=245 second=87 amount=-2
kerning first=246 second=86 amount=-2
kerning first=84 second=197 amount=-2
kerning first=121 second=46 amount=-3
kerning first=193 second=221 amount=-1
kerning first=197 second=87 amount=-1
kerning first=194 second=86 amount=-3
kerning first=89 second=99 amount=-2
kerning first=87 second=231 amount=-2
kerning first=235 second=87 amount=-2
kerning first=195 second=71 amount=-1
kerning first=99 second=89 amount=-4
kerning first=89 second=197 amount=-1
kerning first=121 second=244 amount=-1
kerning first=221 second=196 amount=-1
kerning first=243 second=86 amount=-2
kerning first=68 second=196 amount=-1
kerning first=84 second=65 amount=-2
kerning first=221 second=233 amount=-4
kerning first=86 second=245 amount=-2
kerning first=119 second=44 amount=-3
kerning first=75 second=210 amount=-1
kerning first=89 second=243 amount=-4
kerning first=193 second=86 amount=-3
kerning first=87 second=242 amount=-2
kerning first=231 second=221 amount=-4
kerning first=255 second=232 amount=-1
kerning first=230 second=89 amount=-4
kerning first=196 second=84 amount=-2
kerning first=119 second=233 amount=-1
kerning first=255 second=246 amount=-1
kerning first=89 second=65 amount=-1
kerning first=118 second=243 amount=-1
kerning first=242 second=87 amount=-2
kerning first=87 second=194 amount=-1
kerning first=118 second=228 amount=-1
kerning first=86 second=235 amount=-2
kerning first=87 second=101 amount=-2
kerning first=196 second=87 amount=-1
kerning first=230 second=119 amount=-1
kerning first=213 second=87 amount=-1
kerning first=86 second=111 amount=-2
kerning first=253 second=232 amount=-1
kerning first=101 second=87 amount=-2
kerning first=192 second=71 amount=-1
kerning first=245 second=118 amount=-1
kerning first=231 second=86 amount=-2
kerning first=121 second=248 amount=-1
kerning first=86 second=226 amount=-1
kerning first=221 second=195 amount=-1
kerning first=253 second=246 amount=-1
kerning first=68 second=195 amount=-1
kerning first=84 second=214 amount=-1
kerning first=244 second=87 amount=-2
kerning first=84 second=192 amount=-2
kerning first=232 second=89 amount=-4
kerning first=119 second=46 amount=-3
kerning first=221 second=244 amount=-4
kerning first=47 second=47 amount=-4
kerning first=87 second=99 amount=-2
kerning first=121 second=234 amount=-1
kerning first=194 second=71 amount=-1
kerning first=65 second=84 amount=-2
kerning first=255 second=245 amount=-1
kerning first=89 second=192 amount=-1
kerning first=87 second=197 amount=-1
kerning first=119 second=244 amount=-1
kerning first=221 second=193 amount=-1
kerning first=111 second=87 amount=-2
kerning first=118 second=227 amount=-1
kerning first=68 second=193 amount=-1
kerning first=195 second=89 amount=-1
kerning first=232 second=119 amount=-1
kerning first=82 second=89 amount=-1
kerning first=65 second=87 amount=-1
kerning first=75 second=211 amount=-1
kerning first=87 second=243 amount=-2
kerning first=210 second=87 amount=-1
kerning first=255 second=235 amount=-1
kerning first=86 second=229 amount=-1
kerning first=75 second=194 amount=1
kerning first=193 second=71 amount=-1
kerning first=242 second=118 amount=-1
kerning first=253 second=245 amount=-1
kerning first=248 second=89 amount=-4
kerning first=255 second=111 amount=-1
kerning first=84 second=213 amount=-1
kerning first=86 second=196 amount=-3
kerning first=84 second=198 amount=-2
kerning first=87 second=65 amount=-1
kerning first=118 second=225 amount=-1
kerning first=221 second=248 amount=-4
kerning first=86 second=233 amount=-2
kerning first=234 second=89 amount=-4
kerning first=212 second=87 amount=-1
kerning first=248 second=119 amount=-1
kerning first=253 second=235 amount=-1
kerning first=244 second=118 amount=-1
kerning first=89 second=198 amount=-1
kerning first=121 second=242 amount=-1
kerning first=86 second=97 amount=-1
kerning first=119 second=248 amount=-1
kerning first=253 second=111 amount=-1
kerning first=84 second=79 amount=-1
kerning first=89 second=232 amount=-4
kerning first=221 second=234 amount=-4
kerning first=192 second=89 amount=-1
kerning first=234 second=119 amount=-1
kerning first=89 second=246 amount=-4
kerning first=233 second=89 amount=-4
kerning first=75 second=197 amount=1
kerning first=79 second=87 amount=-1
kerning first=118 second=232 amount=-1
kerning first=121 second=101 amount=-1
kerning first=119 second=234 amount=-1
kerning first=99 second=87 amount=-2
kerning first=245 second=221 amount=-4
kerning first=111 second=118 amount=-1
kerning first=246 second=89 amount=-4
kerning first=86 second=195 amount=-3
kerning first=118 second=246 amount=-1
kerning first=87 second=192 amount=-1
kerning first=197 second=221 amount=-1
kerning first=194 second=89 amount=-1
kerning first=233 second=119 amount=-1
kerning first=255 second=44 amount=-3
kerning first=221 second=231 amount=-2
kerning first=235 second=221 amount=-4
kerning first=86 second=244 amount=-2
kerning first=255 second=233 amount=-1
kerning first=86 second=224 amount=-1
kerning first=246 second=119 amount=-1
kerning first=75 second=65 amount=1
kerning first=230 second=87 amount=-2
kerning first=243 second=89 amount=-4
kerning first=245 second=86 amount=-2
kerning first=86 second=193 amount=-3
kerning first=89 second=245 amount=-4
kerning first=193 second=89 amount=-1
kerning first=253 second=44 amount=-3
kerning first=197 second=86 amount=-3
kerning first=221 second=242 amount=-4
kerning first=235 second=86 amount=-2
kerning first=253 second=233 amount=-1
kerning first=243 second=119 amount=-1
kerning first=118 second=245 amount=-1
kerning first=242 second=221 amount=-4
kerning first=87 second=198 amount=-1
kerning first=121 second=243 amount=-1
kerning first=221 second=194 amount=-1
kerning first=119 second=242 amount=-1
kerning first=68 second=194 amount=-1
kerning first=255 second=46 amount=-3
kerning first=89 second=235 amount=-4
kerning first=87 second=232 amount=-2
kerning first=196 second=221 amount=-1
kerning first=221 second=101 amount=-4
kerning first=86 second=248 amount=-2
kerning first=75 second=214 amount=-1
kerning first=101 second=221 amount=-4
kerning first=89 second=111 amount=-4
kerning first=87 second=246 amount=-2
kerning first=232 second=87 amount=-2
kerning first=231 second=89 amount=-4
kerning first=195 second=84 amount=-2
kerning first=86 second=230 amount=-1
kerning first=75 second=192 amount=1
kerning first=118 second=235 amount=-1
kerning first=119 second=101 amount=-1
kerning first=255 second=244 amount=-1
kerning first=244 second=221 amount=-4
kerning first=118 second=111 amount=-1
kerning first=242 second=86 amount=-2
kerning first=118 second=226 amount=-1
kerning first=253 second=46 amount=-3
kerning first=86 second=234 amount=-2
kerning first=195 second=87 amount=-1
kerning first=196 second=86 amount=-3
kerning first=221 second=99 amount=-2
kerning first=101 second=86 amount=-2
kerning first=221 second=197 amount=-1
kerning first=253 second=244 amount=-1
kerning first=118 second=100 amount=-1
kerning first=111 second=221 amount=-4
kerning first=248 second=87 amount=-2
kerning first=84 second=212 amount=-1
kerning first=68 second=197 amount=-1
kerning first=244 second=86 amount=-2
kerning first=76 second=84 amount=-1
kerning first=84 second=196 amount=-2
kerning first=65 second=221 amount=-1
kerning first=75 second=213 amount=-1
kerning first=87 second=245 amount=-2
kerning first=221 second=243 amount=-4
kerning first=86 second=231 amount=-2
kerning first=75 second=198 amount=1
kerning first=234 second=87 amount=-2
kerning first=197 second=71 amount=-1
kerning first=192 second=84 amount=-2
kerning first=255 second=248 amount=-1
kerning first=89 second=196 amount=-1
kerning first=221 second=65 amount=-1
kerning first=119 second=243 amount=-1
kerning first=118 second=229 amount=-1
kerning first=111 second=86 amount=-2
kerning first=68 second=65 amount=-1
kerning first=89 second=233 amount=-4
kerning first=87 second=235 amount=-2
kerning first=192 second=87 amount=-1
kerning first=118 second=44 amount=-3
kerning first=65 second=86 amount=-3
kerning first=86 second=242 amount=-2
kerning first=75 second=79 amount=-1
kerning first=87 second=111 amount=-2
kerning first=233 second=87 amount=-2
kerning first=194 second=84 amount=-2
kerning first=253 second=248 amount=-1
kerning first=255 second=234 amount=-1
kerning first=118 second=233 amount=-1
kerning first=84 second=216 amount=-1
kerning first=246 second=87 amount=-2
kerning first=86 second=194 amount=-3
kerning first=84 second=195 amount=-2
kerning first=118 second=97 amount=-1
kerning first=86 second=101 amount=-2
kerning first=194 second=87 amount=-1
kerning first=216 second=87 amount=-1
kerning first=99 second=221 amount=-4
kerning first=121 second=232 amount=-1
kerning first=253 second=234 amount=-1
kerning first=196 second=71 amount=-1
kerning first=248 second=118 amount=-1
kerning first=193 second=84 amount=-2
kerning first=89 second=195 amount=-1
kerning first=121 second=246 amount=-1
kerning first=221 second=192 amount=-1
kerning first=243 second=87 amount=-2
kerning first=68 second=192 amount=-1
kerning first=84 second=193 amount=-2
kerning first=118 second=46 amount=-3
kerning first=89 second=244 amount=-4
kerning first=193 second=87 amount=-1
kerning first=86 second=99 amount=-2
kerning first=230 second=221 amount=-4
kerning first=99 second=86 amount=-2
kerning first=255 second=242 amount=-1
kerning first=245 second=89 amount=-4
kerning first=86 second=197 amount=-3
kerning first=89 second=193 amount=-1
kerning first=87 second=196 amount=-1
kerning first=118 second=244 amount=-1
kerning first=118 second=224 amount=-1
kerning first=197 second=89 amount=-1
kerning first=87 second=233 amount=-2
kerning first=235 second=89 amount=-4
kerning first=86 second=243 amount=-2
kerning first=214 second=87 amount=-1
kerning first=245 second=119 amount=-1
kerning first=255 second=101 amount=-1
kerning first=231 second=87 amount=-2
kerning first=246 second=118 amount=-1
kerning first=65 second=71 amount=-1
kerning first=86 second=228 amount=-1
kerning first=221 second=198 amount=-1
kerning first=121 second=245 amount=-1
kerning first=230 second=86 amount=-2
kerning first=253 second=242 amount=-1
kerning first=68 second=198 amount=-1
kerning first=84 second=210 amount=-1
kerning first=86 second=65 amount=-3
kerning first=221 second=232 amount=-4
kerning first=235 second=119 amount=-1
kerning first=89 second=248 amount=-4
kerning first=232 second=221 amount=-4
kerning first=221 second=246 amount=-4
kerning first=211 second=87 amount=-1
kerning first=121 second=235 amount=-1
kerning first=119 second=232 amount=-1
kerning first=253 second=101 amount=-1
kerning first=243 second=118 amount=-1
kerning first=118 second=248 amount=-1
kerning first=242 second=89 amount=-4
kerning first=87 second=195 amount=-1
kerning first=121 second=111 amount=-1
kerning first=119 second=246 amount=-1
kerning first=118 second=230 amount=-1
kerning first=195 second=221 amount=-1
kerning first=89 second=234 amount=-4
kerning first=196 second=89 amount=-1
kerning first=82 second=221 amount=-1
kerning first=75 second=212 amount=-1
kerning first=101 second=89 amount=-4
kerning first=87 second=244 amount=-2
kerning first=232 second=86 amount=-2
kerning first=86 second=227 amount=-1
kerning first=75 second=196 amount=1
kerning first=242 second=119 amount=-1
kerning first=118 second=234 amount=-1
kerning first=248 second=221 amount=-4
kerning first=255 second=243 amount=-1
kerning first=244 second=89 amount=-4
kerning first=86 second=192 amount=-3
kerning first=87 second=193 amount=-1
kerning first=221 second=245 amount=-4
kerning first=101 second=119 amount=-1
kerning first=195 second=86 amount=-3
kerning first=89 second=231 amount=-2
kerning first=234 second=221 amount=-4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -1,545 +0,0 @@
info face="Metropolis Bold" size=42 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2
common lineHeight=43 base=34 scaleW=512 scaleH=512 pages=1 packed=0
page id=0 file="Metropolis-Bold-42.png"
chars count=170
char id=0 x=0 y=0 width=17 height=44 xoffset=2 yoffset=0 xadvance=21 page=0 chnl=0
char id=10 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=0 xadvance=0 page=0 chnl=0
char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=0 xadvance=12 page=0 chnl=0
char id=33 x=467 y=155 width=11 height=32 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=0
char id=34 x=397 y=251 width=20 height=15 xoffset=1 yoffset=4 xadvance=22 page=0 chnl=0
char id=35 x=144 y=220 width=29 height=31 xoffset=0 yoffset=4 xadvance=28 page=0 chnl=0
char id=36 x=426 y=44 width=27 height=39 xoffset=-1 yoffset=0 xadvance=27 page=0 chnl=0
char id=37 x=51 y=155 width=35 height=33 xoffset=0 yoffset=3 xadvance=35 page=0 chnl=0
char id=38 x=322 y=84 width=29 height=34 xoffset=0 yoffset=3 xadvance=29 page=0 chnl=0
char id=39 x=417 y=251 width=9 height=15 xoffset=1 yoffset=4 xadvance=12 page=0 chnl=0
char id=40 x=362 y=44 width=15 height=39 xoffset=1 yoffset=3 xadvance=16 page=0 chnl=0
char id=41 x=377 y=44 width=15 height=39 xoffset=0 yoffset=3 xadvance=16 page=0 chnl=0
char id=42 x=346 y=251 width=17 height=18 xoffset=0 yoffset=2 xadvance=17 page=0 chnl=0
char id=43 x=302 y=251 width=23 height=23 xoffset=1 yoffset=8 xadvance=25 page=0 chnl=0
char id=44 x=363 y=251 width=11 height=16 xoffset=1 yoffset=26 xadvance=12 page=0 chnl=0
char id=45 x=14 y=277 width=15 height=8 xoffset=0 yoffset=18 xadvance=15 page=0 chnl=0
char id=46 x=458 y=251 width=10 height=10 xoffset=1 yoffset=26 xadvance=12 page=0 chnl=0
char id=47 x=0 y=84 width=25 height=37 xoffset=-3 yoffset=1 xadvance=19 page=0 chnl=0
char id=48 x=0 y=155 width=29 height=33 xoffset=0 yoffset=3 xadvance=30 page=0 chnl=0
char id=49 x=75 y=220 width=17 height=31 xoffset=-1 yoffset=4 xadvance=17 page=0 chnl=0
char id=50 x=416 y=155 width=25 height=32 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=0
char id=51 x=402 y=121 width=25 height=33 xoffset=0 yoffset=3 xadvance=25 page=0 chnl=0
char id=52 x=92 y=220 width=27 height=31 xoffset=0 yoffset=4 xadvance=27 page=0 chnl=0
char id=53 x=441 y=155 width=26 height=32 xoffset=0 yoffset=4 xadvance=26 page=0 chnl=0
char id=54 x=427 y=121 width=27 height=33 xoffset=0 yoffset=3 xadvance=27 page=0 chnl=0
char id=55 x=119 y=220 width=25 height=31 xoffset=0 yoffset=4 xadvance=25 page=0 chnl=0
char id=56 x=454 y=121 width=26 height=33 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=0
char id=57 x=480 y=121 width=27 height=33 xoffset=0 yoffset=3 xadvance=27 page=0 chnl=0
char id=58 x=112 y=251 width=10 height=25 xoffset=1 yoffset=11 xadvance=12 page=0 chnl=0
char id=59 x=499 y=155 width=11 height=31 xoffset=1 yoffset=11 xadvance=12 page=0 chnl=0
char id=60 x=234 y=251 width=22 height=24 xoffset=1 yoffset=8 xadvance=25 page=0 chnl=0
char id=61 x=374 y=251 width=23 height=16 xoffset=1 yoffset=12 xadvance=25 page=0 chnl=0
char id=62 x=256 y=251 width=23 height=24 xoffset=1 yoffset=8 xadvance=25 page=0 chnl=0
char id=63 x=29 y=155 width=22 height=33 xoffset=-1 yoffset=3 xadvance=21 page=0 chnl=0
char id=64 x=50 y=84 width=37 height=36 xoffset=0 yoffset=4 xadvance=37 page=0 chnl=0
char id=65 x=28 y=188 width=33 height=31 xoffset=-1 yoffset=4 xadvance=32 page=0 chnl=0
char id=66 x=61 y=188 width=27 height=31 xoffset=2 yoffset=4 xadvance=29 page=0 chnl=0
char id=67 x=96 y=121 width=30 height=33 xoffset=0 yoffset=3 xadvance=29 page=0 chnl=0
char id=68 x=88 y=188 width=30 height=31 xoffset=2 yoffset=4 xadvance=32 page=0 chnl=0
char id=69 x=118 y=188 width=26 height=31 xoffset=1 yoffset=4 xadvance=27 page=0 chnl=0
char id=70 x=144 y=188 width=26 height=31 xoffset=1 yoffset=4 xadvance=27 page=0 chnl=0
char id=71 x=126 y=121 width=30 height=33 xoffset=0 yoffset=3 xadvance=31 page=0 chnl=0
char id=72 x=170 y=188 width=29 height=31 xoffset=1 yoffset=4 xadvance=31 page=0 chnl=0
char id=73 x=489 y=155 width=10 height=31 xoffset=1 yoffset=4 xadvance=12 page=0 chnl=0
char id=74 x=289 y=155 width=23 height=32 xoffset=-1 yoffset=4 xadvance=23 page=0 chnl=0
char id=75 x=199 y=188 width=29 height=31 xoffset=2 yoffset=4 xadvance=29 page=0 chnl=0
char id=76 x=228 y=188 width=24 height=31 xoffset=1 yoffset=4 xadvance=24 page=0 chnl=0
char id=77 x=252 y=188 width=33 height=31 xoffset=2 yoffset=4 xadvance=36 page=0 chnl=0
char id=78 x=285 y=188 width=29 height=31 xoffset=2 yoffset=4 xadvance=33 page=0 chnl=0
char id=79 x=156 y=121 width=34 height=33 xoffset=0 yoffset=3 xadvance=34 page=0 chnl=0
char id=80 x=314 y=188 width=27 height=31 xoffset=1 yoffset=4 xadvance=28 page=0 chnl=0
char id=81 x=190 y=121 width=34 height=33 xoffset=0 yoffset=3 xadvance=34 page=0 chnl=0
char id=82 x=341 y=188 width=28 height=31 xoffset=1 yoffset=4 xadvance=28 page=0 chnl=0
char id=83 x=224 y=121 width=27 height=33 xoffset=-1 yoffset=3 xadvance=27 page=0 chnl=0
char id=84 x=369 y=188 width=27 height=31 xoffset=0 yoffset=4 xadvance=27 page=0 chnl=0
char id=85 x=312 y=155 width=29 height=32 xoffset=1 yoffset=4 xadvance=32 page=0 chnl=0
char id=86 x=396 y=188 width=33 height=31 xoffset=-1 yoffset=4 xadvance=32 page=0 chnl=0
char id=87 x=429 y=188 width=47 height=31 xoffset=-1 yoffset=4 xadvance=45 page=0 chnl=0
char id=88 x=476 y=188 width=32 height=31 xoffset=-1 yoffset=4 xadvance=30 page=0 chnl=0
char id=89 x=0 y=220 width=31 height=31 xoffset=-1 yoffset=4 xadvance=29 page=0 chnl=0
char id=90 x=31 y=220 width=27 height=31 xoffset=0 yoffset=4 xadvance=28 page=0 chnl=0
char id=91 x=453 y=44 width=15 height=38 xoffset=1 yoffset=3 xadvance=16 page=0 chnl=0
char id=92 x=25 y=84 width=25 height=37 xoffset=-2 yoffset=1 xadvance=19 page=0 chnl=0
char id=93 x=468 y=44 width=15 height=38 xoffset=0 yoffset=3 xadvance=16 page=0 chnl=0
char id=94 x=426 y=251 width=20 height=14 xoffset=0 yoffset=4 xadvance=21 page=0 chnl=0
char id=95 x=47 y=277 width=28 height=6 xoffset=-2 yoffset=36 xadvance=25 page=0 chnl=0
char id=96 x=486 y=251 width=14 height=9 xoffset=1 yoffset=2 xadvance=16 page=0 chnl=0
char id=97 x=333 y=220 width=23 height=26 xoffset=0 yoffset=10 xadvance=24 page=0 chnl=0
char id=98 x=251 y=121 width=27 height=33 xoffset=1 yoffset=3 xadvance=28 page=0 chnl=0
char id=99 x=356 y=220 width=23 height=26 xoffset=0 yoffset=10 xadvance=23 page=0 chnl=0
char id=100 x=278 y=121 width=27 height=33 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=0
char id=101 x=379 y=220 width=25 height=26 xoffset=0 yoffset=10 xadvance=25 page=0 chnl=0
char id=102 x=305 y=121 width=17 height=33 xoffset=0 yoffset=2 xadvance=16 page=0 chnl=0
char id=103 x=322 y=121 width=26 height=33 xoffset=0 yoffset=10 xadvance=27 page=0 chnl=0
char id=104 x=341 y=155 width=24 height=32 xoffset=1 yoffset=3 xadvance=26 page=0 chnl=0
char id=105 x=312 y=84 width=10 height=34 xoffset=1 yoffset=1 xadvance=11 page=0 chnl=0
char id=106 x=50 y=0 width=17 height=42 xoffset=-4 yoffset=1 xadvance=11 page=0 chnl=0
char id=107 x=365 y=155 width=24 height=32 xoffset=1 yoffset=3 xadvance=24 page=0 chnl=0
char id=108 x=499 y=84 width=9 height=32 xoffset=1 yoffset=3 xadvance=11 page=0 chnl=0
char id=109 x=27 y=251 width=37 height=25 xoffset=1 yoffset=10 xadvance=39 page=0 chnl=0
char id=110 x=64 y=251 width=24 height=25 xoffset=1 yoffset=10 xadvance=26 page=0 chnl=0
char id=111 x=404 y=220 width=27 height=26 xoffset=0 yoffset=10 xadvance=27 page=0 chnl=0
char id=112 x=348 y=121 width=27 height=33 xoffset=1 yoffset=10 xadvance=28 page=0 chnl=0
char id=113 x=375 y=121 width=27 height=33 xoffset=0 yoffset=10 xadvance=28 page=0 chnl=0
char id=114 x=491 y=220 width=17 height=25 xoffset=1 yoffset=10 xadvance=17 page=0 chnl=0
char id=115 x=431 y=220 width=21 height=26 xoffset=0 yoffset=10 xadvance=21 page=0 chnl=0
char id=116 x=58 y=220 width=17 height=31 xoffset=0 yoffset=5 xadvance=17 page=0 chnl=0
char id=117 x=88 y=251 width=24 height=25 xoffset=1 yoffset=11 xadvance=26 page=0 chnl=0
char id=118 x=122 y=251 width=27 height=24 xoffset=-1 yoffset=11 xadvance=25 page=0 chnl=0
char id=119 x=149 y=251 width=37 height=24 xoffset=-1 yoffset=11 xadvance=35 page=0 chnl=0
char id=120 x=186 y=251 width=26 height=24 xoffset=-1 yoffset=11 xadvance=24 page=0 chnl=0
char id=121 x=389 y=155 width=27 height=32 xoffset=-1 yoffset=11 xadvance=25 page=0 chnl=0
char id=122 x=212 y=251 width=22 height=24 xoffset=0 yoffset=11 xadvance=22 page=0 chnl=0
char id=123 x=392 y=44 width=17 height=39 xoffset=0 yoffset=3 xadvance=17 page=0 chnl=0
char id=124 x=503 y=0 width=7 height=37 xoffset=3 yoffset=1 xadvance=13 page=0 chnl=0
char id=125 x=409 y=44 width=17 height=39 xoffset=0 yoffset=3 xadvance=17 page=0 chnl=0
char id=126 x=468 y=251 width=18 height=10 xoffset=0 yoffset=14 xadvance=19 page=0 chnl=0
char id=161 x=478 y=155 width=11 height=32 xoffset=1 yoffset=10 xadvance=13 page=0 chnl=0
char id=162 x=173 y=220 width=23 height=31 xoffset=0 yoffset=8 xadvance=23 page=0 chnl=0
char id=163 x=0 y=188 width=28 height=32 xoffset=0 yoffset=3 xadvance=27 page=0 chnl=0
char id=165 x=196 y=220 width=31 height=31 xoffset=-1 yoffset=4 xadvance=29 page=0 chnl=0
char id=168 x=29 y=277 width=18 height=8 xoffset=1 yoffset=3 xadvance=20 page=0 chnl=0
char id=175 x=75 y=277 width=18 height=6 xoffset=1 yoffset=5 xadvance=20 page=0 chnl=0
char id=180 x=0 y=277 width=14 height=9 xoffset=1 yoffset=2 xadvance=16 page=0 chnl=0
char id=184 x=446 y=251 width=12 height=11 xoffset=1 yoffset=32 xadvance=14 page=0 chnl=0
char id=191 x=86 y=155 width=22 height=33 xoffset=0 yoffset=10 xadvance=21 page=0 chnl=0
char id=192 x=437 y=0 width=33 height=40 xoffset=-1 yoffset=-5 xadvance=32 page=0 chnl=0
char id=193 x=470 y=0 width=33 height=40 xoffset=-1 yoffset=-5 xadvance=32 page=0 chnl=0
char id=194 x=0 y=44 width=33 height=40 xoffset=-1 yoffset=-5 xadvance=32 page=0 chnl=0
char id=195 x=33 y=44 width=33 height=40 xoffset=-1 yoffset=-5 xadvance=32 page=0 chnl=0
char id=196 x=66 y=44 width=33 height=40 xoffset=-1 yoffset=-5 xadvance=32 page=0 chnl=0
char id=197 x=17 y=0 width=33 height=43 xoffset=-1 yoffset=-8 xadvance=32 page=0 chnl=0
char id=198 x=227 y=220 width=46 height=31 xoffset=-1 yoffset=4 xadvance=45 page=0 chnl=0
char id=199 x=169 y=0 width=30 height=41 xoffset=0 yoffset=3 xadvance=29 page=0 chnl=0
char id=200 x=99 y=44 width=26 height=40 xoffset=1 yoffset=-5 xadvance=27 page=0 chnl=0
char id=201 x=125 y=44 width=26 height=40 xoffset=1 yoffset=-5 xadvance=27 page=0 chnl=0
char id=202 x=151 y=44 width=26 height=40 xoffset=1 yoffset=-5 xadvance=27 page=0 chnl=0
char id=203 x=177 y=44 width=26 height=40 xoffset=1 yoffset=-5 xadvance=27 page=0 chnl=0
char id=204 x=203 y=44 width=17 height=40 xoffset=-4 yoffset=-5 xadvance=12 page=0 chnl=0
char id=205 x=220 y=44 width=17 height=40 xoffset=1 yoffset=-5 xadvance=12 page=0 chnl=0
char id=206 x=237 y=44 width=18 height=40 xoffset=-2 yoffset=-5 xadvance=12 page=0 chnl=0
char id=207 x=255 y=44 width=20 height=40 xoffset=-3 yoffset=-5 xadvance=12 page=0 chnl=0
char id=208 x=273 y=220 width=33 height=31 xoffset=0 yoffset=4 xadvance=34 page=0 chnl=0
char id=209 x=275 y=44 width=29 height=40 xoffset=2 yoffset=-5 xadvance=33 page=0 chnl=0
char id=210 x=67 y=0 width=34 height=42 xoffset=0 yoffset=-6 xadvance=34 page=0 chnl=0
char id=211 x=101 y=0 width=34 height=42 xoffset=0 yoffset=-6 xadvance=34 page=0 chnl=0
char id=212 x=135 y=0 width=34 height=42 xoffset=0 yoffset=-6 xadvance=34 page=0 chnl=0
char id=213 x=199 y=0 width=34 height=41 xoffset=0 yoffset=-5 xadvance=34 page=0 chnl=0
char id=214 x=233 y=0 width=34 height=41 xoffset=0 yoffset=-5 xadvance=34 page=0 chnl=0
char id=215 x=325 y=251 width=21 height=21 xoffset=1 yoffset=9 xadvance=24 page=0 chnl=0
char id=216 x=108 y=155 width=34 height=33 xoffset=0 yoffset=3 xadvance=34 page=0 chnl=0
char id=217 x=267 y=0 width=29 height=41 xoffset=1 yoffset=-5 xadvance=32 page=0 chnl=0
char id=218 x=296 y=0 width=29 height=41 xoffset=1 yoffset=-5 xadvance=32 page=0 chnl=0
char id=219 x=325 y=0 width=29 height=41 xoffset=1 yoffset=-5 xadvance=32 page=0 chnl=0
char id=220 x=354 y=0 width=29 height=41 xoffset=1 yoffset=-5 xadvance=32 page=0 chnl=0
char id=221 x=304 y=44 width=31 height=40 xoffset=-1 yoffset=-5 xadvance=29 page=0 chnl=0
char id=222 x=306 y=220 width=27 height=31 xoffset=1 yoffset=4 xadvance=28 page=0 chnl=0
char id=223 x=142 y=155 width=25 height=33 xoffset=1 yoffset=2 xadvance=26 page=0 chnl=0
char id=224 x=87 y=84 width=23 height=35 xoffset=0 yoffset=1 xadvance=24 page=0 chnl=0
char id=225 x=110 y=84 width=23 height=35 xoffset=0 yoffset=1 xadvance=24 page=0 chnl=0
char id=226 x=133 y=84 width=23 height=35 xoffset=0 yoffset=1 xadvance=24 page=0 chnl=0
char id=227 x=351 y=84 width=23 height=34 xoffset=0 yoffset=2 xadvance=24 page=0 chnl=0
char id=228 x=374 y=84 width=23 height=34 xoffset=0 yoffset=2 xadvance=24 page=0 chnl=0
char id=229 x=483 y=44 width=23 height=38 xoffset=0 yoffset=-2 xadvance=24 page=0 chnl=0
char id=230 x=452 y=220 width=39 height=26 xoffset=0 yoffset=10 xadvance=39 page=0 chnl=0
char id=231 x=397 y=84 width=23 height=34 xoffset=0 yoffset=10 xadvance=23 page=0 chnl=0
char id=232 x=156 y=84 width=25 height=35 xoffset=0 yoffset=1 xadvance=25 page=0 chnl=0
char id=233 x=181 y=84 width=25 height=35 xoffset=0 yoffset=1 xadvance=25 page=0 chnl=0
char id=234 x=206 y=84 width=25 height=35 xoffset=0 yoffset=1 xadvance=25 page=0 chnl=0
char id=235 x=420 y=84 width=25 height=34 xoffset=0 yoffset=2 xadvance=25 page=0 chnl=0
char id=236 x=167 y=155 width=16 height=33 xoffset=-4 yoffset=2 xadvance=11 page=0 chnl=0
char id=237 x=183 y=155 width=16 height=33 xoffset=1 yoffset=2 xadvance=11 page=0 chnl=0
char id=238 x=199 y=155 width=19 height=33 xoffset=-3 yoffset=2 xadvance=11 page=0 chnl=0
char id=239 x=218 y=155 width=21 height=33 xoffset=-3 yoffset=2 xadvance=11 page=0 chnl=0
char id=240 x=239 y=155 width=26 height=33 xoffset=0 yoffset=3 xadvance=27 page=0 chnl=0
char id=241 x=265 y=155 width=24 height=33 xoffset=1 yoffset=2 xadvance=26 page=0 chnl=0
char id=242 x=231 y=84 width=27 height=35 xoffset=0 yoffset=1 xadvance=27 page=0 chnl=0
char id=243 x=258 y=84 width=27 height=35 xoffset=0 yoffset=1 xadvance=27 page=0 chnl=0
char id=244 x=285 y=84 width=27 height=35 xoffset=0 yoffset=1 xadvance=27 page=0 chnl=0
char id=245 x=445 y=84 width=27 height=34 xoffset=0 yoffset=2 xadvance=27 page=0 chnl=0
char id=246 x=472 y=84 width=27 height=34 xoffset=0 yoffset=2 xadvance=27 page=0 chnl=0
char id=247 x=279 y=251 width=23 height=24 xoffset=1 yoffset=8 xadvance=25 page=0 chnl=0
char id=248 x=0 y=251 width=27 height=26 xoffset=0 yoffset=10 xadvance=27 page=0 chnl=0
char id=249 x=0 y=121 width=24 height=34 xoffset=1 yoffset=2 xadvance=26 page=0 chnl=0
char id=250 x=24 y=121 width=24 height=34 xoffset=1 yoffset=2 xadvance=26 page=0 chnl=0
char id=251 x=48 y=121 width=24 height=34 xoffset=1 yoffset=2 xadvance=26 page=0 chnl=0
char id=252 x=72 y=121 width=24 height=34 xoffset=1 yoffset=2 xadvance=26 page=0 chnl=0
char id=253 x=383 y=0 width=27 height=41 xoffset=-1 yoffset=2 xadvance=25 page=0 chnl=0
char id=254 x=335 y=44 width=27 height=40 xoffset=1 yoffset=3 xadvance=28 page=0 chnl=0
char id=255 x=410 y=0 width=27 height=41 xoffset=-1 yoffset=2 xadvance=25 page=0 chnl=0
kernings count=370
kerning first=244 second=119 amount=-1
kerning first=86 second=225 amount=-2
kerning first=119 second=245 amount=-1
kerning first=253 second=243 amount=-1
kerning first=111 second=89 amount=-5
kerning first=248 second=86 amount=-3
kerning first=67 second=79 amount=-1
kerning first=84 second=211 amount=-1
kerning first=84 second=194 amount=-2
kerning first=221 second=235 amount=-5
kerning first=192 second=221 amount=-1
kerning first=121 second=44 amount=-4
kerning first=65 second=89 amount=-1
kerning first=75 second=216 amount=-1
kerning first=87 second=248 amount=-2
kerning first=89 second=242 amount=-5
kerning first=221 second=111 amount=-5
kerning first=233 second=221 amount=-5
kerning first=75 second=195 amount=1
kerning first=234 second=86 amount=-3
kerning first=121 second=233 amount=-1
kerning first=119 second=235 amount=-1
kerning first=111 second=119 amount=-1
kerning first=76 second=86 amount=-5
kerning first=246 second=221 amount=-5
kerning first=86 second=198 amount=-4
kerning first=118 second=242 amount=-1
kerning first=89 second=194 amount=-1
kerning first=92 second=92 amount=-6
kerning first=199 second=211 amount=-1
kerning first=119 second=111 amount=-1
kerning first=114 second=242 amount=-1
kerning first=86 second=232 amount=-3
kerning first=194 second=221 amount=-1
kerning first=89 second=101 amount=-5
kerning first=87 second=234 amount=-2
kerning first=192 second=86 amount=-4
kerning first=86 second=246 amount=-3
kerning first=233 second=86 amount=-3
kerning first=197 second=84 amount=-3
kerning first=92 second=47 amount=3
kerning first=75 second=193 amount=1
kerning first=118 second=101 amount=-1
kerning first=243 second=221 amount=-5
kerning first=245 second=87 amount=-2
kerning first=246 second=86 amount=-3
kerning first=84 second=197 amount=-2
kerning first=121 second=46 amount=-4
kerning first=193 second=221 amount=-1
kerning first=197 second=87 amount=-2
kerning first=194 second=86 amount=-4
kerning first=89 second=99 amount=-3
kerning first=87 second=231 amount=-2
kerning first=235 second=87 amount=-2
kerning first=195 second=71 amount=-1
kerning first=99 second=89 amount=-5
kerning first=89 second=197 amount=-1
kerning first=121 second=244 amount=-1
kerning first=221 second=196 amount=-1
kerning first=243 second=86 amount=-3
kerning first=68 second=196 amount=-2
kerning first=84 second=65 amount=-2
kerning first=221 second=233 amount=-5
kerning first=86 second=245 amount=-3
kerning first=119 second=44 amount=-3
kerning first=75 second=210 amount=-1
kerning first=89 second=243 amount=-5
kerning first=193 second=86 amount=-4
kerning first=87 second=242 amount=-2
kerning first=231 second=221 amount=-5
kerning first=255 second=232 amount=-1
kerning first=230 second=89 amount=-5
kerning first=196 second=84 amount=-3
kerning first=119 second=233 amount=-1
kerning first=255 second=246 amount=-1
kerning first=89 second=65 amount=-1
kerning first=118 second=243 amount=-1
kerning first=242 second=87 amount=-2
kerning first=87 second=194 amount=-2
kerning first=118 second=228 amount=-1
kerning first=114 second=243 amount=-1
kerning first=86 second=235 amount=-3
kerning first=87 second=101 amount=-2
kerning first=196 second=87 amount=-2
kerning first=230 second=119 amount=-1
kerning first=213 second=87 amount=-1
kerning first=86 second=111 amount=-3
kerning first=253 second=232 amount=-1
kerning first=101 second=87 amount=-2
kerning first=192 second=71 amount=-1
kerning first=245 second=118 amount=-1
kerning first=231 second=86 amount=-3
kerning first=121 second=248 amount=-1
kerning first=86 second=226 amount=-2
kerning first=221 second=195 amount=-1
kerning first=253 second=246 amount=-1
kerning first=67 second=212 amount=-1
kerning first=68 second=195 amount=-2
kerning first=84 second=214 amount=-1
kerning first=244 second=87 amount=-2
kerning first=84 second=192 amount=-2
kerning first=232 second=89 amount=-5
kerning first=119 second=46 amount=-3
kerning first=221 second=244 amount=-5
kerning first=47 second=47 amount=-6
kerning first=87 second=99 amount=-2
kerning first=121 second=234 amount=-1
kerning first=194 second=71 amount=-1
kerning first=65 second=84 amount=-3
kerning first=255 second=245 amount=-1
kerning first=89 second=192 amount=-1
kerning first=87 second=197 amount=-2
kerning first=199 second=214 amount=-1
kerning first=119 second=244 amount=-1
kerning first=221 second=193 amount=-1
kerning first=111 second=87 amount=-2
kerning first=118 second=227 amount=-1
kerning first=68 second=193 amount=-2
kerning first=195 second=89 amount=-1
kerning first=232 second=119 amount=-1
kerning first=82 second=89 amount=-2
kerning first=65 second=87 amount=-2
kerning first=75 second=211 amount=-1
kerning first=87 second=243 amount=-2
kerning first=210 second=87 amount=-1
kerning first=255 second=235 amount=-1
kerning first=86 second=229 amount=-2
kerning first=75 second=194 amount=1
kerning first=193 second=71 amount=-1
kerning first=242 second=118 amount=-1
kerning first=253 second=245 amount=-1
kerning first=248 second=89 amount=-5
kerning first=255 second=111 amount=-1
kerning first=67 second=216 amount=-1
kerning first=84 second=213 amount=-1
kerning first=86 second=196 amount=-4
kerning first=84 second=198 amount=-2
kerning first=87 second=65 amount=-2
kerning first=118 second=225 amount=-1
kerning first=221 second=248 amount=-5
kerning first=86 second=233 amount=-3
kerning first=234 second=89 amount=-5
kerning first=212 second=87 amount=-1
kerning first=248 second=119 amount=-1
kerning first=253 second=235 amount=-1
kerning first=244 second=118 amount=-1
kerning first=89 second=198 amount=-1
kerning first=199 second=213 amount=-1
kerning first=121 second=242 amount=-1
kerning first=86 second=97 amount=-2
kerning first=119 second=248 amount=-1
kerning first=253 second=111 amount=-1
kerning first=84 second=79 amount=-1
kerning first=89 second=232 amount=-5
kerning first=221 second=234 amount=-5
kerning first=192 second=89 amount=-1
kerning first=234 second=119 amount=-1
kerning first=89 second=246 amount=-5
kerning first=233 second=89 amount=-5
kerning first=75 second=197 amount=1
kerning first=79 second=87 amount=-1
kerning first=118 second=232 amount=-1
kerning first=121 second=101 amount=-1
kerning first=119 second=234 amount=-1
kerning first=99 second=87 amount=-2
kerning first=245 second=221 amount=-5
kerning first=111 second=118 amount=-1
kerning first=246 second=89 amount=-5
kerning first=86 second=195 amount=-4
kerning first=118 second=246 amount=-1
kerning first=87 second=192 amount=-2
kerning first=199 second=79 amount=-1
kerning first=197 second=221 amount=-1
kerning first=114 second=246 amount=-1
kerning first=194 second=89 amount=-1
kerning first=233 second=119 amount=-1
kerning first=255 second=44 amount=-4
kerning first=221 second=231 amount=-3
kerning first=235 second=221 amount=-5
kerning first=86 second=244 amount=-3
kerning first=255 second=233 amount=-1
kerning first=86 second=224 amount=-2
kerning first=246 second=119 amount=-1
kerning first=75 second=65 amount=1
kerning first=230 second=87 amount=-2
kerning first=243 second=89 amount=-5
kerning first=67 second=210 amount=-1
kerning first=245 second=86 amount=-3
kerning first=86 second=193 amount=-4
kerning first=89 second=245 amount=-5
kerning first=193 second=89 amount=-1
kerning first=253 second=44 amount=-4
kerning first=197 second=86 amount=-4
kerning first=221 second=242 amount=-5
kerning first=235 second=86 amount=-3
kerning first=253 second=233 amount=-1
kerning first=243 second=119 amount=-1
kerning first=118 second=245 amount=-1
kerning first=242 second=221 amount=-5
kerning first=87 second=198 amount=-2
kerning first=121 second=243 amount=-1
kerning first=221 second=194 amount=-1
kerning first=119 second=242 amount=-1
kerning first=68 second=194 amount=-2
kerning first=114 second=245 amount=-1
kerning first=255 second=46 amount=-4
kerning first=89 second=235 amount=-5
kerning first=87 second=232 amount=-2
kerning first=196 second=221 amount=-1
kerning first=221 second=101 amount=-5
kerning first=86 second=248 amount=-3
kerning first=75 second=214 amount=-1
kerning first=101 second=221 amount=-5
kerning first=89 second=111 amount=-5
kerning first=87 second=246 amount=-2
kerning first=232 second=87 amount=-2
kerning first=231 second=89 amount=-5
kerning first=195 second=84 amount=-3
kerning first=86 second=230 amount=-2
kerning first=75 second=192 amount=1
kerning first=118 second=235 amount=-1
kerning first=119 second=101 amount=-1
kerning first=255 second=244 amount=-1
kerning first=244 second=221 amount=-5
kerning first=118 second=111 amount=-1
kerning first=242 second=86 amount=-3
kerning first=118 second=226 amount=-1
kerning first=253 second=46 amount=-4
kerning first=114 second=111 amount=-1
kerning first=86 second=234 amount=-3
kerning first=195 second=87 amount=-2
kerning first=196 second=86 amount=-4
kerning first=221 second=99 amount=-3
kerning first=101 second=86 amount=-3
kerning first=221 second=197 amount=-1
kerning first=253 second=244 amount=-1
kerning first=118 second=100 amount=-1
kerning first=111 second=221 amount=-5
kerning first=248 second=87 amount=-2
kerning first=67 second=211 amount=-1
kerning first=68 second=197 amount=-2
kerning first=84 second=212 amount=-1
kerning first=244 second=86 amount=-3
kerning first=76 second=84 amount=-1
kerning first=84 second=196 amount=-2
kerning first=65 second=221 amount=-1
kerning first=75 second=213 amount=-1
kerning first=87 second=245 amount=-2
kerning first=221 second=243 amount=-5
kerning first=86 second=231 amount=-3
kerning first=75 second=198 amount=1
kerning first=234 second=87 amount=-2
kerning first=197 second=71 amount=-1
kerning first=192 second=84 amount=-3
kerning first=255 second=248 amount=-1
kerning first=89 second=196 amount=-1
kerning first=199 second=212 amount=-1
kerning first=221 second=65 amount=-1
kerning first=119 second=243 amount=-1
kerning first=118 second=229 amount=-1
kerning first=111 second=86 amount=-3
kerning first=68 second=65 amount=-2
kerning first=89 second=233 amount=-5
kerning first=87 second=235 amount=-2
kerning first=192 second=87 amount=-2
kerning first=118 second=44 amount=-4
kerning first=65 second=86 amount=-4
kerning first=86 second=242 amount=-3
kerning first=75 second=79 amount=-1
kerning first=87 second=111 amount=-2
kerning first=233 second=87 amount=-2
kerning first=194 second=84 amount=-3
kerning first=253 second=248 amount=-1
kerning first=255 second=234 amount=-1
kerning first=118 second=233 amount=-1
kerning first=84 second=216 amount=-1
kerning first=246 second=87 amount=-2
kerning first=86 second=194 amount=-4
kerning first=84 second=195 amount=-2
kerning first=118 second=97 amount=-1
kerning first=86 second=101 amount=-3
kerning first=194 second=87 amount=-2
kerning first=216 second=87 amount=-1
kerning first=99 second=221 amount=-5
kerning first=121 second=232 amount=-1
kerning first=253 second=234 amount=-1
kerning first=196 second=71 amount=-1
kerning first=248 second=118 amount=-1
kerning first=193 second=84 amount=-3
kerning first=89 second=195 amount=-1
kerning first=199 second=216 amount=-1
kerning first=121 second=246 amount=-1
kerning first=221 second=192 amount=-1
kerning first=243 second=87 amount=-2
kerning first=68 second=192 amount=-2
kerning first=84 second=193 amount=-2
kerning first=118 second=46 amount=-4
kerning first=89 second=244 amount=-5
kerning first=193 second=87 amount=-2
kerning first=86 second=99 amount=-3
kerning first=230 second=221 amount=-5
kerning first=99 second=86 amount=-3
kerning first=255 second=242 amount=-1
kerning first=245 second=89 amount=-5
kerning first=86 second=197 amount=-4
kerning first=89 second=193 amount=-1
kerning first=87 second=196 amount=-2
kerning first=118 second=244 amount=-1
kerning first=118 second=224 amount=-1
kerning first=197 second=89 amount=-1
kerning first=114 second=244 amount=-1
kerning first=87 second=233 amount=-2
kerning first=235 second=89 amount=-5
kerning first=86 second=243 amount=-3
kerning first=214 second=87 amount=-1
kerning first=245 second=119 amount=-1
kerning first=255 second=101 amount=-1
kerning first=231 second=87 amount=-2
kerning first=246 second=118 amount=-1
kerning first=65 second=71 amount=-1
kerning first=86 second=228 amount=-2
kerning first=221 second=198 amount=-1
kerning first=121 second=245 amount=-1
kerning first=230 second=86 amount=-3
kerning first=253 second=242 amount=-1
kerning first=67 second=214 amount=-1
kerning first=68 second=198 amount=-2
kerning first=84 second=210 amount=-1
kerning first=86 second=65 amount=-4
kerning first=221 second=232 amount=-5
kerning first=235 second=119 amount=-1
kerning first=89 second=248 amount=-5
kerning first=232 second=221 amount=-5
kerning first=221 second=246 amount=-5
kerning first=211 second=87 amount=-1
kerning first=121 second=235 amount=-1
kerning first=119 second=232 amount=-1
kerning first=253 second=101 amount=-1
kerning first=243 second=118 amount=-1
kerning first=118 second=248 amount=-1
kerning first=242 second=89 amount=-5
kerning first=87 second=195 amount=-2
kerning first=199 second=210 amount=-1
kerning first=121 second=111 amount=-1
kerning first=119 second=246 amount=-1
kerning first=118 second=230 amount=-1
kerning first=114 second=248 amount=-1
kerning first=195 second=221 amount=-1
kerning first=89 second=234 amount=-5
kerning first=196 second=89 amount=-1
kerning first=82 second=221 amount=-2
kerning first=75 second=212 amount=-1
kerning first=101 second=89 amount=-5
kerning first=87 second=244 amount=-2
kerning first=232 second=86 amount=-3
kerning first=86 second=227 amount=-2
kerning first=75 second=196 amount=1
kerning first=242 second=119 amount=-1
kerning first=118 second=234 amount=-1
kerning first=248 second=221 amount=-5
kerning first=255 second=243 amount=-1
kerning first=67 second=213 amount=-1
kerning first=244 second=89 amount=-5
kerning first=86 second=192 amount=-4
kerning first=87 second=193 amount=-2
kerning first=221 second=245 amount=-5
kerning first=101 second=119 amount=-1
kerning first=195 second=86 amount=-4
kerning first=89 second=231 amount=-3
kerning first=234 second=221 amount=-5

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

View File

@@ -1,581 +0,0 @@
info face="Metropolis Bold" size=64 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2
common lineHeight=65 base=51 scaleW=512 scaleH=512 pages=2 packed=0
page id=0 file="Metropolis-Bold-641.png"
page id=1 file="Metropolis-Bold-642.png"
chars count=170
char id=0 x=0 y=0 width=24 height=66 xoffset=4 yoffset=-1 xadvance=32 page=0 chnl=0
char id=10 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=0 xadvance=0 page=0 chnl=0
char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=0 xadvance=18 page=0 chnl=0
char id=33 x=114 y=386 width=15 height=47 xoffset=2 yoffset=6 xadvance=20 page=0 chnl=0
char id=34 x=103 y=479 width=29 height=22 xoffset=2 yoffset=6 xadvance=33 page=0 chnl=0
char id=36 x=394 y=126 width=40 height=57 xoffset=0 yoffset=1 xadvance=41 page=0 chnl=0
char id=37 x=43 y=338 width=52 height=48 xoffset=1 yoffset=5 xadvance=54 page=0 chnl=0
char id=38 x=109 y=240 width=43 height=49 xoffset=0 yoffset=5 xadvance=43 page=0 chnl=0
char id=39 x=132 y=479 width=13 height=22 xoffset=2 yoffset=6 xadvance=18 page=0 chnl=0
char id=40 x=261 y=126 width=22 height=58 xoffset=2 yoffset=5 xadvance=25 page=0 chnl=0
char id=41 x=283 y=126 width=22 height=58 xoffset=1 yoffset=5 xadvance=25 page=0 chnl=0
char id=42 x=30 y=479 width=24 height=26 xoffset=1 yoffset=4 xadvance=25 page=0 chnl=0
char id=44 x=88 y=479 width=15 height=23 xoffset=2 yoffset=39 xadvance=19 page=0 chnl=0
char id=45 x=291 y=479 width=21 height=10 xoffset=1 yoffset=28 xadvance=23 page=0 chnl=0
char id=46 x=190 y=479 width=15 height=14 xoffset=2 yoffset=39 xadvance=19 page=0 chnl=0
char id=47 x=434 y=126 width=36 height=55 xoffset=-3 yoffset=2 xadvance=30 page=0 chnl=0
char id=48 x=0 y=338 width=43 height=48 xoffset=1 yoffset=5 xadvance=45 page=0 chnl=0
char id=50 x=40 y=386 width=37 height=47 xoffset=1 yoffset=5 xadvance=39 page=0 chnl=0
char id=51 x=319 y=290 width=38 height=48 xoffset=0 yoffset=5 xadvance=39 page=0 chnl=0
char id=53 x=77 y=386 width=37 height=47 xoffset=1 yoffset=6 xadvance=40 page=0 chnl=0
char id=54 x=357 y=290 width=39 height=48 xoffset=1 yoffset=5 xadvance=41 page=0 chnl=0
char id=56 x=396 y=290 width=38 height=48 xoffset=1 yoffset=5 xadvance=40 page=0 chnl=0
char id=57 x=434 y=290 width=39 height=48 xoffset=1 yoffset=5 xadvance=41 page=0 chnl=0
char id=58 x=495 y=433 width=15 height=37 xoffset=2 yoffset=16 xadvance=19 page=0 chnl=0
char id=59 x=489 y=386 width=15 height=46 xoffset=2 yoffset=16 xadvance=19 page=0 chnl=0
char id=61 x=54 y=479 width=34 height=25 xoffset=2 yoffset=17 xadvance=39 page=0 chnl=0
char id=63 x=473 y=290 width=32 height=48 xoffset=0 yoffset=5 xadvance=32 page=0 chnl=0
char id=64 x=34 y=185 width=54 height=53 xoffset=1 yoffset=7 xadvance=56 page=0 chnl=0
char id=65 x=183 y=386 width=50 height=46 xoffset=-1 yoffset=6 xadvance=48 page=0 chnl=0
char id=66 x=233 y=386 width=41 height=46 xoffset=3 yoffset=6 xadvance=45 page=0 chnl=0
char id=67 x=412 y=240 width=44 height=48 xoffset=1 yoffset=5 xadvance=45 page=0 chnl=0
char id=68 x=274 y=386 width=44 height=46 xoffset=3 yoffset=6 xadvance=49 page=0 chnl=0
char id=69 x=318 y=386 width=37 height=46 xoffset=3 yoffset=6 xadvance=41 page=0 chnl=0
char id=70 x=355 y=386 width=37 height=46 xoffset=3 yoffset=6 xadvance=41 page=0 chnl=0
char id=71 x=456 y=240 width=44 height=48 xoffset=1 yoffset=5 xadvance=48 page=0 chnl=0
char id=72 x=392 y=386 width=42 height=46 xoffset=3 yoffset=6 xadvance=48 page=0 chnl=0
char id=73 x=434 y=386 width=12 height=46 xoffset=3 yoffset=6 xadvance=18 page=0 chnl=0
char id=74 x=305 y=338 width=33 height=47 xoffset=-1 yoffset=6 xadvance=35 page=0 chnl=0
char id=75 x=446 y=386 width=43 height=46 xoffset=3 yoffset=6 xadvance=45 page=0 chnl=0
char id=76 x=0 y=433 width=34 height=46 xoffset=3 yoffset=6 xadvance=37 page=0 chnl=0
char id=77 x=34 y=433 width=49 height=46 xoffset=3 yoffset=6 xadvance=55 page=0 chnl=0
char id=78 x=83 y=433 width=43 height=46 xoffset=3 yoffset=6 xadvance=50 page=0 chnl=0
char id=79 x=0 y=290 width=50 height=48 xoffset=1 yoffset=5 xadvance=52 page=0 chnl=0
char id=80 x=126 y=433 width=39 height=46 xoffset=3 yoffset=6 xadvance=42 page=0 chnl=0
char id=81 x=50 y=290 width=50 height=48 xoffset=1 yoffset=5 xadvance=52 page=0 chnl=0
char id=82 x=165 y=433 width=40 height=46 xoffset=3 yoffset=6 xadvance=43 page=0 chnl=0
char id=83 x=100 y=290 width=40 height=48 xoffset=0 yoffset=5 xadvance=41 page=0 chnl=0
char id=84 x=205 y=433 width=39 height=46 xoffset=1 yoffset=6 xadvance=41 page=0 chnl=0
char id=85 x=338 y=338 width=43 height=47 xoffset=3 yoffset=6 xadvance=48 page=0 chnl=0
char id=86 x=244 y=433 width=50 height=46 xoffset=-1 yoffset=6 xadvance=48 page=0 chnl=0
char id=87 x=294 y=433 width=69 height=46 xoffset=0 yoffset=6 xadvance=69 page=0 chnl=0
char id=88 x=363 y=433 width=46 height=46 xoffset=0 yoffset=6 xadvance=46 page=0 chnl=0
char id=89 x=409 y=433 width=47 height=46 xoffset=-1 yoffset=6 xadvance=44 page=0 chnl=0
char id=90 x=456 y=433 width=39 height=46 xoffset=2 yoffset=6 xadvance=42 page=0 chnl=0
char id=91 x=305 y=126 width=20 height=58 xoffset=3 yoffset=4 xadvance=25 page=0 chnl=0
char id=92 x=470 y=126 width=36 height=55 xoffset=-2 yoffset=2 xadvance=30 page=0 chnl=0
char id=93 x=325 y=126 width=21 height=58 xoffset=1 yoffset=4 xadvance=25 page=0 chnl=0
char id=94 x=145 y=479 width=29 height=20 xoffset=1 yoffset=6 xadvance=31 page=0 chnl=0
char id=95 x=312 y=479 width=41 height=8 xoffset=-2 yoffset=54 xadvance=38 page=0 chnl=0
char id=96 x=230 y=479 width=18 height=12 xoffset=3 yoffset=3 xadvance=24 page=0 chnl=0
char id=98 x=140 y=290 width=38 height=48 xoffset=3 yoffset=5 xadvance=42 page=0 chnl=0
char id=100 x=178 y=290 width=39 height=48 xoffset=1 yoffset=5 xadvance=42 page=0 chnl=0
char id=102 x=217 y=290 width=25 height=48 xoffset=0 yoffset=4 xadvance=24 page=0 chnl=0
char id=103 x=381 y=338 width=38 height=47 xoffset=1 yoffset=16 xadvance=42 page=0 chnl=0
char id=104 x=419 y=338 width=35 height=47 xoffset=2 yoffset=5 xadvance=39 page=0 chnl=0
char id=105 x=88 y=185 width=13 height=50 xoffset=2 yoffset=2 xadvance=17 page=0 chnl=0
char id=106 x=74 y=0 width=23 height=62 xoffset=-5 yoffset=2 xadvance=17 page=0 chnl=0
char id=107 x=454 y=338 width=36 height=47 xoffset=2 yoffset=5 xadvance=37 page=0 chnl=0
char id=108 x=490 y=338 width=12 height=47 xoffset=3 yoffset=5 xadvance=17 page=0 chnl=0
char id=112 x=242 y=290 width=38 height=48 xoffset=3 yoffset=16 xadvance=42 page=0 chnl=0
char id=113 x=280 y=290 width=39 height=48 xoffset=1 yoffset=16 xadvance=42 page=0 chnl=0
char id=121 x=0 y=386 width=40 height=47 xoffset=-1 yoffset=17 xadvance=38 page=0 chnl=0
char id=123 x=346 y=126 width=24 height=58 xoffset=1 yoffset=5 xadvance=26 page=0 chnl=0
char id=124 x=500 y=66 width=9 height=55 xoffset=5 yoffset=2 xadvance=19 page=0 chnl=0
char id=125 x=370 y=126 width=24 height=58 xoffset=1 yoffset=5 xadvance=26 page=0 chnl=0
char id=126 x=205 y=479 width=25 height=13 xoffset=2 yoffset=21 xadvance=29 page=0 chnl=0
char id=161 x=129 y=386 width=14 height=47 xoffset=3 yoffset=16 xadvance=20 page=0 chnl=0
char id=163 x=143 y=386 width=40 height=47 xoffset=1 yoffset=5 xadvance=42 page=0 chnl=0
char id=168 x=266 y=479 width=25 height=11 xoffset=3 yoffset=4 xadvance=31 page=0 chnl=0
char id=175 x=353 y=479 width=25 height=8 xoffset=3 yoffset=7 xadvance=30 page=0 chnl=0
char id=180 x=248 y=479 width=18 height=12 xoffset=3 yoffset=3 xadvance=24 page=0 chnl=0
char id=184 x=174 y=479 width=16 height=16 xoffset=3 yoffset=49 xadvance=21 page=0 chnl=0
char id=191 x=95 y=338 width=33 height=48 xoffset=0 yoffset=16 xadvance=32 page=0 chnl=0
char id=192 x=423 y=0 width=50 height=60 xoffset=-1 yoffset=-8 xadvance=48 page=0 chnl=0
char id=193 x=0 y=66 width=50 height=60 xoffset=-1 yoffset=-8 xadvance=48 page=0 chnl=0
char id=194 x=400 y=66 width=50 height=59 xoffset=-1 yoffset=-7 xadvance=48 page=0 chnl=0
char id=195 x=450 y=66 width=50 height=59 xoffset=-1 yoffset=-7 xadvance=48 page=0 chnl=0
char id=196 x=0 y=126 width=50 height=59 xoffset=-1 yoffset=-7 xadvance=48 page=0 chnl=0
char id=197 x=24 y=0 width=50 height=65 xoffset=-1 yoffset=-13 xadvance=48 page=0 chnl=0
char id=199 x=50 y=66 width=44 height=60 xoffset=1 yoffset=5 xadvance=45 page=0 chnl=0
char id=200 x=473 y=0 width=37 height=60 xoffset=3 yoffset=-8 xadvance=41 page=0 chnl=0
char id=201 x=94 y=66 width=37 height=60 xoffset=3 yoffset=-8 xadvance=41 page=0 chnl=0
char id=202 x=50 y=126 width=37 height=59 xoffset=3 yoffset=-7 xadvance=41 page=0 chnl=0
char id=203 x=87 y=126 width=37 height=59 xoffset=3 yoffset=-7 xadvance=41 page=0 chnl=0
char id=204 x=131 y=66 width=23 height=60 xoffset=-5 yoffset=-8 xadvance=18 page=0 chnl=0
char id=205 x=154 y=66 width=23 height=60 xoffset=3 yoffset=-8 xadvance=18 page=0 chnl=0
char id=206 x=124 y=126 width=26 height=59 xoffset=-3 yoffset=-7 xadvance=18 page=0 chnl=0
char id=207 x=150 y=126 width=30 height=59 xoffset=-4 yoffset=-7 xadvance=18 page=0 chnl=0
char id=209 x=180 y=126 width=43 height=59 xoffset=3 yoffset=-7 xadvance=50 page=0 chnl=0
char id=210 x=97 y=0 width=50 height=61 xoffset=1 yoffset=-8 xadvance=52 page=0 chnl=0
char id=211 x=147 y=0 width=50 height=61 xoffset=1 yoffset=-8 xadvance=52 page=0 chnl=0
char id=212 x=197 y=0 width=50 height=61 xoffset=1 yoffset=-8 xadvance=52 page=0 chnl=0
char id=213 x=247 y=0 width=50 height=61 xoffset=1 yoffset=-8 xadvance=52 page=0 chnl=0
char id=214 x=177 y=66 width=50 height=60 xoffset=1 yoffset=-7 xadvance=52 page=0 chnl=0
char id=215 x=0 y=479 width=30 height=30 xoffset=3 yoffset=15 xadvance=36 page=0 chnl=0
char id=216 x=128 y=338 width=50 height=48 xoffset=1 yoffset=5 xadvance=52 page=0 chnl=0
char id=217 x=297 y=0 width=43 height=61 xoffset=3 yoffset=-8 xadvance=48 page=0 chnl=0
char id=218 x=340 y=0 width=43 height=61 xoffset=3 yoffset=-8 xadvance=48 page=0 chnl=0
char id=219 x=227 y=66 width=43 height=60 xoffset=3 yoffset=-7 xadvance=48 page=0 chnl=0
char id=220 x=270 y=66 width=43 height=60 xoffset=3 yoffset=-7 xadvance=48 page=0 chnl=0
char id=221 x=313 y=66 width=47 height=60 xoffset=-1 yoffset=-8 xadvance=44 page=0 chnl=0
char id=223 x=178 y=338 width=36 height=48 xoffset=3 yoffset=4 xadvance=39 page=0 chnl=0
char id=224 x=101 y=185 width=34 height=50 xoffset=1 yoffset=3 xadvance=37 page=0 chnl=0
char id=225 x=135 y=185 width=34 height=50 xoffset=1 yoffset=3 xadvance=37 page=0 chnl=0
char id=226 x=169 y=185 width=34 height=50 xoffset=1 yoffset=3 xadvance=37 page=0 chnl=0
char id=227 x=203 y=185 width=34 height=50 xoffset=1 yoffset=3 xadvance=37 page=0 chnl=0
char id=228 x=152 y=240 width=34 height=49 xoffset=1 yoffset=4 xadvance=37 page=0 chnl=0
char id=229 x=0 y=185 width=34 height=55 xoffset=1 yoffset=-2 xadvance=37 page=0 chnl=0
char id=231 x=186 y=240 width=34 height=49 xoffset=1 yoffset=16 xadvance=35 page=0 chnl=0
char id=232 x=237 y=185 width=36 height=50 xoffset=1 yoffset=3 xadvance=38 page=0 chnl=0
char id=233 x=273 y=185 width=36 height=50 xoffset=1 yoffset=3 xadvance=38 page=0 chnl=0
char id=234 x=309 y=185 width=36 height=50 xoffset=1 yoffset=3 xadvance=38 page=0 chnl=0
char id=235 x=220 y=240 width=36 height=49 xoffset=1 yoffset=4 xadvance=38 page=0 chnl=0
char id=236 x=256 y=240 width=23 height=49 xoffset=-5 yoffset=3 xadvance=17 page=0 chnl=0
char id=237 x=279 y=240 width=24 height=49 xoffset=3 yoffset=3 xadvance=17 page=0 chnl=0
char id=238 x=214 y=338 width=27 height=48 xoffset=-3 yoffset=4 xadvance=17 page=0 chnl=0
char id=239 x=241 y=338 width=29 height=48 xoffset=-4 yoffset=4 xadvance=17 page=0 chnl=0
char id=240 x=345 y=185 width=38 height=50 xoffset=1 yoffset=3 xadvance=40 page=0 chnl=0
char id=241 x=270 y=338 width=35 height=48 xoffset=2 yoffset=4 xadvance=39 page=0 chnl=0
char id=242 x=383 y=185 width=39 height=50 xoffset=1 yoffset=3 xadvance=41 page=0 chnl=0
char id=243 x=422 y=185 width=39 height=50 xoffset=1 yoffset=3 xadvance=41 page=0 chnl=0
char id=244 x=461 y=185 width=39 height=50 xoffset=1 yoffset=3 xadvance=41 page=0 chnl=0
char id=245 x=0 y=240 width=39 height=50 xoffset=1 yoffset=3 xadvance=41 page=0 chnl=0
char id=246 x=303 y=240 width=39 height=49 xoffset=1 yoffset=4 xadvance=41 page=0 chnl=0
char id=249 x=39 y=240 width=35 height=50 xoffset=2 yoffset=3 xadvance=39 page=0 chnl=0
char id=250 x=74 y=240 width=35 height=50 xoffset=2 yoffset=3 xadvance=39 page=0 chnl=0
char id=251 x=342 y=240 width=35 height=49 xoffset=2 yoffset=4 xadvance=39 page=0 chnl=0
char id=252 x=377 y=240 width=35 height=49 xoffset=2 yoffset=4 xadvance=39 page=0 chnl=0
char id=253 x=383 y=0 width=40 height=61 xoffset=-1 yoffset=3 xadvance=38 page=0 chnl=0
char id=254 x=223 y=126 width=38 height=59 xoffset=3 yoffset=5 xadvance=42 page=0 chnl=0
char id=255 x=360 y=66 width=40 height=60 xoffset=-1 yoffset=4 xadvance=38 page=0 chnl=0
char id=35 x=125 y=0 width=43 height=46 xoffset=0 yoffset=6 xadvance=43 page=1 chnl=0
char id=43 x=70 y=83 width=34 height=34 xoffset=2 yoffset=13 xadvance=39 page=1 chnl=0
char id=49 x=25 y=0 width=24 height=46 xoffset=-1 yoffset=6 xadvance=27 page=1 chnl=0
char id=52 x=49 y=0 width=41 height=46 xoffset=0 yoffset=6 xadvance=41 page=1 chnl=0
char id=55 x=90 y=0 width=35 height=46 xoffset=2 yoffset=6 xadvance=39 page=1 chnl=0
char id=60 x=349 y=46 width=33 height=36 xoffset=2 yoffset=11 xadvance=38 page=1 chnl=0
char id=62 x=382 y=46 width=33 height=36 xoffset=3 yoffset=11 xadvance=38 page=1 chnl=0
char id=97 x=406 y=0 width=34 height=37 xoffset=1 yoffset=16 xadvance=37 page=1 chnl=0
char id=99 x=440 y=0 width=34 height=37 xoffset=1 yoffset=16 xadvance=35 page=1 chnl=0
char id=101 x=474 y=0 width=36 height=37 xoffset=1 yoffset=16 xadvance=38 page=1 chnl=0
char id=109 x=201 y=46 width=55 height=36 xoffset=2 yoffset=16 xadvance=59 page=1 chnl=0
char id=110 x=256 y=46 width=35 height=36 xoffset=2 yoffset=16 xadvance=39 page=1 chnl=0
char id=111 x=0 y=46 width=39 height=37 xoffset=1 yoffset=16 xadvance=41 page=1 chnl=0
char id=114 x=291 y=46 width=23 height=36 xoffset=3 yoffset=16 xadvance=26 page=1 chnl=0
char id=115 x=39 y=46 width=31 height=37 xoffset=0 yoffset=16 xadvance=32 page=1 chnl=0
char id=116 x=0 y=0 width=25 height=46 xoffset=0 yoffset=7 xadvance=25 page=1 chnl=0
char id=117 x=314 y=46 width=35 height=36 xoffset=2 yoffset=17 xadvance=39 page=1 chnl=0
char id=118 x=415 y=46 width=40 height=35 xoffset=-1 yoffset=17 xadvance=39 page=1 chnl=0
char id=119 x=455 y=46 width=54 height=35 xoffset=0 yoffset=17 xadvance=54 page=1 chnl=0
char id=120 x=0 y=83 width=38 height=35 xoffset=-1 yoffset=17 xadvance=36 page=1 chnl=0
char id=122 x=38 y=83 width=32 height=35 xoffset=1 yoffset=17 xadvance=34 page=1 chnl=0
char id=162 x=168 y=0 width=34 height=46 xoffset=1 yoffset=12 xadvance=35 page=1 chnl=0
char id=165 x=202 y=0 width=47 height=46 xoffset=-1 yoffset=6 xadvance=44 page=1 chnl=0
char id=198 x=249 y=0 width=69 height=46 xoffset=-1 yoffset=6 xadvance=69 page=1 chnl=0
char id=208 x=318 y=0 width=49 height=46 xoffset=1 yoffset=6 xadvance=51 page=1 chnl=0
char id=222 x=367 y=0 width=39 height=46 xoffset=3 yoffset=6 xadvance=42 page=1 chnl=0
char id=230 x=70 y=46 width=58 height=37 xoffset=1 yoffset=16 xadvance=60 page=1 chnl=0
char id=247 x=128 y=46 width=34 height=37 xoffset=2 yoffset=11 xadvance=39 page=1 chnl=0
char id=248 x=162 y=46 width=39 height=37 xoffset=1 yoffset=16 xadvance=41 page=1 chnl=0
kernings count=405
kerning first=244 second=119 amount=-2
kerning first=86 second=225 amount=-2
kerning first=119 second=245 amount=-2
kerning first=253 second=243 amount=-2
kerning first=111 second=89 amount=-7
kerning first=248 second=86 amount=-4
kerning first=67 second=79 amount=-1
kerning first=84 second=211 amount=-2
kerning first=99 second=242 amount=-1
kerning first=84 second=194 amount=-3
kerning first=221 second=235 amount=-7
kerning first=192 second=221 amount=-2
kerning first=121 second=44 amount=-6
kerning first=65 second=89 amount=-2
kerning first=75 second=216 amount=-2
kerning first=87 second=248 amount=-3
kerning first=89 second=242 amount=-7
kerning first=221 second=111 amount=-7
kerning first=233 second=221 amount=-7
kerning first=246 second=255 amount=-1
kerning first=75 second=195 amount=2
kerning first=234 second=86 amount=-4
kerning first=121 second=233 amount=-1
kerning first=119 second=235 amount=-2
kerning first=111 second=119 amount=-2
kerning first=76 second=86 amount=-7
kerning first=246 second=221 amount=-7
kerning first=86 second=198 amount=-6
kerning first=118 second=242 amount=-2
kerning first=89 second=194 amount=-1
kerning first=92 second=92 amount=-8
kerning first=199 second=211 amount=-1
kerning first=119 second=111 amount=-2
kerning first=114 second=242 amount=-1
kerning first=86 second=232 amount=-4
kerning first=194 second=221 amount=-2
kerning first=89 second=101 amount=-7
kerning first=87 second=234 amount=-3
kerning first=192 second=86 amount=-6
kerning first=86 second=246 amount=-4
kerning first=243 second=255 amount=-1
kerning first=248 second=121 amount=-1
kerning first=233 second=86 amount=-4
kerning first=197 second=84 amount=-4
kerning first=92 second=47 amount=5
kerning first=75 second=193 amount=2
kerning first=118 second=101 amount=-2
kerning first=243 second=221 amount=-7
kerning first=245 second=87 amount=-3
kerning first=246 second=86 amount=-4
kerning first=84 second=197 amount=-3
kerning first=121 second=46 amount=-6
kerning first=193 second=221 amount=-2
kerning first=197 second=87 amount=-3
kerning first=194 second=86 amount=-6
kerning first=89 second=99 amount=-4
kerning first=87 second=231 amount=-3
kerning first=235 second=87 amount=-3
kerning first=195 second=71 amount=-1
kerning first=99 second=89 amount=-7
kerning first=89 second=197 amount=-1
kerning first=121 second=244 amount=-2
kerning first=221 second=196 amount=-1
kerning first=243 second=86 amount=-4
kerning first=68 second=196 amount=-3
kerning first=99 second=243 amount=-1
kerning first=84 second=65 amount=-3
kerning first=221 second=233 amount=-7
kerning first=86 second=245 amount=-4
kerning first=119 second=44 amount=-5
kerning first=75 second=210 amount=-2
kerning first=89 second=243 amount=-7
kerning first=193 second=86 amount=-6
kerning first=87 second=242 amount=-3
kerning first=231 second=221 amount=-7
kerning first=246 second=121 amount=-1
kerning first=245 second=253 amount=-1
kerning first=230 second=89 amount=-7
kerning first=255 second=232 amount=-1
kerning first=196 second=84 amount=-4
kerning first=119 second=233 amount=-2
kerning first=255 second=246 amount=-2
kerning first=89 second=65 amount=-1
kerning first=118 second=243 amount=-2
kerning first=242 second=87 amount=-3
kerning first=87 second=194 amount=-3
kerning first=231 second=244 amount=-1
kerning first=118 second=228 amount=-2
kerning first=114 second=243 amount=-1
kerning first=86 second=235 amount=-4
kerning first=87 second=101 amount=-3
kerning first=196 second=87 amount=-3
kerning first=230 second=119 amount=-2
kerning first=213 second=87 amount=-1
kerning first=86 second=111 amount=-4
kerning first=101 second=87 amount=-3
kerning first=243 second=121 amount=-1
kerning first=192 second=71 amount=-1
kerning first=245 second=118 amount=-2
kerning first=231 second=86 amount=-4
kerning first=253 second=232 amount=-1
kerning first=121 second=248 amount=-2
kerning first=86 second=226 amount=-2
kerning first=221 second=195 amount=-1
kerning first=253 second=246 amount=-2
kerning first=67 second=212 amount=-1
kerning first=68 second=195 amount=-3
kerning first=84 second=214 amount=-2
kerning first=244 second=87 amount=-3
kerning first=84 second=192 amount=-3
kerning first=232 second=89 amount=-7
kerning first=119 second=46 amount=-5
kerning first=221 second=244 amount=-7
kerning first=47 second=47 amount=-8
kerning first=87 second=99 amount=-3
kerning first=242 second=253 amount=-1
kerning first=121 second=234 amount=-1
kerning first=194 second=71 amount=-1
kerning first=65 second=84 amount=-4
kerning first=255 second=245 amount=-2
kerning first=89 second=192 amount=-1
kerning first=87 second=197 amount=-3
kerning first=199 second=214 amount=-1
kerning first=119 second=244 amount=-2
kerning first=221 second=193 amount=-1
kerning first=231 second=248 amount=-1
kerning first=111 second=87 amount=-3
kerning first=118 second=227 amount=-2
kerning first=68 second=193 amount=-3
kerning first=195 second=89 amount=-2
kerning first=232 second=119 amount=-2
kerning first=82 second=89 amount=-2
kerning first=65 second=87 amount=-3
kerning first=75 second=211 amount=-2
kerning first=87 second=243 amount=-3
kerning first=210 second=87 amount=-1
kerning first=244 second=253 amount=-1
kerning first=86 second=229 amount=-2
kerning first=75 second=194 amount=2
kerning first=193 second=71 amount=-1
kerning first=242 second=118 amount=-2
kerning first=253 second=245 amount=-2
kerning first=255 second=235 amount=-1
kerning first=248 second=89 amount=-7
kerning first=255 second=111 amount=-2
kerning first=67 second=216 amount=-1
kerning first=84 second=213 amount=-2
kerning first=86 second=196 amount=-6
kerning first=84 second=198 amount=-3
kerning first=87 second=65 amount=-3
kerning first=118 second=225 amount=-2
kerning first=221 second=248 amount=-7
kerning first=86 second=233 amount=-4
kerning first=234 second=89 amount=-7
kerning first=212 second=87 amount=-1
kerning first=111 second=253 amount=-1
kerning first=248 second=119 amount=-2
kerning first=253 second=235 amount=-1
kerning first=244 second=118 amount=-2
kerning first=89 second=198 amount=-1
kerning first=199 second=213 amount=-1
kerning first=121 second=242 amount=-2
kerning first=86 second=97 amount=-2
kerning first=119 second=248 amount=-2
kerning first=253 second=111 amount=-2
kerning first=84 second=79 amount=-2
kerning first=99 second=246 amount=-1
kerning first=89 second=232 amount=-7
kerning first=221 second=234 amount=-7
kerning first=192 second=89 amount=-2
kerning first=234 second=119 amount=-2
kerning first=89 second=246 amount=-7
kerning first=233 second=89 amount=-7
kerning first=245 second=255 amount=-1
kerning first=75 second=197 amount=2
kerning first=79 second=87 amount=-1
kerning first=118 second=232 amount=-2
kerning first=121 second=101 amount=-1
kerning first=119 second=234 amount=-2
kerning first=99 second=87 amount=-3
kerning first=245 second=221 amount=-7
kerning first=111 second=118 amount=-2
kerning first=246 second=89 amount=-7
kerning first=86 second=195 amount=-6
kerning first=118 second=246 amount=-2
kerning first=87 second=192 amount=-3
kerning first=199 second=79 amount=-1
kerning first=231 second=242 amount=-1
kerning first=197 second=221 amount=-2
kerning first=114 second=246 amount=-1
kerning first=194 second=89 amount=-2
kerning first=233 second=119 amount=-2
kerning first=255 second=44 amount=-6
kerning first=221 second=231 amount=-4
kerning first=235 second=221 amount=-7
kerning first=86 second=244 amount=-4
kerning first=255 second=233 amount=-1
kerning first=86 second=224 amount=-2
kerning first=246 second=119 amount=-2
kerning first=75 second=65 amount=2
kerning first=230 second=87 amount=-3
kerning first=243 second=89 amount=-7
kerning first=67 second=210 amount=-1
kerning first=245 second=86 amount=-4
kerning first=99 second=245 amount=-1
kerning first=86 second=193 amount=-6
kerning first=89 second=245 amount=-7
kerning first=193 second=89 amount=-2
kerning first=253 second=44 amount=-6
kerning first=197 second=86 amount=-6
kerning first=221 second=242 amount=-7
kerning first=242 second=255 amount=-1
kerning first=235 second=86 amount=-4
kerning first=253 second=233 amount=-1
kerning first=243 second=119 amount=-2
kerning first=118 second=245 amount=-2
kerning first=242 second=221 amount=-7
kerning first=87 second=198 amount=-3
kerning first=121 second=243 amount=-2
kerning first=221 second=194 amount=-1
kerning first=119 second=242 amount=-2
kerning first=68 second=194 amount=-3
kerning first=114 second=245 amount=-1
kerning first=99 second=111 amount=-1
kerning first=255 second=46 amount=-6
kerning first=89 second=235 amount=-7
kerning first=87 second=232 amount=-3
kerning first=196 second=221 amount=-2
kerning first=221 second=101 amount=-7
kerning first=86 second=248 amount=-4
kerning first=75 second=214 amount=-2
kerning first=101 second=221 amount=-7
kerning first=89 second=111 amount=-7
kerning first=87 second=246 amount=-3
kerning first=232 second=87 amount=-3
kerning first=244 second=255 amount=-1
kerning first=231 second=89 amount=-7
kerning first=245 second=121 amount=-1
kerning first=195 second=84 amount=-4
kerning first=86 second=230 amount=-2
kerning first=75 second=192 amount=2
kerning first=118 second=235 amount=-2
kerning first=119 second=101 amount=-2
kerning first=255 second=244 amount=-2
kerning first=244 second=221 amount=-7
kerning first=118 second=111 amount=-2
kerning first=242 second=86 amount=-4
kerning first=231 second=243 amount=-1
kerning first=118 second=226 amount=-2
kerning first=253 second=46 amount=-6
kerning first=114 second=111 amount=-1
kerning first=86 second=234 amount=-4
kerning first=195 second=87 amount=-3
kerning first=196 second=86 amount=-6
kerning first=221 second=99 amount=-4
kerning first=111 second=255 amount=-1
kerning first=101 second=86 amount=-4
kerning first=221 second=197 amount=-1
kerning first=253 second=244 amount=-2
kerning first=118 second=100 amount=-1
kerning first=111 second=221 amount=-7
kerning first=248 second=87 amount=-3
kerning first=67 second=211 amount=-1
kerning first=68 second=197 amount=-3
kerning first=84 second=212 amount=-2
kerning first=244 second=86 amount=-4
kerning first=76 second=84 amount=-1
kerning first=84 second=196 amount=-3
kerning first=65 second=221 amount=-2
kerning first=75 second=213 amount=-2
kerning first=87 second=245 amount=-3
kerning first=221 second=243 amount=-7
kerning first=86 second=231 amount=-4
kerning first=75 second=198 amount=2
kerning first=242 second=121 amount=-1
kerning first=234 second=87 amount=-3
kerning first=197 second=71 amount=-1
kerning first=192 second=84 amount=-4
kerning first=255 second=248 amount=-2
kerning first=89 second=196 amount=-1
kerning first=199 second=212 amount=-1
kerning first=221 second=65 amount=-1
kerning first=119 second=243 amount=-2
kerning first=118 second=229 amount=-2
kerning first=111 second=86 amount=-4
kerning first=68 second=65 amount=-3
kerning first=89 second=233 amount=-7
kerning first=87 second=235 amount=-3
kerning first=192 second=87 amount=-3
kerning first=118 second=44 amount=-6
kerning first=65 second=86 amount=-6
kerning first=86 second=242 amount=-4
kerning first=75 second=79 amount=-2
kerning first=87 second=111 amount=-3
kerning first=233 second=87 amount=-3
kerning first=244 second=121 amount=-1
kerning first=248 second=253 amount=-1
kerning first=194 second=84 amount=-4
kerning first=253 second=248 amount=-2
kerning first=118 second=233 amount=-2
kerning first=255 second=234 amount=-1
kerning first=84 second=216 amount=-2
kerning first=246 second=87 amount=-3
kerning first=86 second=194 amount=-6
kerning first=84 second=195 amount=-3
kerning first=118 second=97 amount=-2
kerning first=86 second=101 amount=-4
kerning first=194 second=87 amount=-3
kerning first=216 second=87 amount=-1
kerning first=99 second=221 amount=-7
kerning first=121 second=232 amount=-1
kerning first=111 second=121 amount=-1
kerning first=253 second=234 amount=-1
kerning first=196 second=71 amount=-1
kerning first=248 second=118 amount=-2
kerning first=193 second=84 amount=-4
kerning first=89 second=195 amount=-1
kerning first=199 second=216 amount=-1
kerning first=121 second=246 amount=-2
kerning first=221 second=192 amount=-1
kerning first=243 second=87 amount=-3
kerning first=68 second=192 amount=-3
kerning first=99 second=244 amount=-1
kerning first=84 second=193 amount=-3
kerning first=118 second=46 amount=-6
kerning first=89 second=244 amount=-7
kerning first=193 second=87 amount=-3
kerning first=246 second=253 amount=-1
kerning first=86 second=99 amount=-4
kerning first=230 second=221 amount=-7
kerning first=99 second=86 amount=-4
kerning first=255 second=242 amount=-2
kerning first=245 second=89 amount=-7
kerning first=86 second=197 amount=-6
kerning first=89 second=193 amount=-1
kerning first=87 second=196 amount=-3
kerning first=118 second=244 amount=-2
kerning first=231 second=246 amount=-1
kerning first=118 second=224 amount=-2
kerning first=197 second=89 amount=-2
kerning first=114 second=244 amount=-1
kerning first=87 second=233 amount=-3
kerning first=235 second=89 amount=-7
kerning first=86 second=243 amount=-4
kerning first=214 second=87 amount=-1
kerning first=245 second=119 amount=-2
kerning first=243 second=253 amount=-1
kerning first=231 second=87 amount=-3
kerning first=255 second=101 amount=-1
kerning first=246 second=118 amount=-2
kerning first=65 second=71 amount=-1
kerning first=86 second=228 amount=-2
kerning first=221 second=198 amount=-1
kerning first=121 second=245 amount=-2
kerning first=230 second=86 amount=-4
kerning first=253 second=242 amount=-2
kerning first=67 second=214 amount=-1
kerning first=68 second=198 amount=-3
kerning first=84 second=210 amount=-2
kerning first=99 second=248 amount=-1
kerning first=86 second=65 amount=-6
kerning first=221 second=232 amount=-7
kerning first=235 second=119 amount=-2
kerning first=89 second=248 amount=-7
kerning first=232 second=221 amount=-7
kerning first=221 second=246 amount=-7
kerning first=211 second=87 amount=-1
kerning first=121 second=235 amount=-1
kerning first=119 second=232 amount=-2
kerning first=253 second=101 amount=-1
kerning first=243 second=118 amount=-2
kerning first=118 second=248 amount=-2
kerning first=242 second=89 amount=-7
kerning first=87 second=195 amount=-3
kerning first=199 second=210 amount=-1
kerning first=121 second=111 amount=-2
kerning first=119 second=246 amount=-2
kerning first=231 second=245 amount=-1
kerning first=118 second=230 amount=-2
kerning first=114 second=248 amount=-1
kerning first=195 second=221 amount=-2
kerning first=89 second=234 amount=-7
kerning first=196 second=89 amount=-2
kerning first=82 second=221 amount=-2
kerning first=75 second=212 amount=-2
kerning first=101 second=89 amount=-7
kerning first=87 second=244 amount=-3
kerning first=232 second=86 amount=-4
kerning first=248 second=255 amount=-1
kerning first=86 second=227 amount=-2
kerning first=75 second=196 amount=2
kerning first=242 second=119 amount=-2
kerning first=118 second=234 amount=-2
kerning first=248 second=221 amount=-7
kerning first=255 second=243 amount=-2
kerning first=67 second=213 amount=-1
kerning first=244 second=89 amount=-7
kerning first=86 second=192 amount=-6
kerning first=87 second=193 amount=-3
kerning first=231 second=111 amount=-1
kerning first=221 second=245 amount=-7
kerning first=101 second=119 amount=-2
kerning first=195 second=86 amount=-6
kerning first=89 second=231 amount=-4
kerning first=234 second=221 amount=-7

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -1,550 +0,0 @@
info face="Metropolis-Regular" size=32 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2
common lineHeight=33 base=26 scaleW=512 scaleH=512 pages=1 packed=0
page id=0 file="Metropolis-Regular-32.png"
chars count=170
char id=0 x=0 y=0 width=14 height=35 xoffset=1 yoffset=-1 xadvance=16 page=0 chnl=0
char id=10 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=0 xadvance=0 page=0 chnl=0
char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=0 xadvance=9 page=0 chnl=0
char id=33 x=494 y=91 width=7 height=24 xoffset=1 yoffset=3 xadvance=9 page=0 chnl=0
char id=34 x=353 y=139 width=11 height=10 xoffset=1 yoffset=3 xadvance=13 page=0 chnl=0
char id=35 x=158 y=115 width=22 height=24 xoffset=0 yoffset=3 xadvance=22 page=0 chnl=0
char id=36 x=212 y=35 width=19 height=29 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0
char id=37 x=133 y=115 width=25 height=24 xoffset=0 yoffset=3 xadvance=25 page=0 chnl=0
char id=38 x=180 y=115 width=22 height=24 xoffset=0 yoffset=3 xadvance=21 page=0 chnl=0
char id=39 x=364 y=139 width=6 height=10 xoffset=1 yoffset=3 xadvance=7 page=0 chnl=0
char id=40 x=449 y=0 width=11 height=30 xoffset=0 yoffset=3 xadvance=11 page=0 chnl=0
char id=41 x=460 y=0 width=11 height=30 xoffset=0 yoffset=3 xadvance=11 page=0 chnl=0
char id=42 x=308 y=139 width=13 height=14 xoffset=0 yoffset=2 xadvance=13 page=0 chnl=0
char id=43 x=259 y=139 width=17 height=18 xoffset=1 yoffset=6 xadvance=19 page=0 chnl=0
char id=44 x=370 y=139 width=7 height=10 xoffset=1 yoffset=21 xadvance=8 page=0 chnl=0
char id=45 x=423 y=139 width=12 height=5 xoffset=0 yoffset=15 xadvance=12 page=0 chnl=0
char id=46 x=417 y=139 width=6 height=6 xoffset=1 yoffset=21 xadvance=8 page=0 chnl=0
char id=47 x=178 y=35 width=17 height=29 xoffset=-2 yoffset=1 xadvance=13 page=0 chnl=0
char id=48 x=94 y=115 width=22 height=24 xoffset=0 yoffset=3 xadvance=22 page=0 chnl=0
char id=49 x=427 y=91 width=11 height=24 xoffset=-1 yoffset=3 xadvance=11 page=0 chnl=0
char id=50 x=438 y=91 width=18 height=24 xoffset=0 yoffset=3 xadvance=19 page=0 chnl=0
char id=51 x=456 y=91 width=18 height=24 xoffset=0 yoffset=3 xadvance=19 page=0 chnl=0
char id=52 x=474 y=91 width=20 height=24 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=53 x=0 y=115 width=19 height=24 xoffset=0 yoffset=3 xadvance=19 page=0 chnl=0
char id=54 x=19 y=115 width=19 height=24 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=55 x=38 y=115 width=18 height=24 xoffset=0 yoffset=3 xadvance=19 page=0 chnl=0
char id=56 x=56 y=115 width=19 height=24 xoffset=0 yoffset=3 xadvance=19 page=0 chnl=0
char id=57 x=75 y=115 width=19 height=24 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=58 x=504 y=115 width=6 height=19 xoffset=1 yoffset=8 xadvance=8 page=0 chnl=0
char id=59 x=501 y=91 width=7 height=23 xoffset=1 yoffset=8 xadvance=8 page=0 chnl=0
char id=60 x=173 y=139 width=18 height=19 xoffset=0 yoffset=6 xadvance=19 page=0 chnl=0
char id=61 x=321 y=139 width=17 height=12 xoffset=1 yoffset=9 xadvance=19 page=0 chnl=0
char id=62 x=191 y=139 width=17 height=19 xoffset=1 yoffset=6 xadvance=19 page=0 chnl=0
char id=63 x=116 y=115 width=17 height=24 xoffset=-1 yoffset=3 xadvance=16 page=0 chnl=0
char id=64 x=257 y=35 width=28 height=28 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=0
char id=65 x=312 y=65 width=25 height=24 xoffset=0 yoffset=3 xadvance=24 page=0 chnl=0
char id=66 x=337 y=65 width=19 height=24 xoffset=2 yoffset=3 xadvance=22 page=0 chnl=0
char id=67 x=356 y=65 width=22 height=24 xoffset=0 yoffset=3 xadvance=22 page=0 chnl=0
char id=68 x=378 y=65 width=22 height=24 xoffset=2 yoffset=3 xadvance=24 page=0 chnl=0
char id=69 x=400 y=65 width=19 height=24 xoffset=1 yoffset=3 xadvance=20 page=0 chnl=0
char id=70 x=419 y=65 width=19 height=24 xoffset=1 yoffset=3 xadvance=19 page=0 chnl=0
char id=71 x=438 y=65 width=23 height=24 xoffset=0 yoffset=3 xadvance=24 page=0 chnl=0
char id=72 x=461 y=65 width=21 height=24 xoffset=1 yoffset=3 xadvance=23 page=0 chnl=0
char id=73 x=482 y=65 width=6 height=24 xoffset=1 yoffset=3 xadvance=8 page=0 chnl=0
char id=74 x=488 y=65 width=17 height=24 xoffset=-1 yoffset=3 xadvance=17 page=0 chnl=0
char id=75 x=0 y=91 width=21 height=24 xoffset=1 yoffset=3 xadvance=21 page=0 chnl=0
char id=76 x=21 y=91 width=17 height=24 xoffset=1 yoffset=3 xadvance=18 page=0 chnl=0
char id=77 x=38 y=91 width=24 height=24 xoffset=2 yoffset=3 xadvance=27 page=0 chnl=0
char id=78 x=62 y=91 width=21 height=24 xoffset=2 yoffset=3 xadvance=25 page=0 chnl=0
char id=79 x=83 y=91 width=26 height=24 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=0
char id=80 x=109 y=91 width=20 height=24 xoffset=1 yoffset=3 xadvance=21 page=0 chnl=0
char id=81 x=129 y=91 width=26 height=24 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=0
char id=82 x=155 y=91 width=20 height=24 xoffset=1 yoffset=3 xadvance=21 page=0 chnl=0
char id=83 x=17 y=65 width=19 height=25 xoffset=0 yoffset=2 xadvance=20 page=0 chnl=0
char id=84 x=175 y=91 width=20 height=24 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=85 x=195 y=91 width=22 height=24 xoffset=1 yoffset=3 xadvance=24 page=0 chnl=0
char id=86 x=217 y=91 width=25 height=24 xoffset=0 yoffset=3 xadvance=24 page=0 chnl=0
char id=87 x=242 y=91 width=35 height=24 xoffset=0 yoffset=3 xadvance=35 page=0 chnl=0
char id=88 x=277 y=91 width=23 height=24 xoffset=0 yoffset=3 xadvance=22 page=0 chnl=0
char id=89 x=300 y=91 width=23 height=24 xoffset=-1 yoffset=3 xadvance=21 page=0 chnl=0
char id=90 x=323 y=91 width=20 height=24 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=91 x=471 y=0 width=11 height=30 xoffset=1 yoffset=1 xadvance=12 page=0 chnl=0
char id=92 x=195 y=35 width=17 height=29 xoffset=-2 yoffset=1 xadvance=13 page=0 chnl=0
char id=93 x=482 y=0 width=11 height=30 xoffset=0 yoffset=1 xadvance=12 page=0 chnl=0
char id=94 x=338 y=139 width=15 height=11 xoffset=0 yoffset=3 xadvance=16 page=0 chnl=0
char id=95 x=435 y=139 width=22 height=5 xoffset=-2 yoffset=27 xadvance=19 page=0 chnl=0
char id=96 x=385 y=139 width=9 height=7 xoffset=1 yoffset=2 xadvance=10 page=0 chnl=0
char id=97 x=433 y=115 width=17 height=19 xoffset=0 yoffset=8 xadvance=18 page=0 chnl=0
char id=98 x=343 y=91 width=19 height=24 xoffset=1 yoffset=3 xadvance=20 page=0 chnl=0
char id=99 x=450 y=115 width=18 height=19 xoffset=0 yoffset=8 xadvance=17 page=0 chnl=0
char id=100 x=362 y=91 width=19 height=24 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=101 x=468 y=115 width=19 height=19 xoffset=0 yoffset=8 xadvance=19 page=0 chnl=0
char id=102 x=36 y=65 width=12 height=25 xoffset=0 yoffset=2 xadvance=11 page=0 chnl=0
char id=103 x=48 y=65 width=19 height=25 xoffset=0 yoffset=8 xadvance=20 page=0 chnl=0
char id=104 x=381 y=91 width=17 height=24 xoffset=1 yoffset=3 xadvance=19 page=0 chnl=0
char id=105 x=302 y=35 width=6 height=26 xoffset=1 yoffset=1 xadvance=7 page=0 chnl=0
char id=106 x=39 y=0 width=11 height=32 xoffset=-3 yoffset=1 xadvance=7 page=0 chnl=0
char id=107 x=398 y=91 width=17 height=24 xoffset=1 yoffset=3 xadvance=17 page=0 chnl=0
char id=108 x=505 y=65 width=5 height=24 xoffset=1 yoffset=3 xadvance=7 page=0 chnl=0
char id=109 x=0 y=139 width=27 height=19 xoffset=1 yoffset=8 xadvance=29 page=0 chnl=0
char id=110 x=487 y=115 width=17 height=19 xoffset=1 yoffset=8 xadvance=19 page=0 chnl=0
char id=111 x=27 y=139 width=20 height=19 xoffset=0 yoffset=8 xadvance=20 page=0 chnl=0
char id=112 x=67 y=65 width=19 height=25 xoffset=1 yoffset=8 xadvance=20 page=0 chnl=0
char id=113 x=86 y=65 width=19 height=25 xoffset=0 yoffset=8 xadvance=20 page=0 chnl=0
char id=114 x=47 y=139 width=12 height=19 xoffset=1 yoffset=8 xadvance=12 page=0 chnl=0
char id=115 x=59 y=139 width=16 height=19 xoffset=0 yoffset=8 xadvance=16 page=0 chnl=0
char id=116 x=415 y=91 width=12 height=24 xoffset=0 yoffset=3 xadvance=12 page=0 chnl=0
char id=117 x=75 y=139 width=17 height=19 xoffset=1 yoffset=8 xadvance=19 page=0 chnl=0
char id=118 x=92 y=139 width=20 height=19 xoffset=-1 yoffset=8 xadvance=18 page=0 chnl=0
char id=119 x=112 y=139 width=27 height=19 xoffset=0 yoffset=8 xadvance=27 page=0 chnl=0
char id=120 x=139 y=139 width=18 height=19 xoffset=0 yoffset=8 xadvance=18 page=0 chnl=0
char id=121 x=105 y=65 width=20 height=25 xoffset=-1 yoffset=8 xadvance=19 page=0 chnl=0
char id=122 x=157 y=139 width=16 height=19 xoffset=0 yoffset=8 xadvance=16 page=0 chnl=0
char id=123 x=493 y=0 width=13 height=30 xoffset=0 yoffset=3 xadvance=13 page=0 chnl=0
char id=124 x=506 y=0 width=5 height=29 xoffset=2 yoffset=1 xadvance=9 page=0 chnl=0
char id=125 x=0 y=35 width=13 height=30 xoffset=0 yoffset=3 xadvance=13 page=0 chnl=0
char id=126 x=394 y=139 width=14 height=7 xoffset=0 yoffset=11 xadvance=14 page=0 chnl=0
char id=161 x=125 y=65 width=7 height=25 xoffset=1 yoffset=8 xadvance=9 page=0 chnl=0
char id=162 x=132 y=65 width=18 height=25 xoffset=0 yoffset=5 xadvance=17 page=0 chnl=0
char id=163 x=202 y=115 width=20 height=24 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=165 x=222 y=115 width=23 height=24 xoffset=-1 yoffset=3 xadvance=21 page=0 chnl=0
char id=168 x=457 y=139 width=12 height=5 xoffset=1 yoffset=3 xadvance=13 page=0 chnl=0
char id=175 x=469 y=139 width=12 height=4 xoffset=1 yoffset=4 xadvance=14 page=0 chnl=0
char id=180 x=408 y=139 width=9 height=7 xoffset=1 yoffset=2 xadvance=10 page=0 chnl=0
char id=184 x=377 y=139 width=8 height=9 xoffset=1 yoffset=24 xadvance=10 page=0 chnl=0
char id=191 x=150 y=65 width=17 height=25 xoffset=0 yoffset=8 xadvance=16 page=0 chnl=0
char id=192 x=70 y=0 width=25 height=31 xoffset=0 yoffset=-4 xadvance=24 page=0 chnl=0
char id=193 x=95 y=0 width=25 height=31 xoffset=0 yoffset=-4 xadvance=24 page=0 chnl=0
char id=194 x=120 y=0 width=25 height=31 xoffset=0 yoffset=-4 xadvance=24 page=0 chnl=0
char id=195 x=145 y=0 width=25 height=31 xoffset=0 yoffset=-4 xadvance=24 page=0 chnl=0
char id=196 x=13 y=35 width=25 height=30 xoffset=0 yoffset=-3 xadvance=24 page=0 chnl=0
char id=197 x=14 y=0 width=25 height=33 xoffset=0 yoffset=-6 xadvance=24 page=0 chnl=0
char id=198 x=245 y=115 width=32 height=24 xoffset=0 yoffset=3 xadvance=33 page=0 chnl=0
char id=199 x=38 y=35 width=22 height=30 xoffset=0 yoffset=3 xadvance=22 page=0 chnl=0
char id=200 x=170 y=0 width=19 height=31 xoffset=1 yoffset=-4 xadvance=20 page=0 chnl=0
char id=201 x=189 y=0 width=19 height=31 xoffset=1 yoffset=-4 xadvance=20 page=0 chnl=0
char id=202 x=208 y=0 width=19 height=31 xoffset=1 yoffset=-4 xadvance=20 page=0 chnl=0
char id=203 x=60 y=35 width=19 height=30 xoffset=1 yoffset=-3 xadvance=20 page=0 chnl=0
char id=204 x=227 y=0 width=11 height=31 xoffset=-3 yoffset=-4 xadvance=8 page=0 chnl=0
char id=205 x=238 y=0 width=11 height=31 xoffset=1 yoffset=-4 xadvance=8 page=0 chnl=0
char id=206 x=249 y=0 width=12 height=31 xoffset=-2 yoffset=-4 xadvance=8 page=0 chnl=0
char id=207 x=79 y=35 width=12 height=30 xoffset=-2 yoffset=-3 xadvance=8 page=0 chnl=0
char id=208 x=277 y=115 width=24 height=24 xoffset=0 yoffset=3 xadvance=25 page=0 chnl=0
char id=209 x=261 y=0 width=21 height=31 xoffset=2 yoffset=-4 xadvance=25 page=0 chnl=0
char id=210 x=282 y=0 width=26 height=31 xoffset=0 yoffset=-4 xadvance=26 page=0 chnl=0
char id=211 x=308 y=0 width=26 height=31 xoffset=0 yoffset=-4 xadvance=26 page=0 chnl=0
char id=212 x=91 y=35 width=26 height=30 xoffset=0 yoffset=-3 xadvance=26 page=0 chnl=0
char id=213 x=334 y=0 width=26 height=31 xoffset=0 yoffset=-4 xadvance=26 page=0 chnl=0
char id=214 x=231 y=35 width=26 height=29 xoffset=0 yoffset=-2 xadvance=26 page=0 chnl=0
char id=215 x=293 y=139 width=15 height=15 xoffset=1 yoffset=8 xadvance=17 page=0 chnl=0
char id=216 x=301 y=115 width=26 height=24 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=0
char id=217 x=360 y=0 width=22 height=31 xoffset=1 yoffset=-4 xadvance=24 page=0 chnl=0
char id=218 x=382 y=0 width=22 height=31 xoffset=1 yoffset=-4 xadvance=24 page=0 chnl=0
char id=219 x=404 y=0 width=22 height=31 xoffset=1 yoffset=-4 xadvance=24 page=0 chnl=0
char id=220 x=117 y=35 width=22 height=30 xoffset=1 yoffset=-3 xadvance=24 page=0 chnl=0
char id=221 x=426 y=0 width=23 height=31 xoffset=-1 yoffset=-4 xadvance=21 page=0 chnl=0
char id=222 x=327 y=115 width=20 height=24 xoffset=1 yoffset=3 xadvance=21 page=0 chnl=0
char id=223 x=167 y=65 width=17 height=25 xoffset=1 yoffset=2 xadvance=18 page=0 chnl=0
char id=224 x=308 y=35 width=17 height=26 xoffset=0 yoffset=1 xadvance=18 page=0 chnl=0
char id=225 x=325 y=35 width=17 height=26 xoffset=0 yoffset=1 xadvance=18 page=0 chnl=0
char id=226 x=184 y=65 width=17 height=25 xoffset=0 yoffset=2 xadvance=18 page=0 chnl=0
char id=227 x=201 y=65 width=17 height=25 xoffset=0 yoffset=2 xadvance=18 page=0 chnl=0
char id=228 x=347 y=115 width=17 height=24 xoffset=0 yoffset=3 xadvance=18 page=0 chnl=0
char id=229 x=285 y=35 width=17 height=28 xoffset=0 yoffset=-1 xadvance=18 page=0 chnl=0
char id=230 x=208 y=139 width=31 height=19 xoffset=0 yoffset=8 xadvance=31 page=0 chnl=0
char id=231 x=218 y=65 width=18 height=25 xoffset=0 yoffset=8 xadvance=17 page=0 chnl=0
char id=232 x=342 y=35 width=19 height=26 xoffset=0 yoffset=1 xadvance=19 page=0 chnl=0
char id=233 x=361 y=35 width=19 height=26 xoffset=0 yoffset=1 xadvance=19 page=0 chnl=0
char id=234 x=236 y=65 width=19 height=25 xoffset=0 yoffset=2 xadvance=19 page=0 chnl=0
char id=235 x=364 y=115 width=19 height=24 xoffset=0 yoffset=3 xadvance=19 page=0 chnl=0
char id=236 x=380 y=35 width=10 height=26 xoffset=-3 yoffset=1 xadvance=7 page=0 chnl=0
char id=237 x=390 y=35 width=12 height=26 xoffset=1 yoffset=1 xadvance=7 page=0 chnl=0
char id=238 x=402 y=35 width=12 height=26 xoffset=-2 yoffset=1 xadvance=7 page=0 chnl=0
char id=239 x=383 y=115 width=13 height=24 xoffset=-2 yoffset=3 xadvance=7 page=0 chnl=0
char id=240 x=414 y=35 width=20 height=26 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0
char id=241 x=255 y=65 width=17 height=25 xoffset=1 yoffset=2 xadvance=19 page=0 chnl=0
char id=242 x=434 y=35 width=20 height=26 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0
char id=243 x=454 y=35 width=20 height=26 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0
char id=244 x=272 y=65 width=20 height=25 xoffset=0 yoffset=2 xadvance=20 page=0 chnl=0
char id=245 x=292 y=65 width=20 height=25 xoffset=0 yoffset=2 xadvance=20 page=0 chnl=0
char id=246 x=396 y=115 width=20 height=24 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=0
char id=247 x=276 y=139 width=17 height=16 xoffset=1 yoffset=7 xadvance=19 page=0 chnl=0
char id=248 x=239 y=139 width=20 height=19 xoffset=0 yoffset=8 xadvance=20 page=0 chnl=0
char id=249 x=474 y=35 width=17 height=26 xoffset=1 yoffset=1 xadvance=19 page=0 chnl=0
char id=250 x=491 y=35 width=17 height=26 xoffset=1 yoffset=1 xadvance=19 page=0 chnl=0
char id=251 x=0 y=65 width=17 height=26 xoffset=1 yoffset=1 xadvance=19 page=0 chnl=0
char id=252 x=416 y=115 width=17 height=24 xoffset=1 yoffset=3 xadvance=19 page=0 chnl=0
char id=253 x=50 y=0 width=20 height=32 xoffset=-1 yoffset=1 xadvance=19 page=0 chnl=0
char id=254 x=139 y=35 width=19 height=30 xoffset=1 yoffset=3 xadvance=20 page=0 chnl=0
char id=255 x=158 y=35 width=20 height=30 xoffset=-1 yoffset=3 xadvance=19 page=0 chnl=0
kernings count=375
kerning first=244 second=119 amount=-1
kerning first=86 second=225 amount=-1
kerning first=119 second=245 amount=-1
kerning first=253 second=243 amount=-1
kerning first=111 second=89 amount=-4
kerning first=248 second=86 amount=-2
kerning first=84 second=211 amount=-1
kerning first=84 second=194 amount=-2
kerning first=221 second=235 amount=-4
kerning first=192 second=221 amount=-1
kerning first=121 second=44 amount=-4
kerning first=65 second=89 amount=-1
kerning first=75 second=216 amount=-1
kerning first=87 second=248 amount=-2
kerning first=89 second=242 amount=-4
kerning first=221 second=111 amount=-4
kerning first=233 second=221 amount=-4
kerning first=246 second=255 amount=-1
kerning first=75 second=195 amount=1
kerning first=234 second=86 amount=-2
kerning first=121 second=233 amount=-1
kerning first=119 second=235 amount=-1
kerning first=111 second=119 amount=-1
kerning first=76 second=86 amount=-3
kerning first=246 second=221 amount=-4
kerning first=86 second=198 amount=-3
kerning first=118 second=242 amount=-1
kerning first=89 second=194 amount=-1
kerning first=92 second=92 amount=-4
kerning first=119 second=111 amount=-1
kerning first=114 second=242 amount=-1
kerning first=86 second=232 amount=-2
kerning first=194 second=221 amount=-1
kerning first=89 second=101 amount=-4
kerning first=87 second=234 amount=-2
kerning first=192 second=86 amount=-3
kerning first=86 second=246 amount=-2
kerning first=243 second=255 amount=-1
kerning first=248 second=121 amount=-1
kerning first=233 second=86 amount=-2
kerning first=197 second=84 amount=-2
kerning first=92 second=47 amount=2
kerning first=75 second=193 amount=1
kerning first=118 second=101 amount=-1
kerning first=243 second=221 amount=-4
kerning first=245 second=87 amount=-2
kerning first=246 second=86 amount=-2
kerning first=84 second=197 amount=-2
kerning first=121 second=46 amount=-4
kerning first=193 second=221 amount=-1
kerning first=197 second=87 amount=-1
kerning first=194 second=86 amount=-3
kerning first=89 second=99 amount=-4
kerning first=87 second=231 amount=-2
kerning first=235 second=87 amount=-2
kerning first=195 second=71 amount=-1
kerning first=99 second=89 amount=-4
kerning first=89 second=197 amount=-1
kerning first=121 second=244 amount=-1
kerning first=221 second=196 amount=-1
kerning first=243 second=86 amount=-2
kerning first=68 second=196 amount=-2
kerning first=84 second=65 amount=-2
kerning first=221 second=233 amount=-4
kerning first=86 second=245 amount=-2
kerning first=119 second=44 amount=-3
kerning first=75 second=210 amount=-1
kerning first=89 second=243 amount=-4
kerning first=193 second=86 amount=-3
kerning first=87 second=242 amount=-2
kerning first=231 second=221 amount=-4
kerning first=246 second=121 amount=-1
kerning first=245 second=253 amount=-1
kerning first=230 second=89 amount=-4
kerning first=255 second=232 amount=-1
kerning first=196 second=84 amount=-2
kerning first=119 second=233 amount=-1
kerning first=255 second=246 amount=-1
kerning first=89 second=65 amount=-1
kerning first=118 second=243 amount=-1
kerning first=242 second=87 amount=-2
kerning first=87 second=194 amount=-1
kerning first=118 second=228 amount=-1
kerning first=114 second=243 amount=-1
kerning first=86 second=235 amount=-2
kerning first=87 second=101 amount=-2
kerning first=196 second=87 amount=-1
kerning first=230 second=119 amount=-1
kerning first=213 second=87 amount=-1
kerning first=86 second=111 amount=-2
kerning first=101 second=87 amount=-2
kerning first=243 second=121 amount=-1
kerning first=192 second=71 amount=-1
kerning first=245 second=118 amount=-1
kerning first=231 second=86 amount=-2
kerning first=253 second=232 amount=-1
kerning first=121 second=248 amount=-1
kerning first=86 second=226 amount=-1
kerning first=221 second=195 amount=-1
kerning first=253 second=246 amount=-1
kerning first=68 second=195 amount=-2
kerning first=84 second=214 amount=-1
kerning first=244 second=87 amount=-2
kerning first=84 second=192 amount=-2
kerning first=119 second=46 amount=-3
kerning first=232 second=89 amount=-4
kerning first=221 second=244 amount=-4
kerning first=47 second=47 amount=-4
kerning first=87 second=99 amount=-2
kerning first=242 second=253 amount=-1
kerning first=121 second=234 amount=-1
kerning first=194 second=71 amount=-1
kerning first=65 second=84 amount=-2
kerning first=255 second=245 amount=-1
kerning first=89 second=192 amount=-1
kerning first=87 second=197 amount=-1
kerning first=119 second=244 amount=-1
kerning first=221 second=193 amount=-1
kerning first=111 second=87 amount=-2
kerning first=118 second=227 amount=-1
kerning first=68 second=193 amount=-2
kerning first=195 second=89 amount=-1
kerning first=232 second=119 amount=-1
kerning first=82 second=89 amount=-1
kerning first=65 second=87 amount=-1
kerning first=75 second=211 amount=-1
kerning first=87 second=243 amount=-2
kerning first=210 second=87 amount=-1
kerning first=244 second=253 amount=-1
kerning first=86 second=229 amount=-1
kerning first=75 second=194 amount=1
kerning first=193 second=71 amount=-1
kerning first=242 second=118 amount=-1
kerning first=253 second=245 amount=-1
kerning first=255 second=235 amount=-1
kerning first=248 second=89 amount=-4
kerning first=255 second=111 amount=-1
kerning first=84 second=213 amount=-1
kerning first=86 second=196 amount=-3
kerning first=84 second=198 amount=-2
kerning first=87 second=65 amount=-1
kerning first=118 second=225 amount=-1
kerning first=221 second=248 amount=-4
kerning first=86 second=233 amount=-2
kerning first=234 second=89 amount=-4
kerning first=212 second=87 amount=-1
kerning first=111 second=253 amount=-1
kerning first=248 second=119 amount=-1
kerning first=253 second=235 amount=-1
kerning first=244 second=118 amount=-1
kerning first=89 second=198 amount=-1
kerning first=121 second=242 amount=-1
kerning first=86 second=97 amount=-1
kerning first=119 second=248 amount=-1
kerning first=253 second=111 amount=-1
kerning first=84 second=79 amount=-1
kerning first=89 second=232 amount=-4
kerning first=221 second=234 amount=-4
kerning first=192 second=89 amount=-1
kerning first=234 second=119 amount=-1
kerning first=89 second=246 amount=-4
kerning first=233 second=89 amount=-4
kerning first=245 second=255 amount=-1
kerning first=75 second=197 amount=1
kerning first=79 second=87 amount=-1
kerning first=118 second=232 amount=-1
kerning first=121 second=101 amount=-1
kerning first=119 second=234 amount=-1
kerning first=99 second=87 amount=-2
kerning first=245 second=221 amount=-4
kerning first=111 second=118 amount=-1
kerning first=246 second=89 amount=-4
kerning first=86 second=195 amount=-3
kerning first=118 second=246 amount=-1
kerning first=87 second=192 amount=-1
kerning first=197 second=221 amount=-1
kerning first=114 second=246 amount=-1
kerning first=194 second=89 amount=-1
kerning first=233 second=119 amount=-1
kerning first=255 second=44 amount=-4
kerning first=235 second=221 amount=-4
kerning first=86 second=244 amount=-2
kerning first=255 second=233 amount=-1
kerning first=86 second=224 amount=-1
kerning first=246 second=119 amount=-1
kerning first=75 second=65 amount=1
kerning first=230 second=87 amount=-2
kerning first=243 second=89 amount=-4
kerning first=245 second=86 amount=-2
kerning first=86 second=193 amount=-3
kerning first=89 second=245 amount=-4
kerning first=193 second=89 amount=-1
kerning first=253 second=44 amount=-4
kerning first=197 second=86 amount=-3
kerning first=221 second=242 amount=-4
kerning first=242 second=255 amount=-1
kerning first=235 second=86 amount=-2
kerning first=253 second=233 amount=-1
kerning first=243 second=119 amount=-1
kerning first=118 second=245 amount=-1
kerning first=242 second=221 amount=-4
kerning first=87 second=198 amount=-1
kerning first=121 second=243 amount=-1
kerning first=221 second=194 amount=-1
kerning first=119 second=242 amount=-1
kerning first=68 second=194 amount=-2
kerning first=114 second=245 amount=-1
kerning first=255 second=46 amount=-4
kerning first=89 second=235 amount=-4
kerning first=87 second=232 amount=-2
kerning first=196 second=221 amount=-1
kerning first=221 second=101 amount=-4
kerning first=86 second=248 amount=-2
kerning first=75 second=214 amount=-1
kerning first=101 second=221 amount=-4
kerning first=89 second=111 amount=-4
kerning first=87 second=246 amount=-2
kerning first=232 second=87 amount=-2
kerning first=244 second=255 amount=-1
kerning first=231 second=89 amount=-4
kerning first=245 second=121 amount=-1
kerning first=195 second=84 amount=-2
kerning first=86 second=230 amount=-1
kerning first=75 second=192 amount=1
kerning first=118 second=235 amount=-1
kerning first=119 second=101 amount=-1
kerning first=255 second=244 amount=-1
kerning first=244 second=221 amount=-4
kerning first=118 second=111 amount=-1
kerning first=242 second=86 amount=-2
kerning first=118 second=226 amount=-1
kerning first=253 second=46 amount=-4
kerning first=114 second=111 amount=-1
kerning first=86 second=234 amount=-2
kerning first=195 second=87 amount=-1
kerning first=196 second=86 amount=-3
kerning first=221 second=99 amount=-4
kerning first=111 second=255 amount=-1
kerning first=101 second=86 amount=-2
kerning first=221 second=197 amount=-1
kerning first=253 second=244 amount=-1
kerning first=118 second=100 amount=-1
kerning first=111 second=221 amount=-4
kerning first=248 second=87 amount=-2
kerning first=84 second=212 amount=-1
kerning first=68 second=197 amount=-2
kerning first=244 second=86 amount=-2
kerning first=76 second=84 amount=-1
kerning first=84 second=196 amount=-2
kerning first=65 second=221 amount=-1
kerning first=75 second=213 amount=-1
kerning first=87 second=245 amount=-2
kerning first=221 second=243 amount=-4
kerning first=86 second=231 amount=-2
kerning first=75 second=198 amount=1
kerning first=242 second=121 amount=-1
kerning first=234 second=87 amount=-2
kerning first=197 second=71 amount=-1
kerning first=192 second=84 amount=-2
kerning first=255 second=248 amount=-1
kerning first=89 second=196 amount=-1
kerning first=221 second=65 amount=-1
kerning first=119 second=243 amount=-1
kerning first=118 second=229 amount=-1
kerning first=111 second=86 amount=-2
kerning first=68 second=65 amount=-2
kerning first=89 second=233 amount=-4
kerning first=87 second=235 amount=-2
kerning first=192 second=87 amount=-1
kerning first=118 second=44 amount=-4
kerning first=65 second=86 amount=-3
kerning first=86 second=242 amount=-2
kerning first=75 second=79 amount=-1
kerning first=87 second=111 amount=-2
kerning first=233 second=87 amount=-2
kerning first=244 second=121 amount=-1
kerning first=248 second=253 amount=-1
kerning first=194 second=84 amount=-2
kerning first=253 second=248 amount=-1
kerning first=118 second=233 amount=-1
kerning first=255 second=234 amount=-1
kerning first=84 second=216 amount=-1
kerning first=246 second=87 amount=-2
kerning first=86 second=194 amount=-3
kerning first=84 second=195 amount=-2
kerning first=118 second=97 amount=-1
kerning first=86 second=101 amount=-2
kerning first=194 second=87 amount=-1
kerning first=216 second=87 amount=-1
kerning first=99 second=221 amount=-4
kerning first=121 second=232 amount=-1
kerning first=111 second=121 amount=-1
kerning first=253 second=234 amount=-1
kerning first=196 second=71 amount=-1
kerning first=248 second=118 amount=-1
kerning first=193 second=84 amount=-2
kerning first=89 second=195 amount=-1
kerning first=121 second=246 amount=-1
kerning first=221 second=192 amount=-1
kerning first=243 second=87 amount=-2
kerning first=68 second=192 amount=-2
kerning first=84 second=193 amount=-2
kerning first=118 second=46 amount=-4
kerning first=89 second=244 amount=-4
kerning first=193 second=87 amount=-1
kerning first=246 second=253 amount=-1
kerning first=86 second=99 amount=-2
kerning first=230 second=221 amount=-4
kerning first=99 second=86 amount=-2
kerning first=255 second=242 amount=-1
kerning first=245 second=89 amount=-4
kerning first=86 second=197 amount=-3
kerning first=89 second=193 amount=-1
kerning first=87 second=196 amount=-1
kerning first=118 second=244 amount=-1
kerning first=118 second=224 amount=-1
kerning first=197 second=89 amount=-1
kerning first=114 second=244 amount=-1
kerning first=87 second=233 amount=-2
kerning first=235 second=89 amount=-4
kerning first=86 second=243 amount=-2
kerning first=214 second=87 amount=-1
kerning first=245 second=119 amount=-1
kerning first=243 second=253 amount=-1
kerning first=231 second=87 amount=-2
kerning first=255 second=101 amount=-1
kerning first=246 second=118 amount=-1
kerning first=65 second=71 amount=-1
kerning first=86 second=228 amount=-1
kerning first=221 second=198 amount=-1
kerning first=121 second=245 amount=-1
kerning first=230 second=86 amount=-2
kerning first=253 second=242 amount=-1
kerning first=68 second=198 amount=-2
kerning first=84 second=210 amount=-1
kerning first=86 second=65 amount=-3
kerning first=221 second=232 amount=-4
kerning first=235 second=119 amount=-1
kerning first=89 second=248 amount=-4
kerning first=232 second=221 amount=-4
kerning first=221 second=246 amount=-4
kerning first=211 second=87 amount=-1
kerning first=121 second=235 amount=-1
kerning first=119 second=232 amount=-1
kerning first=253 second=101 amount=-1
kerning first=243 second=118 amount=-1
kerning first=118 second=248 amount=-1
kerning first=242 second=89 amount=-4
kerning first=87 second=195 amount=-1
kerning first=121 second=111 amount=-1
kerning first=119 second=246 amount=-1
kerning first=118 second=230 amount=-1
kerning first=114 second=248 amount=-1
kerning first=195 second=221 amount=-1
kerning first=89 second=234 amount=-4
kerning first=196 second=89 amount=-1
kerning first=82 second=221 amount=-1
kerning first=75 second=212 amount=-1
kerning first=101 second=89 amount=-4
kerning first=87 second=244 amount=-2
kerning first=232 second=86 amount=-2
kerning first=248 second=255 amount=-1
kerning first=86 second=227 amount=-1
kerning first=75 second=196 amount=1
kerning first=242 second=119 amount=-1
kerning first=118 second=234 amount=-1
kerning first=248 second=221 amount=-4
kerning first=255 second=243 amount=-1
kerning first=244 second=89 amount=-4
kerning first=86 second=192 amount=-3
kerning first=87 second=193 amount=-1
kerning first=221 second=245 amount=-4
kerning first=101 second=119 amount=-1
kerning first=195 second=86 amount=-3
kerning first=234 second=221 amount=-4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -1,43 +0,0 @@
Copyright (c) 2015, Chris Simpson, with Reserved Font Name: "Metropolis".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@@ -1,201 +0,0 @@
// Styling of Lemur components
// For documentation, see
// https://github.com/jMonkeyEngine-Contributions/Lemur/wiki/Styling
import com.simsilica.lemur.Button
import com.simsilica.lemur.Button.ButtonAction
import com.simsilica.lemur.Command
import com.simsilica.lemur.HAlignment
import com.simsilica.lemur.Insets3f
import com.simsilica.lemur.component.QuadBackgroundComponent
import com.simsilica.lemur.component.TbtQuadBackgroundComponent
def bgColor = color(0.25, 0.5, 0.5, 1)
def buttonEnabledColor = color(0.8, 0.9, 1, 1)
def buttonDisabledColor = color(0.8, 0.9, 1, 0.2)
def buttonBgColor = color(0, 0.75, 0.75, 1)
def sliderColor = color(0.6, 0.8, 0.8, 1)
def sliderBgColor = color(0.5, 0.75, 0.75, 1)
def gradientColor = color(0.5, 0.75, 0.85, 0.5)
def tabbuttonEnabledColor = color(0.4, 0.45, 0.5, 1)
def gradient = TbtQuadBackgroundComponent.create(
texture(name: "/com/simsilica/lemur/icons/bordered-gradient.png",
generateMips: false),
1, 1, 1, 126, 126,
1f, false)
def doubleGradient = new QuadBackgroundComponent(gradientColor)
doubleGradient.texture = texture(name: "/com/simsilica/lemur/icons/double-gradient-128.png",
generateMips: false)
selector("pp") {
font = font("Interface/Fonts/Metropolis/Metropolis-Regular-32.fnt")
}
selector("label", "pp") {
insets = new Insets3f(2, 2, 2, 2)
color = buttonEnabledColor
}
selector("header", "pp") {
font = font("Interface/Fonts/Metropolis/Metropolis-Bold-42.fnt")
insets = new Insets3f(2, 2, 2, 2)
color = color(1, 0.5, 0, 1)
textHAlignment = HAlignment.Center
}
selector("container", "pp") {
background = gradient.clone()
background.setColor(bgColor)
}
selector("slider", "pp") {
background = gradient.clone()
background.setColor(bgColor)
}
def pressedCommand = new Command<Button>() {
void execute(Button source) {
if (source.isPressed())
source.move(1, -1, 0)
else
source.move(-1, 1, 0)
}
}
def enabledCommand = new Command<Button>() {
void execute(Button source) {
if (source.isEnabled())
source.setColor(buttonEnabledColor)
else
source.setColor(buttonDisabledColor)
}
}
def repeatCommand = new Command<Button>() {
private long startTime
private long lastClick
void execute(Button source) {
// Only do the repeating click while the mouse is
// over the button (and pressed of course)
if (source.isPressed() && source.isHighlightOn()) {
long elapsedTime = System.currentTimeMillis() - startTime
// After half a second pause, click 8 times a second
if (elapsedTime > 500 && elapsedTime > lastClick + 125) {
source.click()
// Try to quantize the last click time to prevent drift
lastClick = ((elapsedTime - 500) / 125) * 125 + 500
}
}
else {
startTime = System.currentTimeMillis()
lastClick = 0
}
}
}
def stdButtonCommands = [
(ButtonAction.Down) : [pressedCommand],
(ButtonAction.Up) : [pressedCommand],
(ButtonAction.Enabled) : [enabledCommand],
(ButtonAction.Disabled): [enabledCommand]
]
def sliderButtonCommands = [
(ButtonAction.Hover): [repeatCommand]
]
selector("title", "pp") {
color = color(0.8, 0.9, 1, 0.85f)
highlightColor = color(1, 0.8, 1, 0.85f)
shadowColor = color(0, 0, 0, 0.75f)
shadowOffset = vec3(2, -2, -1)
background = new QuadBackgroundComponent(color(0.5, 0.75, 0.85, 1))
background.texture = texture(name: "/com/simsilica/lemur/icons/double-gradient-128.png",
generateMips: false)
insets = new Insets3f(2, 2, 2, 2)
buttonCommands = stdButtonCommands
}
selector("button", "pp") {
background = gradient.clone()
color = buttonEnabledColor
background.setColor(buttonBgColor)
insets = new Insets3f(2, 2, 2, 2)
buttonCommands = stdButtonCommands
}
selector("slider", "pp") {
insets = new Insets3f(1, 3, 1, 2)
}
selector("slider", "button", "pp") {
background = doubleGradient.clone()
//background.setColor(sliderBgColor)
insets = new Insets3f(0, 0, 0, 0)
}
selector("slider.thumb.button", "pp") {
text = "[]"
color = sliderColor
}
selector("slider.left.button", "pp") {
text = "-"
background = doubleGradient.clone()
//background.setColor(sliderBgColor)
background.setMargin(5, 0)
color = sliderColor
buttonCommands = sliderButtonCommands
}
selector("slider.right.button", "pp") {
text = "+"
background = doubleGradient.clone()
//background.setColor(sliderBgColor)
background.setMargin(4, 0)
color = sliderColor
buttonCommands = sliderButtonCommands
}
selector("slider.up.button", "pp") {
buttonCommands = sliderButtonCommands
}
selector("slider.down.button", "pp") {
buttonCommands = sliderButtonCommands
}
selector("checkbox", "pp") {
color = buttonEnabledColor
}
selector("rollup", "pp") {
background = gradient.clone()
background.setColor(bgColor)
}
selector("tabbedPanel", "pp") {
activationColor = buttonEnabledColor
}
selector("tabbedPanel.container", "pp") {
background = null
}
selector("tab.button", "pp") {
background = gradient.clone()
background.setColor(bgColor)
color = tabbuttonEnabledColor
insets = new Insets3f(4, 2, 0, 2)
buttonCommands = stdButtonCommands
}

View File

@@ -1,86 +0,0 @@
////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////
package pp.view;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
public class ModelViewSynchronizerTest {
private Node rootNode;
private Node itemNode;
private ModelViewSynchronizer<String> synchronizer;
@Before
public void setUp() {
rootNode = new Node("root"); //NON-NLS
synchronizer = new ModelViewSynchronizer<>(rootNode) {
@Override
protected Spatial translate(String item) {
return new Node(item);
}
};
itemNode = (Node) rootNode.getChild(0);
}
@Test
public void testConstructor() {
assertNotNull(itemNode);
assertEquals(1, rootNode.getQuantity());
}
@Test
public void testAdd() {
String item = "item1"; //NON-NLS
synchronizer.add(item);
Spatial spatial = synchronizer.getSpatial(item);
assertNotNull(spatial);
assertEquals(item, spatial.getName());
assertTrue(itemNode.hasChild(spatial));
}
@Test
public void testDelete() {
String item = "item1"; //NON-NLS
synchronizer.add(item);
synchronizer.delete(item);
Spatial spatial = synchronizer.getSpatial(item);
assertNull(spatial);
assertFalse(itemNode.hasChild(spatial));
}
@Test
public void testClear() {
synchronizer.add("item1"); //NON-NLS
synchronizer.add("item2"); //NON-NLS
synchronizer.clear();
assertNull(synchronizer.getSpatial("item1")); //NON-NLS
assertNull(synchronizer.getSpatial("item2")); //NON-NLS
assertEquals(0, itemNode.getQuantity());
}
@Test
public void testAddDuplicate() {
String item = "item1"; //NON-NLS
synchronizer.add(item);
synchronizer.add(item);
assertEquals(1, itemNode.getQuantity());
}
}

View File

@@ -5,9 +5,8 @@
description = 'mdga client'
dependencies {
implementation project(":jme-common")
implementation project(":mdga:model")
implementation libs.lemur
implementation libs.jme3.desktop
implementation libs.jme3.core
implementation libs.jme3.lwjgl3
@@ -15,14 +14,25 @@ implementation project(":mdga:model")
implementation libs.jme3.desktop
implementation libs.jme3.effects
runtimeOnly libs.jme3.awt.dialogs
runtimeOnly libs.jme3.plugins
runtimeOnly libs.jme3.jogg
runtimeOnly libs.jme3.testdata
runtimeOnly libs.slf4j.nop
}
application {
mainClass = 'pp.mdga.client.MdgaApp'
applicationName = 'MDGA'
}
tasks.register('fatJar', Jar) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes 'Main-Class': 'pp.mdga.client.MdgaApp'
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
}

View File

@@ -1,76 +1,140 @@
package pp.mdga.client;
/**
* Represents different assets in the application. Each asset may have an associated model path,
* diffuse texture path, and a size factor. The enum provides multiple constructors to handle
* varying levels of detail for different assets.
*/
public enum Asset {
bigTent,
cardStack,
cir,
heer,
jet,
jet_noGear("Models/jet/jet_noGear.j3o", "Models/jet/jet_diff.png"),
lw,
marine,
node_home_blue("./node_home/node_home.j3o", "./node_home/node_home_blue_diff.png"),
node_wait_blue("./node_home/node_home.j3o", "./node_home/node_home_blue_diff.png"),
node_home_black("./node_home/node_home.j3o", "./node_home/node_home_black_diff.png"),
node_wait_black("./node_home/node_home.j3o", "./node_home/node_home_black_diff.png"),
node_home_green("./node_home/node_home.j3o", "./node_home/node_home_green_diff.png"),
node_wait_green("./node_home/node_home.j3o", "./node_home/node_home_green_diff.png"),
node_home_yellow("./node_home/node_home.j3o", "./node_home/node_home_orange_diff.png"),
node_wait_yellow("./node_home/node_home.j3o", "./node_home/node_home_orange_diff.png"),
node_home_blue("Models/node_home/node_home.j3o", "Models/node_home/node_home_blue_diff.png"),
node_wait_blue("Models/node_home/node_home.j3o", "Models/node_home/node_home_blue_diff.png"),
node_home_black("Models/node_home/node_home.j3o", "Models/node_home/node_home_black_diff.png"),
node_wait_black("Models/node_home/node_home.j3o", "Models/node_home/node_home_black_diff.png"),
node_home_green("Models/node_home/node_home.j3o", "Models/node_home/node_home_green_diff.png"),
node_wait_green("Models/node_home/node_home.j3o", "Models/node_home/node_home_green_diff.png"),
node_home_yellow("Models/node_home/node_home.j3o", "Models/node_home/node_home_orange_diff.png"),
node_wait_yellow("Models/node_home/node_home.j3o", "Models/node_home/node_home_orange_diff.png"),
node_normal,
node_start("./node_normal/node_normal.j3o", "./node_normal/node_start_diff.png"),
node_bonus("./node_normal/node_normal.j3o", "./node_normal/node_bonus_diff.png"),
node_start("Models/node_normal/node_normal.j3o", "Models/node_normal/node_start_diff.png"),
node_bonus("Models/node_normal/node_normal.j3o", "Models/node_normal/node_bonus_diff.png"),
radar,
ship(0.8f),
smallTent,
tank,
// world(1.2f),
world("./world_new/world_export_new.obj", "./world_new/world_new_diff.png", 1.2f),
shield_ring("./shield_ring/shield_ring.obj", null),
tree_small("./tree_small/tree_small.obj", "./tree_small/tree_small_diff.png"),
tree_big("./tree_big/tree_big.obj", "./tree_big/tree_big_diff.png"),
world(1.2f),
shieldRing("Models/shieldRing/shieldRing.j3o", null),
treeSmall(1.2f),
treeBig(1.2f),
turboCard,
turboSymbol("Models/turboCard/turboSymbol.j3o", "Models/turboCard/turboCard_diff.png"),
swapCard,
shieldCard
;
swapSymbol("Models/swapCard/swapSymbol.j3o", "Models/swapCard/swapCard_diff.png"),
shieldCard,
shieldSymbol("Models/shieldCard/shieldSymbol.j3o", "Models/shieldCard/shieldCard_diff.png"),
dice,
missile("Models/missile/AVMT300.obj", "Models/missile/texture.jpg", 0.1f),
tankShoot("Models/tank/tankShoot_bot.j3o", "Models/tank/tank_diff.png"),
tankShootTop("Models/tank/tankShoot_top.j3o", "Models/tank/tank_diff.png"),
treesSmallBackground("Models/treeSmall/treesSmallBackground.j3o", "Models/treeSmall/treeSmall_diff.png", 1.2f),
treesBigBackground("Models/treeBig/treesBigBackground.j3o", "Models/treeBig/treeBig_diff.png", 1.2f),
shell;
private final String modelPath;
private final String diffPath;
private final float size;
private static final String ROOT = "Models/";
/**
* Default constructor. Initializes modelPath and diffPath based on the enum name and sets default size to 1.0.
*/
Asset() {
String folderFileName = "./" + name() + "/" + name();
String folderFileName = "./" + ROOT + name() + "/" + name();
this.modelPath = folderFileName + ".j3o";
this.diffPath = folderFileName + "_diff.png";
this.size = 1f;
}
/**
* Constructor with specific model path and diffuse texture path.
*
* @param modelPath Path to the 3D model file.
* @param diffPath Path to the diffuse texture file.
*/
Asset(String modelPath, String diffPath) {
this.modelPath = modelPath;
this.diffPath = diffPath;
this.size = 1f;
}
/**
* Constructor with specific model path. Diffuse texture path is derived based on enum name.
*
* @param modelPath Path to the 3D model file.
*/
Asset(String modelPath) {
String folderFileName = "./" + ROOT + name() + "/" + name();
this.modelPath = modelPath;
this.diffPath = folderFileName + "_diff.png";
;
this.size = 1f;
}
/**
* Constructor with specific size. Model and texture paths are derived based on enum name.
*
* @param size Scaling factor for the asset.
*/
Asset(float size) {
String folderFileName = "./" + name() + "/" + name();
String folderFileName = "./" + ROOT + name() + "/" + name();
this.modelPath = folderFileName + ".j3o";
this.diffPath = folderFileName + "_diff.png";
this.size = size;
}
Asset(String modelPath, String diffPath, float size){
/**
* Constructor with specific model path, diffuse texture path, and size.
*
* @param modelPath Path to the 3D model file.
* @param diffPath Path to the diffuse texture file.
* @param size Scaling factor for the asset.
*/
Asset(String modelPath, String diffPath, float size) {
this.modelPath = modelPath;
this.diffPath = diffPath;
this.size = size;
}
/**
* Gets the model path for the asset.
*
* @return Path to the 3D model file.
*/
public String getModelPath() {
return modelPath;
}
/**
* Gets the diffuse texture path for the asset.
*
* @return Path to the diffuse texture file, or null if not applicable.
*/
public String getDiffPath() {
return diffPath;
}
/**
* Gets the scaling factor for the asset.
*
* @return The size of the asset.
*/
public float getSize() {
return size;
}

View File

@@ -0,0 +1,48 @@
package pp.mdga.client;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Spatial;
import com.jme3.scene.control.AbstractControl;
/**
* An abstract control class that serves as a base for initializing spatial objects
* in jMonkeyEngine. This class overrides the controlUpdate and controlRender methods
* from the AbstractControl class, providing default empty implementations,
* and adds the ability to initialize spatial objects when they are set.
*/
public abstract class InitControl extends AbstractControl {
@Override
protected void controlUpdate(float tpf) {
}
@Override
protected void controlRender(RenderManager rm, ViewPort vp) {
}
/**
* Sets the spatial object to be controlled. This method also initializes the spatial
* if it is being set for the first time.
*
* @param spatial The spatial object to control.
*/
@Override
public void setSpatial(Spatial spatial) {
if (this.spatial == null && spatial != null) {
super.setSpatial(spatial);
initSpatial();
}
}
/**
* Initializes the spatial object. This method can be overridden by subclasses
* to define custom initialization logic for the spatial.
* This method is called automatically when the spatial is set for the first time.
*/
protected void initSpatial() {
// Default empty implementation. Override to add initialization logic.
}
}

View File

@@ -0,0 +1,321 @@
package pp.mdga.client;
import com.jme3.collision.CollisionResult;
import com.jme3.collision.CollisionResults;
import com.jme3.input.InputManager;
import com.jme3.input.KeyInput;
import com.jme3.input.MouseInput;
import com.jme3.input.controls.*;
import com.jme3.math.Ray;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.renderer.Camera;
import com.jme3.scene.Node;
import com.jme3.scene.control.AbstractControl;
import pp.mdga.client.board.OutlineOEControl;
import pp.mdga.client.gui.CardControl;
import pp.mdga.client.gui.DiceControl;
import pp.mdga.client.view.GameView;
import pp.mdga.game.Color;
import java.util.List;
import java.util.UUID;
public class InputSynchronizer {
private MdgaApp app;
private InputManager inputManager;
protected boolean rightMousePressed = false;
private float rotationAngle = 180f;
private int scrollValue = 0;
private CardControl hoverCard;
private OutlineOEControl hoverPiece;
private boolean clickAllowed = true;
private boolean isRotateLeft = false;
private boolean isRotateRight = false;
/**
* Constructor initializes the InputSynchronizer with the application context.
* Sets up input mappings and listeners for user interactions.
*
* @param app The application instance
*/
InputSynchronizer(MdgaApp app) {
this.app = app;
this.inputManager = app.getInputManager();
hoverCard = null;
hoverPiece = null;
setupInput();
}
/**
* Updates the rotation angle based on user input.
*
* @param tpf The time per frame.
*/
public void update(float tpf) {
if (isRotateLeft && isRotateRight) {
return;
}
if (isRotateLeft) {
rotationAngle += 180 * tpf;
}
if (isRotateRight) {
rotationAngle -= 180 * tpf;
}
}
/**
* Configures input mappings for various actions and binds them to listeners.
*/
private void setupInput() {
inputManager.addMapping("Settings", new KeyTrigger(KeyInput.KEY_ESCAPE));
inputManager.addMapping("Forward", new KeyTrigger(KeyInput.KEY_RETURN));
inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_Q));
inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_E));
inputManager.addMapping("RotateRightMouse", new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
inputManager.addMapping("MouseLeft", new MouseAxisTrigger(MouseInput.AXIS_X, false)); // Left movement
inputManager.addMapping("MouseRight", new MouseAxisTrigger(MouseInput.AXIS_X, true)); // Right movement
inputManager.addMapping("MouseScrollUp", new MouseAxisTrigger(MouseInput.AXIS_WHEEL, false)); // Scroll up
inputManager.addMapping("MouseScrollDown", new MouseAxisTrigger(MouseInput.AXIS_WHEEL, true)); // Scroll down
inputManager.addMapping("Test", new KeyTrigger(KeyInput.KEY_J));
inputManager.addMapping("Click", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addListener(actionListener, "Settings", "Forward", "RotateRightMouse", "Click", "Left", "Right", "Test");
inputManager.addListener(analogListener, "MouseLeft", "MouseRight", "MouseScrollUp", "MouseScrollDown");
}
/**
* Handles action-based input events such as key presses and mouse clicks.
*/
private final ActionListener actionListener = new ActionListener() {
@Override
public void onAction(String name, boolean isPressed, float tpf) {
if (name.equals("Settings") && isPressed) {
app.getView().pressEscape();
}
if (name.equals("Forward") && isPressed) {
app.getView().pressForward();
}
if (name.equals("RotateRightMouse")) {
rightMousePressed = isPressed;
}
if (name.equals("Click") && isPressed) {
if (!clickAllowed) {
return;
}
if (app.getView() instanceof GameView gameView) {
DiceControl diceSelect = checkHover(gameView.getGuiHandler().getCardLayerCamera(), gameView.getGuiHandler().getCardLayerRootNode(), DiceControl.class);
CardControl cardLayerSelect = checkHover(gameView.getGuiHandler().getCardLayerCamera(), gameView.getGuiHandler().getCardLayerRootNode(), CardControl.class);
OutlineOEControl boardSelect = checkHover(app.getCamera(), app.getRootNode(), OutlineOEControl.class);
if (diceSelect != null) {
app.getModelSynchronize().rolledDice();
} else if (cardLayerSelect != null) {
if (cardLayerSelect.isSelectable()) gameView.getGuiHandler().selectCard(cardLayerSelect);
} else if (boardSelect != null) {
if (boardSelect.isSelectable()) gameView.getBoardHandler().pieceSelect(boardSelect);
}
}
}
if (name.equals("Left")) {
isRotateLeft = !isRotateLeft;
}
if (name.equals("Right")) {
isRotateRight = !isRotateRight;
}
if (name.equals("Test") && isPressed) {
if (app.getView() instanceof GameView gameView) {
//Test Code
}
}
}
};
/**
* Handles analog-based input events such as mouse movement and scrolling.
*/
private final AnalogListener analogListener = new AnalogListener() {
@Override
public void onAnalog(String name, float value, float tpf) {
if (name.equals("MouseLeft") && rightMousePressed) {
rotationAngle -= value * 360f;
} else if (name.equals("MouseRight") && rightMousePressed) {
rotationAngle += value * 360f;
} else if (name.equals("MouseScrollUp")) {
scrollValue = Math.max(1, scrollValue - 5);
} else if (name.equals("MouseScrollDown")) {
scrollValue = Math.min(100, scrollValue + 5);
} else if (name.equals("MouseLeft") || name.equals("MouseRight") || name.equals("MouseVertical")) {
hoverPiece();
hoverCard();
}
}
};
/**
* Detects the hovered piece and updates its hover state.
*/
private <T extends AbstractControl> T checkHover(Camera cam, Node root, Class<T> controlType) {
if (cam == null || root == null || controlType == null) return null;
CollisionResults results = new CollisionResults();
Ray ray = new Ray(cam.getLocation(), getMousePos(cam).subtract(cam.getLocation()).normalize());
root.collideWith(ray, results);
for (CollisionResult collisionResult : results) {
if (collisionResult.getGeometry().getControl(controlType) != null)
return collisionResult.getGeometry().getControl(controlType);
}
return null;
}
/**
* Detects the hovered card and updates its hover state.
*/
private <T extends AbstractControl> T checkHoverOrtho(Camera cam, Node root, Class<T> controlType) {
if (cam == null || root == null || controlType == null) return null;
CollisionResults results = new CollisionResults();
Vector3f mousePos = getMousePos(cam);
mousePos.setZ(cam.getLocation().getZ());
Ray ray = new Ray(mousePos, getMousePos(cam).subtract(mousePos).normalize());
root.collideWith(ray, results);
if (results.size() > 0) {
for (CollisionResult res : results) {
T control = res.getGeometry().getControl(controlType);
if (control != null) return control;
}
}
return null;
}
/**
* Handles the hover state for a piece in the game.
* Checks if a piece is being hovered over, updates the hover state, and triggers hover effects.
*/
private void hoverPiece() {
if (app.getView() instanceof GameView gameView) {
OutlineOEControl control = checkPiece();
if (control != null) {
if (control != hoverPiece) {
pieceOff(gameView);
hoverPiece = control;
if(hoverPiece.isHoverable()) gameView.getBoardHandler().hoverOn(hoverPiece);
}
} else {
pieceOff(gameView);
}
}
}
/**
* Handles the hover state for a card in the game.
* Checks if a card is being hovered over, updates the hover state, and triggers hover effects.
*/
private void hoverCard() {
if (app.getView() instanceof GameView gameView) {
CardControl control = checkCard(gameView);
if (control != null) {
if (control != hoverCard) {
cardOff();
hoverCard = control;
hoverCard.hoverOn();
}
} else {
cardOff();
}
}
}
/**
* Checks if a piece is being hovered over in the 3D game world.
*
* @return The PieceControl of the hovered piece, or null if no piece is hovered.
*/
private OutlineOEControl checkPiece() {
return checkHover(app.getCamera(), app.getRootNode(), OutlineOEControl.class);
}
/**
* Checks if a card is being hovered over in the 2D card layer.
*
* @param gameView The current game view.
* @return The CardControl of the hovered card, or null if no card is hovered.
*/
private CardControl checkCard(GameView gameView) {
return checkHoverOrtho(
gameView.getGuiHandler().getCardLayerCamera(),
gameView.getGuiHandler().getCardLayerRootNode(),
CardControl.class
);
}
/**
* Disables the hover effect on the currently hovered piece, if any.
*/
private void pieceOff(GameView gameView) {
if (hoverPiece != null) {
if(hoverPiece.isHoverable()) gameView.getBoardHandler().hoverOff(hoverPiece);
}
hoverPiece = null;
}
/**
* Disables the hover effect on the currently hovered card, if any.
*/
private void cardOff() {
if (hoverCard != null) hoverCard.hoverOff();
hoverCard = null;
}
/**
* Retrieves the current mouse position in the 3D world using the specified camera.
*
* @param cam The camera used for determining the mouse position.
* @return A Vector3f representing the mouse position in the 3D world.
*/
private Vector3f getMousePos(Camera cam) {
Vector2f mousePositionScreen = inputManager.getCursorPosition();
Vector3f world = cam.getWorldCoordinates(mousePositionScreen, 0);
if (cam.isParallelProjection()) world.setZ(0);
return world;
}
/**
* Gets the current rotation angle of the game element.
*
* @return The rotation angle in degrees, normalized to 360 degrees.
*/
public float getRotation() {
return (rotationAngle / 2) % 360;
}
public void setRotation(float rotationAngle) {
this.rotationAngle = rotationAngle;
}
/**
* Gets the current scroll value.
*
* @return The scroll value as an integer.
*/
public int getScroll() {
return scrollValue;
}
public void setClickAllowed(boolean allowed) {
clickAllowed = allowed;
}
public boolean isClickAllowed() {
return clickAllowed;
}
}

View File

@@ -1,72 +0,0 @@
package pp.mdga.client;
import com.jme3.input.InputManager;
import com.jme3.input.KeyInput;
import com.jme3.input.MouseInput;
import com.jme3.input.controls.*;
public class InputSyncronizer {
private MdgaApp app;
private InputManager inputManager;
protected boolean rightMousePressed = false;
private float rotationAngle = 180f;
private int scrollValue = 0;
InputSyncronizer(MdgaApp app) {
this.app = app;
this.inputManager = app.getInputManager();
setupInput();
}
private void setupInput() {
inputManager.addMapping("Settings", new KeyTrigger(KeyInput.KEY_ESCAPE));
inputManager.addMapping("RotateRightMouse", new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
inputManager.addMapping("MouseLeft", new MouseAxisTrigger(MouseInput.AXIS_X, false)); // Left movement
inputManager.addMapping("MouseRight", new MouseAxisTrigger(MouseInput.AXIS_X, true)); // Right movement
inputManager.addMapping("MouseScrollUp", new MouseAxisTrigger(MouseInput.AXIS_WHEEL, false)); // Scroll up
inputManager.addMapping("MouseScrollDown", new MouseAxisTrigger(MouseInput.AXIS_WHEEL, true)); // Scroll down
inputManager.addListener(actionListener, "Settings", "RotateRightMouse");
inputManager.addListener(analogListener, "MouseLeft", "MouseRight", "MouseScrollUp", "MouseScrollDown");
}
private final ActionListener actionListener = new ActionListener() {
@Override
public void onAction(String name, boolean isPressed, float tpf) {
if (name.equals("Settings") && isPressed) {
app.getView().pressEscape();
}
if (name.equals("RotateRightMouse")) {
rightMousePressed = isPressed;
}
}
};
private final AnalogListener analogListener = new AnalogListener() {
@Override
public void onAnalog(String name, float value, float tpf) {
if (name.equals("MouseLeft") && rightMousePressed) {
rotationAngle -= value * 360f;
} else if (name.equals("MouseRight") && rightMousePressed) {
rotationAngle += value * 360f;
} else if (name.equals("MouseScrollUp")) {
scrollValue = Math.max(1, scrollValue - 5);
} else if (name.equals("MouseScrollDown")) {
scrollValue = Math.min(100, scrollValue + 5);
}
}
};
public float getRotation() {
return (rotationAngle / 2) % 360;
}
public int getScroll() {
return scrollValue;
}
}

View File

@@ -1,70 +1,201 @@
package pp.mdga.client;
import com.jme3.app.SimpleApplication;
import com.jme3.system.AppSettings;
import com.simsilica.lemur.GuiGlobals;
import pp.mdga.client.acoustic.AcousticHandler;
import pp.mdga.client.animation.AnimationHandler;
import com.jme3.system.AppSettings;
import pp.mdga.client.animation.TimerManager;
import pp.mdga.client.dialog.JoinDialog;
import pp.mdga.client.view.*;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.prefs.Preferences;
/**
* Main application class for the MdgaApp game.
* This class extends {@link SimpleApplication} and manages the game's lifecycle, states, and main components.
*/
public class MdgaApp extends SimpleApplication {
private AnimationHandler animationHandler;
private static Preferences prefs = Preferences.userNodeForPackage(JoinDialog.class);
/**
* Handles acoustic effects and state-based sounds.
*/
private AcousticHandler acousticHandler;
/**
* Synchronizes notifications throughout the application.
*/
private NotificationSynchronizer notificationSynchronizer;
private InputSyncronizer inputSyncronizer;
private ModelSyncronizer modelSyncronizer;
MdgaView view = null;
private MdgaState state = MdgaState.MAIN;
/**
* Manages input events and synchronization.
*/
private InputSynchronizer inputSynchronizer;
private static float resolutionFactor = 1.8f;
/**
* Synchronizes game models.
*/
private ModelSynchronizer modelSynchronizer;
/**
* The currently active view in the application.
*/
private MdgaView view = null;
/**
* The current state of the application.
*/
private MdgaState state = null;
/**
* Scale for rendering images.
*/
private final float imageScale = prefs.getInt("scale", 1);
/**
* The main menu view.
*/
private MainView mainView;
/**
* The lobby view.
*/
private LobbyView lobbyView;
/**
* The game view.
*/
private GameView gameView;
/**
* The ceremony view.
*/
private CeremonyView ceremonyView;
/**
* The client game logic.
*/
private ClientGameLogic clientGameLogic;
private ExecutorService executor;
private ServerConnection networkConnection;
private final TimerManager timerManager = new TimerManager();
public static final int DEBUG_MULTIPLIER = 1;
/**
* Constructs a new MdgaApp instance.
* Initializes the network connection and client game logic.
*/
public MdgaApp() {
networkConnection = new NetworkSupport(this);
this.clientGameLogic = new ClientGameLogic(networkConnection);
}
/**
* Main entry point for the application.
* Configures settings and starts the application.
*
* @param args command-line arguments (not used)
*/
public static void main(String[] args) {
AppSettings settings = new AppSettings(true);
settings.setSamples(128);
if (prefs.getBoolean("fullscreen", false)) {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
int screenWidth = (int) screenSize.getWidth();
int screenHeight = (int) screenSize.getHeight();
settings.setResolution(screenWidth, screenHeight);
settings.setFullscreen(true);
} else {
settings.setWidth(prefs.getInt("width", 1280));
settings.setHeight(prefs.getInt("height", 720));
}
settings.setCenterWindow(true);
int width = (int)(1280 * resolutionFactor);
int height = (int)(720 * resolutionFactor);
settings.setWidth(width);
settings.setHeight(height);
settings.setVSync(false);
settings.setTitle("MDGA");
settings.setVSync(true);
MdgaApp app = new MdgaApp();
app.setSettings(settings);
app.setShowSettings(false);
app.setPauseOnLostFocus(false);
app.setDisplayStatView(false);
try {
if (!System.getProperty("os.name").toLowerCase().contains("mac")) {
settings.setIcons(new BufferedImage[]{
ImageIO.read(Objects.requireNonNull(Thread.currentThread().getContextClassLoader().getResourceAsStream("Images/icon/icon128.png")))
});
}
} catch (IOException e) {
System.out.println(e.getMessage());
}
app.start();
}
/**
* Initializes the application by setting up handlers, views, and entering the default state.
*/
@Override
public void simpleInitApp() {
animationHandler = new AnimationHandler(this);
acousticHandler = new AcousticHandler(this);
notificationSynchronizer = new NotificationSynchronizer(this);
inputSyncronizer = new InputSyncronizer(this);
modelSyncronizer = new ModelSyncronizer(this);
inputManager.deleteMapping("SIMPLEAPP_Exit");
inputManager.deleteMapping("FLYCAM_ZoomIn");
inputManager.deleteMapping("FLYCAM_ZoomOut");
inputManager.deleteMapping("FLYCAM_RotateDrag");
flyCam.setEnabled(false);
GuiGlobals.initialize(this);
enter(state);
inputManager.deleteMapping("SIMPLEAPP_Exit");
flyCam.setEnabled(false);
acousticHandler = new AcousticHandler(this);
notificationSynchronizer = new NotificationSynchronizer(this);
inputSynchronizer = new InputSynchronizer(this);
modelSynchronizer = new ModelSynchronizer(this);
mainView = new MainView(this);
lobbyView = new LobbyView(this);
gameView = new GameView(this);
ceremonyView = new CeremonyView(this);
enter(MdgaState.MAIN);
}
/**
* Updates the application on each frame. Updates the view, acoustic handler, and notifications.
*
* @param tpf time per frame, used for smooth updating
*/
@Override
public void simpleUpdate(float tpf) {
view.update();
view.update(tpf);
acousticHandler.update();
notificationSynchronizer.update();
inputSynchronizer.update(tpf);
timerManager.update(tpf);
}
/**
* Transitions the application to a new state.
*
* @param state the new state to enter
* @throws RuntimeException if attempting to enter the {@link MdgaState#NONE} state
*/
public void enter(MdgaState state) {
if(null != view) {
if (null != view) {
view.leave();
}
@@ -72,19 +203,20 @@ public void enter(MdgaState state) {
switch (state) {
case MAIN:
view = new MainView(this);
view = mainView;
clientGameLogic = new ClientGameLogic(networkConnection);
break;
case LOBBY:
view = new LobbyView(this);
view = lobbyView;
break;
case GAME:
view = new GameView(this);
view = gameView;
break;
case CEREMONY:
view = new CeremonyView(this);
view = ceremonyView;
break;
case NONE:
throw new RuntimeException("cant enter state NONE");
throw new RuntimeException("Cannot enter state NONE");
}
acousticHandler.playState(state);
@@ -92,31 +224,209 @@ public void enter(MdgaState state) {
view.enter();
}
public void afteGameCleanup() {
//TODO
}
public AnimationHandler getAnimationHandler() {
return animationHandler;
}
/**
* Gets the acoustic handler.
*
* @return the {@link AcousticHandler} instance
*/
public AcousticHandler getAcousticHandler() {
return acousticHandler;
}
public MdgaState getState() {return state; }
public float getResolutionFactor() {
return resolutionFactor;
/**
* Gets the current state of the application.
*
* @return the current {@link MdgaState}
*/
public MdgaState getState() {
return state;
}
/**
* Gets the image scaling factor.
*
* @return the image scale as a float
*/
public float getImageScale() {
return imageScale;
}
/**
* Gets the currently active view.
*
* @return the active {@link MdgaView}
*/
public MdgaView getView() {
return view;
}
public ModelSyncronizer getModelSyncronizer() {
return modelSyncronizer;
/**
* Gets the model synchronizer.
*
* @return the {@link ModelSynchronizer} instance
*/
public ModelSynchronizer getModelSynchronize() {
return modelSynchronizer;
}
public InputSyncronizer getInputSyncronizer() { return inputSyncronizer; }
/**
* Gets the input synchronizer.
*
* @return the {@link InputSynchronizer} instance
*/
public InputSynchronizer getInputSynchronize() {
return inputSynchronizer;
}
/**
* Gets the notification synchronizer.
*
* @return the {@link NotificationSynchronizer} instance
*/
public NotificationSynchronizer getNotificationSynchronizer() {
return notificationSynchronizer;
}
/**
* Prepares the app for a new game cycle.
*/
public void setup() {
}
/**
* Gets the client game logic.
*
* @return the {@link ClientGameLogic} instance
*/
public ClientGameLogic getGameLogic() {
return clientGameLogic;
}
/**
* Gets the executor service.
*
* @return the {@link ExecutorService} instance
*/
public ExecutorService getExecutor() {
if (this.executor == null) {
this.executor = Executors.newCachedThreadPool();
}
return this.executor;
}
/**
* Gets the network connection.
*
* @return the {@link ServerConnection} instance
*/
public ServerConnection getNetworkSupport() {
return networkConnection;
}
/**
* Updates the resolution settings.
*
* @param width the new width
* @param height the new height
* @param imageFactor the new image factor
* @param isFullscreen whether the game is in fullscreen mode
*/
public void updateResolution(int width, int height, float imageFactor, boolean isFullscreen) {
if (isFullscreen) {
int baseWidth = 1280;
int baseHeight = 720;
float baseAspectRatio = (float) baseWidth / baseHeight;
float newAspectRatio = (float) width / height;
float scaleFactor = Math.max((float) width / baseWidth, (float) height / baseHeight);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
int screenWidth = (int) screenSize.getWidth();
int screenHeight = (int) screenSize.getHeight();
settings.setResolution(screenWidth, screenHeight);
settings.setFullscreen(true);
prefs.putFloat("scale", scaleFactor);
prefs.putBoolean("fullscreen", true);
} else {
prefs.putInt("width", width);
prefs.putInt("height", height);
prefs.putFloat("scale", imageFactor);
prefs.putBoolean("fullscreen", false);
}
}
/**
* Restarts the application.
*/
public static void restartApp() {
try {
String javaBin = System.getProperty("java.home") + "/bin/java";
String classPath = System.getProperty("java.class.path");
String className = System.getProperty("sun.java.command");
ProcessBuilder builder = new ProcessBuilder(
javaBin, "-cp", classPath, className
);
builder.start();
System.exit(0);
} catch (Exception e) {
throw new RuntimeException("restart failed");
}
}
/**
* Cleans up the application after a game.
*/
public void afterGameCleanup() {
MainView main = (MainView) mainView;
main.getJoinDialog().disconnect();
if (clientGameLogic.isHost()) {
main.getHostDialog().shutdownServer();
}
ceremonyView.afterGameCleanup();
}
/**
* Gets the game view.
*
* @return the {@link GameView} instance
*/
public GameView getGameView() {
return gameView;
}
/**
* Gets the timer manager.
*
* @return the {@link TimerManager} instance
*/
public TimerManager getTimerManager() {
return timerManager;
}
/**
* Gets the ceremony view.
*
* @return the {@link CeremonyView} instance
*/
public CeremonyView getCeremonyView() {
return ceremonyView;
}
@Override
public void destroy() {
afterGameCleanup();
if (executor != null) {
executor.shutdown();
}
super.destroy();
}
}

View File

@@ -1,9 +1,35 @@
package pp.mdga.client;
/**
* Enum representing the various states of the MdgaApp application.
* Each state corresponds to a distinct phase or mode of the application.
*/
public enum MdgaState {
/**
* Represents an undefined or uninitialized state.
* This state should not be entered during normal application execution.
*/
NONE,
/**
* Represents the main menu state.
* This is typically the first state entered when the application starts.
*/
MAIN,
/**
* Represents the lobby state where players can prepare or wait before starting a game.
*/
LOBBY,
/**
* Represents the main gameplay state where the core game mechanics take place.
*/
GAME,
/**
* Represents the ceremony state, typically used for post-game events or celebrations.
*/
CEREMONY;
}

View File

@@ -0,0 +1,243 @@
package pp.mdga.client;
import pp.mdga.client.view.GameView;
import pp.mdga.game.BonusCard;
import pp.mdga.game.Color;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* The ModelSynchronizer class is responsible for synchronizing the model state with the view and game logic.
*/
public class ModelSynchronizer {
private static final Logger LOGGER = Logger.getLogger(ModelSynchronizer.class.getName());
private MdgaApp app;
private UUID a;
private UUID b;
private BonusCard card;
private boolean swap;
/**
* Constructor for ModelSynchronizer.
*
* @param app the MdgaApp instance
*/
ModelSynchronizer(MdgaApp app) {
this.app = app;
swap = false;
}
/**
* Handles the end of an animation.
*/
public void animationEnd() {
if (app.getNotificationSynchronizer().waitForAnimation) {
app.getNotificationSynchronizer().waitForAnimation = false;
} else {
app.getGameLogic().selectAnimationEnd();
}
}
/**
* Selects a piece or swap based on the current state.
*
* @param a the first UUID
* @param b the second UUID
*/
public void select(UUID a, UUID b) {
if (swap) selectSwap(a, b);
else selectPiece(a);
}
/**
* Selects a swap between two pieces.
*
* @param a the first UUID
* @param b the second UUID
*/
public void selectSwap(UUID a, UUID b) {
LOGGER.log(Level.INFO, "selectPiece");
this.a = a;
this.b = b;
GameView gameView = (GameView) app.getView();
if (a != null && b != null) {
gameView.needConfirm();
} else {
gameView.noConfirm();
}
}
/**
* Selects a single piece.
*
* @param piece the UUID of the piece
*/
public void selectPiece(UUID piece) {
LOGGER.log(Level.INFO, "selectPiece");
this.a = piece;
GameView gameView = (GameView) app.getView();
if (piece != null) {
gameView.needConfirm();
} else {
gameView.noConfirm();
}
}
/**
* Selects a bonus card.
*
* @param card the BonusCard instance
*/
public void selectCard(BonusCard card) {
LOGGER.log(Level.INFO, "selectCard");
this.card = card;
GameView gameView = (GameView) app.getView();
if (card != null) {
gameView.needConfirm();
} else {
gameView.showNoPower();
}
}
/**
* Confirms the current selection.
*/
public void confirm() {
LOGGER.log(Level.INFO, "confirm");
GameView gameView = (GameView) app.getView();
gameView.getGuiHandler().hideText();
if (a != null && b != null) {
app.getGameLogic().selectPiece(a);
app.getGameLogic().selectPiece(b);
gameView.getBoardHandler().clearSelectable();
} else if (a != null) {
app.getGameLogic().selectPiece(a);
gameView.getBoardHandler().clearSelectable();
} else {
app.getGameLogic().selectCard(card);
gameView.getGuiHandler().clearSelectableCards();
}
a = null;
b = null;
card = null;
gameView.noConfirm();
gameView.hideNoPower();
}
/**
* Selects a TSK color.
*
* @param color the Color instance
*/
public void selectTsk(Color color) {
app.getGameLogic().selectTsk(color);
}
/**
* Unselects a TSK color.
*
* @param color the Color instance
*/
public void unselectTsk(Color color) {
app.getGameLogic().deselectTSK(color);
}
/**
* Handles the event of rolling dice.
*/
public void rolledDice() {
app.getGameLogic().selectDice();
}
/**
* Sets the player's name.
*
* @param name the player's name
*/
public void setName(String name) {
LOGGER.log(Level.INFO, "setName: {0}", name);
app.getGameLogic().selectName(name);
}
/**
* Sets the player's ready status.
*
* @param ready the ready status
*/
public void setReady(boolean ready) {
app.getGameLogic().selectReady(ready);
}
/**
* Sets the host port.
*
* @param port the host port
*/
public void setHost(int port) {
app.getGameLogic().selectJoin("");
}
/**
* Sets the join IP and port.
*
* @param ip the IP address
* @param port the port number
*/
public void setJoin(String ip, int port) {
app.getGameLogic().selectJoin(ip);
}
/**
* Handles the event of leaving the game.
*/
public void leave() {
app.getGameLogic().selectLeave();
}
/**
* Enters a specific game state.
*
* @param state the MdgaState instance
*/
public void enter(MdgaState state) {
LOGGER.log(Level.INFO, "enter: {0}", state);
//app.enter(state);
}
/**
* Proceeds to the next game state.
*/
public void next() {
app.getGameLogic().selectNext();
}
/**
* Sets the swap state.
*
* @param swap the swap state
*/
public void setSwap(boolean swap) {
this.swap = swap;
}
/**
* Forces an action.
*/
public void force() {
// Implementation needed
}
}

View File

@@ -1,72 +0,0 @@
package pp.mdga.client;
import pp.mdga.client.view.LobbyView;
import pp.mdga.game.Color;
public class ModelSyncronizer {
private MdgaApp app;
ModelSyncronizer(MdgaApp app) {
this.app = app;
}
public void selectPiece() {
//TODO call from somewhere
System.out.println("selectPiece");
}
public void selectCard() {
//TODO call from somewhere
System.out.println("selectCard");
}
public void selectTsk(Color color) {
//TODO call from somewhere
System.out.println("selectTsk: " + color);
LobbyView view = (LobbyView) app.getView();
view.setTaken(color, true, true, "OwnPlayerName");
}
public void unselectTsk() {
//TODO call from somewhere
System.out.println("unselectTsk");
}
public void rolledDice() {
//TODO call from somewhere
System.out.println("rolledDice");
}
public void setName(String name) {
//TODO call from somewhere
System.out.println("setName:" + name);
}
public void setReady() {
//TODO call from somewhere
System.out.println("setReady");
app.enter(MdgaState.GAME);
}
public void setHost(int port) {
//TODO call from somewhere
System.out.println("setHost: " + port);
app.enter(MdgaState.LOBBY);
}
public void setJoin(String ip, int port) {
//TODO call from somewhere
System.out.println("setJoin");
app.enter(MdgaState.LOBBY);
}
public void leave() {
System.out.println("leave");
app.enter(MdgaState.MAIN);
}
public void enter(MdgaState state) {
System.out.println("enter:" + state);
app.enter(state);
}
}

View File

@@ -0,0 +1,147 @@
package pp.mdga.client;
import com.jme3.network.*;
import pp.mdga.message.client.ClientMessage;
import pp.mdga.message.server.ServerMessage;
import java.io.IOException;
/**
* The NetworkSupport class provides support for network communication between the client and server.
* It implements the MessageListener and ClientStateListener interfaces to handle incoming messages
* and client state changes, respectively.
*/
public class NetworkSupport implements MessageListener<Client>, ClientStateListener, ServerConnection {
private static final System.Logger LOGGER = System.getLogger(NetworkSupport.class.getName());
private final MdgaApp app;
private Client client;
/**
* Constructor for NetworkSupport.
*
* @param app the MdgaApp instance
*/
public NetworkSupport(MdgaApp app) {
this.app = app;
}
/**
* Returns the MdgaApp instance.
*
* @return the MdgaApp instance
*/
public MdgaApp getApp() {
return this.app;
}
/**
* Returns whether the client is connected to the server.
*
* @return true if the client is connected, false otherwise
*/
public boolean isConnected() {
return this.client != null && this.client.isConnected();
}
/**
* Connects the client to the server.
*/
public void connect() {
if (this.client != null) {
throw new IllegalStateException("trying to join a game again");
} else {
try {
this.initNetwork("localhost", 2345);
} catch (IOException e) {
LOGGER.log(System.Logger.Level.ERROR, "could not connect to server", e);
}
}
}
/**
* Disconnects the client from the server.
*/
public void disconnect() {
if (this.client != null) {
this.client.close();
this.client = null;
LOGGER.log(System.Logger.Level.INFO, "client closed");
}
}
/**
* Initializes the network connection to the server.
*
* @param host the server host
* @param port the server port
* @throws IOException if an I/O error occurs
*/
public void initNetwork(String host, int port) throws IOException {
if (this.client != null) {
throw new IllegalStateException("trying to join a game again");
} else {
this.client = Network.connectToServer(host, port);
this.client.start();
this.client.addMessageListener(this);
this.client.addClientStateListener(this);
}
}
/**
* Handles incoming messages from the server.
*
* @param client the client
* @param message the message
*/
public void messageReceived(Client client, Message message) {
LOGGER.log(System.Logger.Level.INFO, "message received from server: {0}", new Object[]{message});
if (message instanceof ServerMessage serverMessage) {
this.app.enqueue(() -> serverMessage.accept(this.app.getGameLogic()));
}
}
/**
* Handles client connection to the server.
*
* @param client the client
*/
public void clientConnected(Client client) {
LOGGER.log(System.Logger.Level.INFO, "Client connected: {0}", new Object[]{client});
}
/**
* Handles client disconnection from the server.
*
* @param client the client
* @param disconnectInfo the disconnect information
*/
public void clientDisconnected(Client client, ClientStateListener.DisconnectInfo disconnectInfo) {
LOGGER.log(System.Logger.Level.INFO, "Client {0} disconnected: {1}", new Object[]{client, disconnectInfo});
if (this.client != client) {
throw new IllegalArgumentException("parameter value must be client");
} else {
LOGGER.log(System.Logger.Level.INFO, "client still connected: {0}", new Object[]{client.isConnected()});
this.client = null;
this.disconnect();
}
}
/**
* Sends a message to the server.
*
* @param message the message
*/
@Override
public void send(ClientMessage message) {
LOGGER.log(System.Logger.Level.INFO, "sending {0}", new Object[]{message});
if (this.client == null) {
LOGGER.log(System.Logger.Level.WARNING, "client not connected");
} else {
this.client.send(message);
}
}
}

View File

@@ -1,136 +1,298 @@
package pp.mdga.client;
import com.jme3.system.NanoTimer;
import pp.mdga.client.acoustic.MdgaSound;
import pp.mdga.client.board.BoardHandler;
import pp.mdga.client.gui.GuiHandler;
import pp.mdga.client.view.CeremonyView;
import pp.mdga.client.view.GameView;
import pp.mdga.client.view.LobbyView;
import pp.mdga.game.BonusCard;
import pp.mdga.game.Color;
import pp.mdga.notification.*;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
/**
* The NotificationSynchronizer class is responsible for handling and synchronizing notifications
* received from the game logic and updating the application state accordingly.
*/
public class NotificationSynchronizer {
private final MdgaApp app;
private ArrayList<Notification> notifications = new ArrayList<>();
private NanoTimer timer = new NanoTimer();
private float delay = 0;
private static final float STANDARD_DELAY = 2.5f;
public boolean waitForAnimation = false;
/**
* Constructs a NotificationSynchronizer with the specified MdgaApp instance.
*
* @param app the MdgaApp instance
*/
NotificationSynchronizer(MdgaApp app) {
this.app = app;
}
public void addTestNotification(Notification n) {
notifications.add(n);
}
/**
* Updates the notification synchronizer by processing notifications from the game logic.
* Handles different types of notifications based on the current application state.
*/
public void update() {
//TODO fetch model notifications
while (timer.getTimeInSeconds() >= delay) {
if (waitForAnimation) {
return;
}
for (Notification n : notifications) {
switch (app.getState()) {
case MAIN:
handleMain(n);
break;
case LOBBY:
handleLobby(n);
break;
case GAME:
handleGame(n);
break;
case CEREMONY:
handleCeremony(n);
break;
case NONE:
throw new RuntimeException("no notification expected: " + n.toString());
Notification n = app.getGameLogic().getNotification();
if (n == null) {
return;
}
System.out.println("receive notification:" + n.getClass().getName());
timer.reset();
delay = 0;
if (n instanceof InfoNotification infoNotification) {
app.getView().showInfo(infoNotification.getMessage(), infoNotification.isError());
return;
}
if (n != null) {
switch (app.getState()) {
case MAIN:
handleMain(n);
break;
case LOBBY:
handleLobby(n);
break;
case GAME:
handleGame(n);
break;
case CEREMONY:
handleCeremony(n);
break;
case NONE:
throw new RuntimeException("no notification expected: " + n.getClass().getName());
}
if (0 == MdgaApp.DEBUG_MULTIPLIER) {
delay = 0;
}
}
}
}
/**
* Handles notifications when the application is in the MAIN state.
*
* @param notification the notification to handle
*/
private void handleMain(Notification notification) {
if (notification instanceof LobbyDialogNotification) {
app.enter(MdgaState.LOBBY);
} else if (notification instanceof StartDialogNotification) {
//nothing
} else {
throw new RuntimeException("notification not expected: " + notification.toString());
throw new RuntimeException("notification not expected in main: " + notification.getClass().getName());
}
}
/**
* Handles notifications when the application is in the LOBBY state.
*
* @param notification the notification to handle
*/
private void handleLobby(Notification notification) {
LobbyView lobbyView = (LobbyView) app.getView();
if (notification instanceof TskSelectNotification) {
TskSelectNotification n = (TskSelectNotification)notification;
if (notification instanceof TskSelectNotification n) {
lobbyView.setTaken(n.getColor(), true, n.isSelf(), n.getName());
} else if (notification instanceof TskUnselectNotification) {
TskUnselectNotification n = (TskUnselectNotification)notification;
} else if (notification instanceof StartDialogNotification) {
app.afterGameCleanup();
app.enter(MdgaState.MAIN);
} else if (notification instanceof TskUnselectNotification n) {
lobbyView.setTaken(n.getColor(), false, false, null);
} else if (notification instanceof GameNotification) {
} else if (notification instanceof LobbyReadyNotification lobbyReadyNotification) {
lobbyView.setReady(lobbyReadyNotification.getColor(), lobbyReadyNotification.isReady());
} else if (notification instanceof GameNotification n) {
app.getGameView().setOwnColor(n.getOwnColor());
app.enter(MdgaState.GAME);
} else {
throw new RuntimeException("notification not expected: " + notification.toString());
throw new RuntimeException("notification not expected in lobby: " + notification.getClass().getName());
}
}
/**
* Handles notifications when the application is in the GAME state.
*
* @param notification the notification to handle
*/
private void handleGame(Notification notification) {
GameView gameView = (GameView) app.getView();
GuiHandler guiHandler = gameView.getGuiHandler();
BoardHandler boardHandler = gameView.getBoardHandler();
ModelSynchronizer modelSynchronizer = app.getModelSynchronize();
Color ownColor = gameView.getOwnColor();
if (notification instanceof AcquireCardNotification) {
// Handle AcquireCardNotification
} else if (notification instanceof ActivePlayerNotification) {
// Handle ActivePlayerNotification
} else if (notification instanceof CeremonyNotification) {
if (notification instanceof AcquireCardNotification n) {
guiHandler.addCardOwn(n.getBonusCard());
app.getAcousticHandler().playSound(MdgaSound.BONUS);
delay = STANDARD_DELAY;
} else if (notification instanceof RankingResponceNotification n) {
guiHandler.hideText();
n.getRankingResults().forEach((c, i) -> {
guiHandler.rollRankingResult(c, i);
});
delay = STANDARD_DELAY;
} else if (notification instanceof ActivePlayerNotification n) {
guiHandler.hideText();
boardHandler.hideDice();
gameView.getGuiHandler().setActivePlayer(n.getColor());
if (n.getColor() != ownColor) boardHandler.showDice(n.getColor());
app.getAcousticHandler().playSound(MdgaSound.UI90);
delay = STANDARD_DELAY;
} else if (notification instanceof CeremonyNotification ceremonyNotification) {
CeremonyView ceremonyView = app.getCeremonyView();
int size = ceremonyNotification.getNames().size();
if (ceremonyNotification.getPiecesThrown().size() != size ||
ceremonyNotification.getPiecesLost().size() != size ||
ceremonyNotification.getBonusCardsPlayed().size() != size ||
ceremonyNotification.getSixes().size() != size ||
ceremonyNotification.getNodesMoved().size() != size ||
ceremonyNotification.getBonusNodes().size() != size) {
throw new IllegalArgumentException("All data lists in CeremonyNotification must have the same size.");
}
for (int i = 0; i < size; i++) {
Color color = ceremonyNotification.getColors().get(i);
String name = ceremonyNotification.getNames().get(i);
int v1 = ceremonyNotification.getPiecesThrown().get(i);
int v2 = ceremonyNotification.getPiecesLost().get(i);
int v3 = ceremonyNotification.getBonusCardsPlayed().get(i);
int v4 = ceremonyNotification.getSixes().get(i);
int v5 = ceremonyNotification.getNodesMoved().get(i);
int v6 = ceremonyNotification.getBonusNodes().get(i);
if(i < size - 1) {
ceremonyView.addCeremonyParticipant(color, i + 1, name);
}
ceremonyView.addStatisticsRow(name, v1, v2, v3, v4, v5, v6);
}
app.enter(MdgaState.CEREMONY);
} else if (notification instanceof DiceNowNotification) {
// Handle DiceNowNotification
} else if (notification instanceof DicingNotification) {
// Handle DicingNotification
} else if (notification instanceof DrawCardNotification) {
// Handle DrawCardNotification
} else if (notification instanceof HomeMoveNotification) {
HomeMoveNotification n = (HomeMoveNotification)notification;
gameView.getBoardHandler().moveHomePiece(n.getPieceId(), n.getHomeIndex());
} else if (notification instanceof InterruptNotification) {
// Handle InterruptNotification
} else if (notification instanceof MovePieceNotification) {
MovePieceNotification n = (MovePieceNotification)notification;
//gameView.getBoardHandler().movePiece(n.get); //TODO
} else if (notification instanceof MoveThrowPieceNotification) {
MoveThrowPieceNotification n = (MoveThrowPieceNotification)notification;
//gameView.getBoardHandler().throwPiece(n.); //TODO
} else if (notification instanceof NoShieldNotification) {
NoShieldNotification n = (NoShieldNotification)notification;
gameView.getBoardHandler().unshieldPiece(n.getPieceId());
} else if (notification instanceof PieceInGameNotification) {
// Handle PieceInGameNotification
} else if (notification instanceof PlayCardNotification) {
// Handle PlayCardNotification
} else if (notification instanceof PlayerInGameNotification) {
// Handle PlayerInGameNotification
guiHandler.hideText();
guiHandler.showDice();
} else if (notification instanceof DrawCardNotification n) {
app.getAcousticHandler().playSound(MdgaSound.BONUS);
guiHandler.drawCard(n.getColor());
delay = STANDARD_DELAY;
} else if (notification instanceof HomeMoveNotification home) {
boardHandler.movePieceHome(home.getPieceId(), home.getHomeIndex());
guiHandler.hideText();
waitForAnimation = true;
} else if (notification instanceof InterruptNotification notification1) {
gameView.enterInterrupt(notification1.getColor());
} else if (notification instanceof MovePieceNotification n) {
if (n.isMoveStart()) {
//StartMove
boardHandler.movePieceStart(n.getPiece(), n.getMoveIndex());
waitForAnimation = true;
} else {
//InfieldMove
boardHandler.movePiece(n.getPiece(), n.getStartIndex(), n.getMoveIndex());
waitForAnimation = true;
}
guiHandler.hideText();
} else if (notification instanceof ThrowPieceNotification n) {
boardHandler.throwPiece(n.getPieceId(), n.getThrowColor());
waitForAnimation = true;
} else if (notification instanceof RemoveShieldNotification n) {
boardHandler.unshieldPiece(n.getPieceUuid());
} else if (notification instanceof PlayCardNotification n) {
if (n.getCard() == BonusCard.TURBO) {
app.getAcousticHandler().playSound(MdgaSound.TURBO);
guiHandler.turbo();
} else if (n.getCard() == BonusCard.SHIELD) {
app.getAcousticHandler().playSound(MdgaSound.SHIELD);
} else if (n.getCard() == BonusCard.SWAP) {
app.getAcousticHandler().playSound(MdgaSound.SWAP);
}
if (n.getColor() == ownColor) guiHandler.playCardOwn(n.getCard());
else guiHandler.playCardEnemy(n.getColor(), n.getCard());
app.getTimerManager().addTask(
2.2f * MdgaApp.DEBUG_MULTIPLIER,
app.getModelSynchronize()::animationEnd
);
} else if (notification instanceof PlayerInGameNotification n) {
boardHandler.addPlayer(n.getColor(), n.getPiecesList());
guiHandler.addPlayer(n.getColor(), n.getName());
} else if (notification instanceof ResumeNotification) {
// Handle ResumeNotification
} else if (notification instanceof RollDiceNotification) {
// Handle RollDiceNotification
} else if (notification instanceof SelectableCardsNotification) {
// Handle SelectableCardsNotification
} else if (notification instanceof SelectablePiecesNotification) {
// Handle SelectablePiecesNotification
} else if (notification instanceof ShieldActiveNotification) {
ShieldActiveNotification n = (ShieldActiveNotification)notification;
gameView.getBoardHandler().shieldPiece(n.getPieceId());
} else if (notification instanceof ShieldSuppressedNotification) {
ShieldSuppressedNotification n = (ShieldSuppressedNotification)notification;
gameView.getBoardHandler().suppressShield(n.getPieceId());
gameView.leaveInterrupt();
} else if (notification instanceof RollDiceNotification n) {
gameView.getGuiHandler().hideText();
if (n.getColor() == ownColor) {
guiHandler.rollDice(n.getEyes(), n.isTurbo() ? n.getMultiplier() : -1);
waitForAnimation = true;
} else {
if (n.isTurbo()) guiHandler.showRolledDiceMult(n.getEyes(), n.getMultiplier(), n.getColor());
else guiHandler.showRolledDice(n.getEyes(), n.getColor());
}
} else if (notification instanceof SelectableCardsNotification n) {
guiHandler.setSelectableCards(n.getCards());
gameView.showNoPower();
} else if (notification instanceof ShieldActiveNotification n) {
boardHandler.shieldPiece(n.getPieceId());
} else if (notification instanceof ShieldSuppressedNotification n) {
boardHandler.suppressShield(n.getPieceId());
} else if (notification instanceof StartDialogNotification) {
app.afterGameCleanup();
app.enter(MdgaState.MAIN);
} else if (notification instanceof SwapPieceNotification) {
// Handle SwapPieceNotification
} else if (notification instanceof SwapPieceNotification n) {
boardHandler.swapPieces(n.getFirstPiece(), n.getSecondPiece());
guiHandler.swap();
} else if (notification instanceof WaitMoveNotification) {
// Handle WaitMoveNotification
//nothing
} else if (notification instanceof SelectableMoveNotification n) {
boardHandler.setSelectableMove(n.getPieces(), n.getMoveIndices(), n.getHomeMoves());
modelSynchronizer.setSwap(false);
} else if (notification instanceof SelectableSwapNotification n) {
boardHandler.setSelectableSwap(n.getOwnPieces(), n.getEnemyPieces());
modelSynchronizer.setSwap(true);
} else if (notification instanceof SelectableShieldNotification n) {
boardHandler.setSelectableShield(n.getPieces());
modelSynchronizer.setSwap(false);
} else if (notification instanceof TurboActiveNotification) {
//nothing
} else if (notification instanceof FinishNotification n) {
guiHandler.finish(n.getColorFinished());
} else {
throw new RuntimeException("notification not expected: " + notification.toString());
throw new RuntimeException("notification not expected in game: " + notification.getClass().getName());
}
}
/**
* Handles notifications when the application is in the CEREMONY state.
*
* @param notification the notification to handle
*/
private void handleCeremony(Notification notification) {
if (notification instanceof StartDialogNotification) {
app.afterGameCleanup();
app.enter(MdgaState.MAIN);
} else {
throw new RuntimeException("notification not expected: " + notification.toString());
throw new RuntimeException("notification not expected in ceremony: " + notification.getClass().getName());
}
}
}

View File

@@ -0,0 +1,48 @@
package pp.mdga.client;
import com.jme3.math.Vector3f;
public class Util {
private Util() {
}
/**
* Performs linear interpolation between two values.
*
* @param start The starting value.
* @param end The ending value.
* @param t A parameter between 0 and 1 representing the interpolation progress.
* @return The interpolated value.
*/
public static float linInt(float start, float end, float t) {
return start + t * (end - start);
}
/**
* Performs quadratic interpolation between three points.
*
* @param p1 The initial point.
* @param p2 The middle point.
* @param p3 The final point.
* @param t The interpolation parameter (0 <= t <= 1).
* @return The interpolated point.
*/
public static Vector3f quadInt(Vector3f p1, Vector3f p2, Vector3f p3, float t) {
// Quadratic interpolation: (1-t)^2 * p1 + 2 * (1-t) * t * p2 + t^2 * p3
float oneMinusT = 1 - t;
return p1.mult(oneMinusT * oneMinusT)
.add(p2.mult(2 * oneMinusT * t))
.add(p3.mult(t * t));
}
/**
* A smooth ease-in-out function for interpolation.
* It accelerates and decelerates the interpolation for a smoother effect.
*
* @param x The interpolation parameter (0 <= x <= 1).
* @return The adjusted interpolation value.
*/
public static float easeInOut(float x) {
return x < 0.5 ? 4 * x * x * x : (float) (1 - Math.pow(-2 * x + 2, 3) / 2);
}
}

View File

@@ -4,7 +4,11 @@
import pp.mdga.client.MdgaApp;
import pp.mdga.client.MdgaState;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.Random;
import java.util.prefs.Preferences;
public class AcousticHandler {
private MdgaApp app;
@@ -17,20 +21,30 @@ public class AcousticHandler {
private boolean fading = false; // Indicates if a fade is in progress
private NanoTimer fadeTimer = new NanoTimer(); // Timer to track fade progress
private static final float FADE_DURATION = 3.0f; // Duration for outfade
private static final float FADE_DURATION = 2.0f; // Duration for outfade
private static final float CROSSFADE_DURATION = 1.5f; // Duration for infade
private GameMusic playing = null; // Currently playing track
private GameMusic scheduled = null; // Scheduled track to play next
private GameMusic old = null; // Old track being faded out
private float mainVolume = 1.0f;
private GameMusic birds;
private float mainVolume = 0.0f;
private float musicVolume = 1.0f;
private float soundVolume = 1.0f;
private ArrayList<GameSound> sounds = new ArrayList<>();
private Preferences prefs = Preferences.userNodeForPackage(AcousticHandler.class);
public AcousticHandler(MdgaApp app) {
this.app = app;
mainVolume = prefs.getFloat("mainVolume", 1.0f);
musicVolume = prefs.getFloat("musicVolume", 1.0f);
soundVolume = prefs.getFloat("soundVolume", 1.0f);
birds = new GameMusic(app, MusicAsset.BIRDS, getSoundVolumeTotal(), MusicAsset.BIRDS.getSubVolume(), MusicAsset.BIRDS.getLoop(), 0.0f);
}
/**
@@ -53,6 +67,8 @@ public void update() {
iterator.remove();
}
}
birds.update(Math.min(getSoundVolumeTotal(), getMusicVolumeTotal() > 0 ? 0 : 1));
}
/**
@@ -67,10 +83,84 @@ public void playSound(MdgaSound sound) {
assets.add(new SoundAssetDelayVolume(SoundAsset.LOST, 1.0f, 0.0f));
break;
case VICTORY:
assets.add(new SoundAssetDelayVolume(SoundAsset.VICTORY, 1.0f, 2.0f));
assets.add(new SoundAssetDelayVolume(SoundAsset.VICTORY, 1.0f, 0.0f));
break;
case BUTTON_PRESSED:
assets.add(new SoundAssetDelayVolume(SoundAsset.BUTTON_PRESS, 0.7f, 0.0f));
break;
case WRONG_INPUT:
assets.add(new SoundAssetDelayVolume(SoundAsset.ERROR, 1.0f, 0.0f));
break;
case UI_CLICK:
assets.add(new SoundAssetDelayVolume(SoundAsset.UI_CLICK, 0.8f, 0.0f));
break;
case START:
assets.add(new SoundAssetDelayVolume(SoundAsset.START, 0.8f, 0.5f));
break;
case THROW:
assets.add(new SoundAssetDelayVolume(SoundAsset.LAUGHT, 1.0f, 0.2f));
break;
case POWERUP:
assets.add(new SoundAssetDelayVolume(SoundAsset.POWERUP, 1.0f, 0.2f));
break;
case SELF_READY:
assets.add(new SoundAssetDelayVolume(SoundAsset.ROBOT_READY, 1.0f, 0.0f));
break;
case OTHER_READY:
assets.add(new SoundAssetDelayVolume(SoundAsset.UNIT_READY, 1.0f, 0.0f));
break;
case OTHER_CONNECTED:
assets.add(new SoundAssetDelayVolume(SoundAsset.CONNECTED, 1.0f, 0.0f));
break;
case NOT_READY:
assets.add(new SoundAssetDelayVolume(SoundAsset.UI_SOUND, 1.0f, 0.0f));
break;
case LEAVE:
assets.add(new SoundAssetDelayVolume(SoundAsset.UI_SOUND2, 0.6f, 0.0f));
break;
case JET:
assets.add(new SoundAssetDelayVolume(SoundAsset.JET, 1.0f, 0.0f));
break;
case EXPLOSION:
assets.add(new SoundAssetDelayVolume(SoundAsset.EXPLOSION_1, 1.0f, 0f));
assets.add(new SoundAssetDelayVolume(SoundAsset.EXPLOSION_2, 1.0f, 0f));
assets.add(new SoundAssetDelayVolume(SoundAsset.THUNDER, 1.0f, 0f));
break;
case LOSE:
assets.add(new SoundAssetDelayVolume(SoundAsset.LOSE, 1.0f, 0.0f));
break;
case BONUS:
assets.add(new SoundAssetDelayVolume(SoundAsset.BONUS, 1.0f, 0.0f));
break;
case UI90:
assets.add(new SoundAssetDelayVolume(SoundAsset.UI90, 1.0f, 0.0f));
break;
case MISSILE:
assets.add(new SoundAssetDelayVolume(SoundAsset.MISSILE, 1.0f, 0.0f));
break;
case MATRIX:
assets.add(new SoundAssetDelayVolume(SoundAsset.MATRIX, 1.0f, 0.0f));
break;
case TURRET_ROTATE:
assets.add(new SoundAssetDelayVolume(SoundAsset.TURRET_ROTATE, 0.7f, 0f));
break;
case TANK_SHOOT:
assets.add(new SoundAssetDelayVolume(SoundAsset.TANK_SHOOT, 0.7f, 0f));
break;
case TANK_EXPLOSION:
assets.add(new SoundAssetDelayVolume(SoundAsset.EXPLOSION_1, 1.0f, 0f));
break;
case SHIELD:
assets.add(new SoundAssetDelayVolume(SoundAsset.SHIELD, 1.0f, 0f));
break;
case TURBO:
assets.add(new SoundAssetDelayVolume(SoundAsset.SPEED, 1.0f, 0.1f));
assets.add(new SoundAssetDelayVolume(SoundAsset.SPEED, 1.0f, 1.3f));
break;
case SWAP:
assets.add(new SoundAssetDelayVolume(SoundAsset.SWAP, 1.0f, 0f));
break;
default:
break;
}
@@ -91,6 +181,10 @@ public void playState(MdgaState state) {
}
MusicAsset asset = null;
birds.pause();
float pause = 0.0f;
switch (state) {
case MAIN:
playGame = false;
@@ -101,10 +195,12 @@ public void playState(MdgaState state) {
asset = MusicAsset.LOBBY;
break;
case GAME:
birds.play();
addGameTracks();
playGame = true;
assert (!gameTracks.isEmpty()) : "no more game music available";
asset = gameTracks.remove(0);
pause = 2.0f;
break;
case CEREMONY:
playGame = false;
@@ -116,7 +212,7 @@ public void playState(MdgaState state) {
assert (null != asset) : "music sceduling went wrong";
scheduled = new GameMusic(app, asset, getMusicVolumeTotal(), asset.getSubVolume(), asset.getLoop(), 0.0f);
scheduled = new GameMusic(app, asset, getMusicVolumeTotal(), asset.getSubVolume(), asset.getLoop(), pause);
}
/**
@@ -133,20 +229,20 @@ private float lerp(float start, float end, float t) {
/**
* Updates the state of audio playback, handling track transitions and volume adjustments.
*
* <p>
* This method ensures smooth transitions between tracks using fade-in and fade-out effects.
* It also handles cases where no track is playing, starting a scheduled track immediately at full volume.
* The method prioritizes the latest scheduled track if multiple scheduling occurs quickly.
*
* <p>
* Behavior:
* 1. If nothing is scheduled and no track is playing, it exits early.
* 2. If a scheduled track exists and no track is playing, the scheduled track starts immediately at full volume.
* 3. If a scheduled track exists while a track is playing, it initiates a fade-out for the currently playing track
* and prepares for the new track to fade in.
* and prepares for the new track to fade in.
* 4. If a track transition is in progress (fading), it processes the fade-out and fade-in states.
* If a new track is scheduled during this process, it interrupts the current transition and prioritizes the new track.
* If a new track is scheduled during this process, it interrupts the current transition and prioritizes the new track.
* 5. If no fading is needed and a track is playing, it ensures the track's volume is updated.
*
* <p>
* Special cases:
* - If no track is playing and a new track is scheduled, it starts the track immediately without fading.
* - If a new track is scheduled during fading, it resets the transition to prioritize the new track.
@@ -198,23 +294,23 @@ private void updateVolumeAndTrack() {
/**
* Manages the fading process during audio track transitions.
*
* <p>
* This method handles the fade-out of the currently playing (old) track, manages any pause between the fade-out
* and fade-in, and initiates the fade-in for the new track if applicable. It ensures smooth transitions between
* tracks while maintaining the correct volume adjustments.
*
* <p>
* Behavior:
* 1. **Outfade:** Gradually decreases the volume of the `old` track over the duration of `FADE_DURATION`.
* Once the outfade completes, the `old` track is paused and cleared.
* Once the outfade completes, the `old` track is paused and cleared.
* 2. **Pause Handling:** Waits for a defined pause (if applicable) before initiating the infade for the next track.
* 3. **Infade:** If a `scheduled` track exists and the outfade and pause are complete, it begins playing
* the new track (`playing`) and initiates the infade process.
*
* the new track (`playing`) and initiates the infade process.
* <p>
* Key Details:
* - The outfade volume adjustment is interpolated linearly from full volume to zero using the `lerp` function.
* - The pause duration is retrieved from the scheduled track if it is specified.
* - If a new track is scheduled during the fade process, it is handled by external logic to prioritize transitions.
*
* <p>
* Preconditions:
* - `fading` is expected to be `true` when this method is called.
* - The method is invoked as part of the `updateVolumeAndTrack` process.
@@ -250,23 +346,23 @@ private void handleFadeProcess() {
/**
* Manages the fade-in process for the currently playing track.
*
* <p>
* This method gradually increases the volume of the `playing` track from zero to full volume
* over the duration of `CROSSFADE_DURATION`. It ensures a smooth transition into the new track.
*
* <p>
* Behavior:
* 1. If no track is set as `playing`, the method exits early, as there is nothing to fade in.
* 2. Linearly interpolates the volume of the `playing` track from 0.0 to 1.0 based on the elapsed
* `infadeTime` and the specified `CROSSFADE_DURATION`.
* `infadeTime` and the specified `CROSSFADE_DURATION`.
* 3. Once the fade-in is complete (when `infadeTime` exceeds `CROSSFADE_DURATION`), the method:
* - Marks the fade process (`fading`) as complete.
* - Ensures the `playing` track is updated to its full volume.
*
* - Marks the fade process (`fading`) as complete.
* - Ensures the `playing` track is updated to its full volume.
* <p>
* Key Details:
* - Uses the `lerp` function to calculate the volume level for the `playing` track during the fade-in.
* - Ensures the volume is always a value between 0.0 and 1.0.
* - The `infadeTime` parameter should be relative to the start of the fade-in process.
*
* <p>
* Preconditions:
* - The `playing` track must be initialized and actively fading in for this method to have an effect.
* - The method is invoked as part of the `updateVolumeAndTrack` process.
@@ -309,7 +405,7 @@ private void addGameTracks() {
* a new track will be scheduled to play. If the list of game tracks is empty, it will be refreshed.
*/
private void updateGameTracks() {
if(null == playing) {
if (null == playing) {
return;
}
@@ -362,6 +458,7 @@ public float getSoundVolume() {
*/
public void setMainVolume(float mainVolume) {
this.mainVolume = mainVolume;
prefs.putFloat("mainVolume", mainVolume);
}
/**
@@ -371,6 +468,7 @@ public void setMainVolume(float mainVolume) {
*/
public void setMusicVolume(float musicVolume) {
this.musicVolume = musicVolume;
prefs.putFloat("musicVolume", musicVolume);
}
/**
@@ -380,6 +478,7 @@ public void setMusicVolume(float musicVolume) {
*/
public void setSoundVolume(float soundVolume) {
this.soundVolume = soundVolume;
prefs.putFloat("soundVolume", soundVolume);
}
/**
@@ -389,7 +488,7 @@ public void setSoundVolume(float soundVolume) {
*/
float getMusicVolumeTotal() {
return getMusicVolume() * getMainVolume();
return getMusicVolume() * getMainVolume() / 2;
}
/**

View File

@@ -19,5 +19,29 @@ public enum MdgaSound {
DESELECT,
HURRY,
VICTORY,
LOST
LOST,
BUTTON_PRESSED,
WRONG_INPUT,
UI_CLICK,
START,
THROW,
POWERUP,
SELF_READY,
OTHER_READY,
OTHER_CONNECTED,
NOT_READY,
LEAVE,
JET,
EXPLOSION,
LOSE,
BONUS,
UI90,
MISSILE,
MATRIX,
TURRET_ROTATE,
TANK_SHOOT,
TANK_EXPLOSION,
SHIELD,
TURBO,
SWAP,
}

View File

@@ -7,19 +7,21 @@
* These music assets are used to control the music that plays in different parts of the game, such as menus and in-game music.
*/
enum MusicAsset {
MAIN_MENU("Spaceship.wav", true, 1.0f),
LOBBY("DeadPlanet.wav", true, 1.0f),
CEREMONY("80s,Disco,Life.wav", true, 1.0f),
GAME_1("NeonRoadTrip.wav", 1.0f),
GAME_2("NoPressureTrance.wav", 1.0f),
GAME_3("TheSynthRave.wav", 1.0f),
GAME_4("LaserParty.wav", 1.0f),
GAME_5("RetroNoir.wav", 1.0f),
GAME_6("SpaceInvaders.wav", 1.0f);
MAIN_MENU("Spaceship.ogg", true, 1.0f),
LOBBY("DeadPlanet.ogg", true, 1.0f),
CEREMONY("80s,Disco,Life.ogg", true, 1.0f),
GAME_1("NeonRoadTrip.ogg", 0.5f),
GAME_2("NoPressureTrance.ogg", 0.5f),
GAME_3("TheSynthRave.ogg", 0.5f),
GAME_4("LaserParty.ogg", 0.5f),
GAME_5("RetroNoir.ogg", 0.5f),
GAME_6("SpaceInvaders.ogg", 0.5f),
BIRDS("nature-ambience.ogg", true, 1.0f);
private final String path;
private final boolean loop;
private final float subVolume;
private static final String ROOT = "Music/";
/**
* Constructs a new MusicAsset object with the specified name and sub-volume.
@@ -29,7 +31,7 @@ enum MusicAsset {
* @param subVolume A relative volume that modifies the base volume of the track (typically a percentage).
*/
MusicAsset(String name, float subVolume) {
this.path = "music/" + name;
this.path = ROOT + name;
this.loop = false;
this.subVolume = subVolume;
}
@@ -42,7 +44,7 @@ enum MusicAsset {
* @param subVolume A relative volume that modifies the base volume of the track (typically a percentage).
*/
MusicAsset(String name, boolean loop, float subVolume) {
this.path = "music/" + name;
this.path = ROOT + name;
this.loop = loop;
this.subVolume = subVolume;
}

View File

@@ -17,7 +17,34 @@ enum SoundAsset {
DESELECT(""),
HURRY(""),
VICTORY("LevelUp2.wav"),
LOST("GameOver.wav");
LOST("GameOver.wav"),
BUTTON_PRESS("menu_button.ogg"),
ERROR("buzzer.wav"),
UI_SOUND("ui_sound.ogg"),
UI_SOUND2("ui_swoosch.wav"),
UI_CLICK("uiclick.ogg"),
START("gamestart.ogg"),
LAUGHT("laughter.wav"),
POWERUP("powerup.wav"),
ROBOT_READY("robotReady.wav"),
UNIT_READY("unitReady.wav"),
JET("jet-overhead.wav"),
EXPLOSION_1("exp.ogg"),
EXPLOSION_2("exp2.ogg"),
THUNDER("thunder.ogg"),
UI90("ui90.ogg"),
BONUS("bonus.ogg"),
LOSE("lose.ogg"),
MISSILE("missile.ogg"),
MATRIX("matrix.wav"),
CONNECTED("connected.wav"),
TURRET_ROTATE("turret_rotate.ogg"),
TANK_SHOOT("tank_shoot.ogg"),
SHIELD("shield.ogg"),
SPEED("speed.ogg"),
SWAP("swap.ogg"),
;
private final String path;
@@ -27,7 +54,7 @@ enum SoundAsset {
* @param name The name of the sound file.
*/
SoundAsset(String name) {
this.path = "sound/" + name;
this.path = "Sounds/" + name;
}
/**

View File

@@ -4,4 +4,5 @@
* A record that encapsulates a sound asset along with its playback settings:
* the relative volume (subVolume) and a delay before it starts playing.
*/
record SoundAssetDelayVolume(SoundAsset asset, float subVolume, float delay) {}
record SoundAssetDelayVolume(SoundAsset asset, float subVolume, float delay) {
}

View File

@@ -0,0 +1,25 @@
package pp.mdga.client.animation;
import pp.mdga.client.InitControl;
public class ActionControl extends InitControl {
private final Runnable runnable;
/**
* Constructs a new ActionControl object with the specified action.
*
* @param runnable The action to be performed.
*/
public ActionControl(Runnable runnable) {
this.runnable = runnable;
}
/**
* Performs the action associated with this control.
*/
protected void action() {
if (null != runnable) {
runnable.run();
}
}
}

View File

@@ -1,10 +0,0 @@
package pp.mdga.client.animation;
abstract class Animation {
abstract void play();
abstract void stop();
abstract boolean isOver();
}

View File

@@ -1,29 +0,0 @@
package pp.mdga.client.animation;
import pp.mdga.client.MdgaApp;
public class AnimationHandler {
private MdgaApp app;
private Animation animation = null;
public AnimationHandler(MdgaApp app) {
this.app = app;
}
public void playAnimation(MdgaAnimation type) {
}
public void update() {
if (null == animation) {
return;
}
if (animation.isOver()) {
animation = null;
//trigger next state in model
}
}
}

View File

@@ -1,18 +0,0 @@
package pp.mdga.client.animation;
class EmptyAnimation extends Animation {
@Override
void play() {
//nothing
}
@Override
void stop() {
//nothing
}
@Override
boolean isOver() {
return true;
}
}

View File

@@ -0,0 +1,141 @@
package pp.mdga.client.animation;
import com.jme3.effect.ParticleEmitter;
import com.jme3.effect.ParticleMesh.Type;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.jme3.scene.control.AbstractControl;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.acoustic.MdgaSound;
/**
* The {@code Explosion} class represents an explosion effect in a 3D environment.
* It manages the creation, configuration, and triggering of particle emitters for fire and smoke effects.
*/
public class Explosion {
private final Node rootNode;
private final MdgaApp app;
private final Vector3f location;
private ParticleEmitter fire;
private ParticleEmitter smoke;
private boolean triggered = false;
private final Material fireMat;
private final Material smokeMat;
/**
* Constructor for the {@code Explosion} class.
*
* @param app The main application managing the explosion.
* @param rootNode The root node to which the explosion effects will be attached.
* @param location The location of the explosion in world coordinates.
*/
public Explosion(MdgaApp app, Node rootNode, Vector3f location) {
this.app = app;
this.rootNode = rootNode;
this.location = location;
this.fireMat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md");
this.smokeMat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md");
fireMat.setTexture("Texture", app.getAssetManager().loadTexture("Images/particle/flame.png"));
smokeMat.setTexture("Texture", app.getAssetManager().loadTexture("Images/particle/vapor_cloud.png"));
}
/**
* Initializes the particle emitters for the explosion effect.
* Configures the fire and smoke emitters with appearance, behavior, and lifespan.
*/
private void initializeEmitter() {
fire = new ParticleEmitter("Effect", Type.Triangle, 50);
fire.setMaterial(fireMat);
fire.setImagesX(2);
fire.setImagesY(2);
fire.setSelectRandomImage(true);
fire.setStartColor(ColorRGBA.Yellow);
fire.setEndColor(ColorRGBA.Red);
fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0.2f, 0.2f, 4f));
fire.getParticleInfluencer().setVelocityVariation(0.4f);
fire.setStartSize(0.7f);
fire.setEndSize(1.8f);
fire.setGravity(0, 0, -0.1f);
fire.setLowLife(0.5f);
fire.setHighLife(2.2f);
fire.setParticlesPerSec(0);
fire.setLocalTranslation(location);
smoke = new ParticleEmitter("Effect2", Type.Triangle, 40);
smoke.setMaterial(smokeMat);
smoke.setImagesX(3);
smoke.setImagesY(3);
smoke.setSelectRandomImage(true);
smoke.setStartColor(new ColorRGBA(0.5f, 0.5f, 0.5f, 0.5f));
smoke.setEndColor(new ColorRGBA(ColorRGBA.Black));
smoke.getParticleInfluencer().setInitialVelocity(new Vector3f(0.0f, 0.0f, 1.5f));
smoke.getParticleInfluencer().setVelocityVariation(0.5f);
smoke.setStartSize(0.8f);
smoke.setEndSize(1.5f);
smoke.setGravity(0, 0, -0.3f);
smoke.setLowLife(1.2f);
smoke.setHighLife(5.5f);
smoke.setParticlesPerSec(0);
smoke.setLocalTranslation(location);
app.getAcousticHandler().playSound(MdgaSound.EXPLOSION);
}
/**
* Triggers the explosion effect by attaching and activating the particle emitters for fire and smoke.
* Both emitters are automatically detached after a predefined duration.
*/
public void trigger() {
if (!triggered) {
triggered = true;
initializeEmitter();
}
rootNode.attachChild(fire);
fire.emitAllParticles();
fire.addControl(new AbstractControl() {
private float elapsedTime = 0;
@Override
protected void controlUpdate(float tpf) {
elapsedTime += tpf;
if (elapsedTime > 10f) {
rootNode.detachChild(fire);
fire.removeControl(this);
}
}
@Override
protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) {
}
});
rootNode.attachChild(smoke);
smoke.emitAllParticles();
smoke.addControl(new AbstractControl() {
private float elapsedTime = 0;
@Override
protected void controlUpdate(float tpf) {
elapsedTime += tpf;
if (elapsedTime > 10f) {
rootNode.detachChild(smoke);
smoke.removeControl(this);
}
}
@Override
protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) {
}
});
}
}

View File

@@ -0,0 +1,69 @@
package pp.mdga.client.animation;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.scene.Geometry;
import static pp.mdga.client.Util.linInt;
public class FadeControl extends ActionControl {
private float duration; // Duration of the fade effect
private float timeElapsed = 0;
private boolean init = false;
private float startAlpha;
private float endAlpha;
public FadeControl(float duration, float startAlpha, float endAlpha, Runnable actionAfter) {
super(actionAfter);
this.duration = duration;
this.startAlpha = startAlpha;
this.endAlpha = endAlpha;
}
public FadeControl(float duration, float startAlpha, float endAlpha) {
this(duration, startAlpha, endAlpha, null);
}
@Override
protected void initSpatial() {
init = true;
}
@Override
protected void controlUpdate(float tpf) {
if (!init) return;
timeElapsed += tpf;
float t = timeElapsed / duration; // Calculate progress (0 to 1)
if (t >= 1) {
// Fade complete
t = 1;
init = false;
spatial.removeControl(this);
action();
}
float alpha = linInt(startAlpha, endAlpha, t); // Interpolate alpha
// Update the material's alpha
if (spatial instanceof Geometry geometry) {
Material mat = geometry.getMaterial();
if (mat != null) {
ColorRGBA diffuse = (ColorRGBA) mat.getParam("Diffuse").getValue();
mat.setColor("Diffuse", new ColorRGBA(diffuse.r, diffuse.g, diffuse.b, alpha));
ColorRGBA ambient = (ColorRGBA) mat.getParam("Ambient").getValue();
mat.setColor("Ambient", new ColorRGBA(ambient.r, ambient.g, ambient.b, alpha));
// Disable shadows when the object is nearly invisible
if (alpha <= 0.1f) {
geometry.setShadowMode(RenderQueue.ShadowMode.Off);
} else {
geometry.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
}
} else throw new RuntimeException("Material is null");
} else throw new RuntimeException("Spatial is not instance of Geometry");
}
}

View File

@@ -0,0 +1,195 @@
package pp.mdga.client.animation;
import com.jme3.material.Material;
import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.control.AbstractControl;
import pp.mdga.client.Asset;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.acoustic.MdgaSound;
/**
* The {@code JetAnimation} class handles the animation of a jet model in a 3D environment.
* It creates a jet model, animates its movement along a curved path, triggers an explosion at a target point,
* and performs additional actions upon animation completion.
*/
public class JetAnimation {
private final MdgaApp app;
private final Node rootNode;
private Spatial jetModel;
private final Vector3f spawnPoint;
private final Vector3f nodePoint;
private final Vector3f despawnPoint;
private final float curveHeight;
private final float animationDuration;
private Explosion explosion;
private Runnable actionAfter;
/**
* Constructor for the {@code JetAnimation} class.
*
* @param app The main application managing the jet animation.
* @param rootNode The root node to which the jet model will be attached.
* @param targetPoint The target point where the explosion will occur.
* @param curveHeight The height of the curve for the jet's flight path.
* @param animationDuration The total duration of the jet animation.
*/
public JetAnimation(MdgaApp app, Node rootNode, Vector3f targetPoint, float curveHeight, float animationDuration, Runnable actionAfter) {
Vector3f spawnPoint = targetPoint.add(170, 50, 50);
Vector3f controlPoint = targetPoint.add(new Vector3f(0, 0, -45));
Vector3f despawnPoint = targetPoint.add(-100, -100, 40);
this.app = app;
this.rootNode = rootNode;
this.spawnPoint = spawnPoint;
this.nodePoint = controlPoint;
this.despawnPoint = despawnPoint;
this.curveHeight = curveHeight;
this.animationDuration = animationDuration;
explosion = new Explosion(app, rootNode, targetPoint);
this.actionAfter = actionAfter;
}
/**
* Starts the jet animation by spawning the jet model and initiating its movement along the predefined path.
*/
public void start() {
app.getAcousticHandler().playSound(MdgaSound.JET);
spawnJet();
animateJet();
}
/**
* Spawns the jet model at the designated spawn point, applying material, scaling, and rotation.
*/
private void spawnJet() {
jetModel = app.getAssetManager().loadModel(Asset.jet_noGear.getModelPath());
jetModel.setLocalTranslation(spawnPoint);
jetModel.scale(Asset.jet_noGear.getSize());
jetModel.rotate(FastMath.HALF_PI, 0, 0);
jetModel.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md");
mat.setTexture("DiffuseMap", app.getAssetManager().loadTexture(Asset.jet_noGear.getDiffPath()));
jetModel.setMaterial(mat);
rootNode.attachChild(jetModel);
}
/**
* actionAfter
* Animates the jet along a Bezier curve path, triggers the explosion effect at the appropriate time,
* and performs cleanup operations after the animation completes.
*/
private void animateJet() {
Vector3f controlPoint1 = spawnPoint.add(0, curveHeight, 0);
Vector3f controlPoint2 = nodePoint.add(0, curveHeight, 0);
BezierCurve3f curve = new BezierCurve3f(spawnPoint, controlPoint1, controlPoint2, despawnPoint);
app.getRootNode().addControl(new AbstractControl() {
private float elapsedTime = 0;
@Override
protected void controlUpdate(float tpf) {
elapsedTime += tpf;
float progress = elapsedTime / animationDuration;
if (elapsedTime > 4.2f) {
explosion.trigger();
}
if (progress > 1) {
rootNode.detachChild(jetModel);
this.spatial.removeControl(this);
} else {
Vector3f currentPos = curve.interpolate(progress);
Vector3f direction = curve.interpolateDerivative(progress).normalizeLocal();
jetModel.setLocalTranslation(currentPos);
jetModel.lookAt(currentPos.add(direction), Vector3f.UNIT_Z);
jetModel.rotate(-FastMath.HALF_PI, 0, (float) Math.toRadians(-25));
}
if (elapsedTime > 6.0f) {
endAnim();
}
}
@Override
protected void controlRender(RenderManager rm, ViewPort vp) {
}
});
}
private void endAnim() {
actionAfter.run();
}
/**
* The {@code BezierCurve3f} class represents a 3D cubic Bezier curve.
* It provides methods to interpolate positions and derivatives along the curve.
*/
private static class BezierCurve3f {
private final Vector3f p0, p1, p2, p3;
/**
* Constructor for the {@code BezierCurve3f} class.
*
* @param p0 The starting point of the curve.
* @param p1 The first control point influencing the curve's shape.
* @param p2 The second control point influencing the curve's shape.
* @param p3 The endpoint of the curve.
*/
public BezierCurve3f(Vector3f p0, Vector3f p1, Vector3f p2, Vector3f p3) {
this.p0 = p0;
this.p1 = p1;
this.p2 = p2;
this.p3 = p3;
}
/**
* Interpolates a position along the curve at a given progress value {@code t}.
*
* @param t The progress value (0.0 to 1.0) along the curve.
* @return The interpolated position on the curve.
*/
public Vector3f interpolate(float t) {
float u = 1 - t;
float tt = t * t;
float uu = u * u;
float uuu = uu * u;
float ttt = tt * t;
Vector3f point = p0.mult(uuu);
point = point.add(p1.mult(3 * uu * t));
point = point.add(p2.mult(3 * u * tt));
point = point.add(p3.mult(ttt));
return point;
}
/**
* Computes the derivative at a given progress value {@code t}, representing the direction along the curve.
*
* @param t The progress value (0.0 to 1.0) along the curve.
* @return The derivative (direction vector) at the specified progress.
*/
public Vector3f interpolateDerivative(float t) {
float u = 1 - t;
float tt = t * t;
Vector3f derivative = p0.mult(-3 * u * u);
derivative = derivative.add(p1.mult(3 * u * u - 6 * u * t));
derivative = derivative.add(p2.mult(6 * u * t - 3 * tt));
derivative = derivative.add(p3.mult(3 * tt));
return derivative;
}
}
}

View File

@@ -0,0 +1,253 @@
package pp.mdga.client.animation;
import com.jme3.effect.ParticleEmitter;
import com.jme3.effect.ParticleMesh.Type;
import com.jme3.material.Material;
import com.jme3.material.RenderState;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import pp.mdga.client.MdgaApp;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
* MatrixAnimation class handles the animation of radar and matrix particle effects.
*/
public class MatrixAnimation extends ActionControl {
private MdgaApp app;
private static final Random RANDOM = new Random();
private Vector3f radarPos;
private Runnable runnable;
private boolean init = false;
private List<ParticleEmitter> activeEmitter = new ArrayList<>();
private ParticleEmitter radarEmitter = null;
private float timeElapsed = 0f;
/**
* Enum representing the states of the matrix animation.
*/
private enum MatrixState {
RADAR_ON,
RADAR_OFF,
MATRIX_ON,
MATRIX_OFF
}
private MatrixState state;
/**
* Constructor for MatrixAnimation.
*
* @param app the application instance
* @param radarPos the position of the radar
* @param runnable the runnable action to be executed
*/
public MatrixAnimation(MdgaApp app, Vector3f radarPos, Runnable runnable) {
super(runnable);
this.app = app;
this.radarPos = radarPos;
}
/**
* Initializes the spatial and sets the initial state to RADAR_ON.
*/
@Override
protected void initSpatial() {
state = MatrixState.RADAR_ON;
timeElapsed = 0;
init = true;
radar();
}
/**
* Updates the control based on the time per frame (tpf).
*
* @param tpf the time per frame
*/
@Override
protected void controlUpdate(float tpf) {
if (!init) return;
timeElapsed += tpf;
switch (state) {
case RADAR_ON -> {
if (timeElapsed >= 2f) {
state = MatrixState.RADAR_OFF;
timeElapsed = 0;
radarEmitter.setParticlesPerSec(0);
app.getTimerManager().addTask(3f, () -> app.enqueue(() -> {
app.getRootNode().detachChild(radarEmitter);
System.out.println("delete radar");
return null;
}));
}
}
case RADAR_OFF -> {
if (timeElapsed >= 0.1f) {
state = MatrixState.MATRIX_ON;
timeElapsed = 0;
matrix();
}
}
case MATRIX_ON -> {
if (timeElapsed >= 3f) {
state = MatrixState.MATRIX_OFF;
timeElapsed = 0;
turnOff();
app.getTimerManager().addTask(3f, () -> app.enqueue(() -> {
for (ParticleEmitter particleEmitter : activeEmitter) {
app.getRootNode().detachChild(particleEmitter);
}
System.out.println("delete particle");
return null;
}));
}
}
case MATRIX_OFF -> {
if (timeElapsed >= 0.5f) {
init = false;
spatial.removeControl(this);
action();
}
}
}
}
/**
* Turns off all active particle emitters.
*/
private void turnOff() {
for (ParticleEmitter particleEmitter : activeEmitter) {
particleEmitter.setParticlesPerSec(0f);
}
}
/**
* Initializes the radar particle emitter.
*/
private void radar() {
Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", app.getAssetManager().loadTexture("Images/particle/radar_beam.png"));
ParticleEmitter emitter = new ParticleEmitter("Effect", Type.Triangle, 50);
emitter.setMaterial(mat);
emitter.setImagesX(1); // columns
emitter.setImagesY(1); // rows
emitter.setSelectRandomImage(true);
emitter.setStartColor(ColorRGBA.White);
emitter.setEndColor(ColorRGBA.Black);
emitter.getParticleInfluencer().setInitialVelocity(new Vector3f(0f, 0f, 2));
emitter.getParticleInfluencer().setVelocityVariation(0f);
emitter.setStartSize(0.1f);
emitter.setEndSize(10);
emitter.setGravity(0, 0, 0);
float life = 2.6f;
emitter.setLowLife(life);
emitter.setHighLife(life);
emitter.setLocalTranslation(radarPos.add(new Vector3f(0, 0, 5)));
emitter.setParticlesPerSec(1.8f);
app.getRootNode().attachChild(emitter);
radarEmitter = emitter;
}
/**
* Initializes multiple matrix particle streams.
*/
private void matrix() {
for (int i = 0; i < 5; i++) {
particleStream(
generateMatrixColor(),
generateMatrixColor(),
getRandomFloat(0, 1f),
getRandomPosition(),
getRandomFloat(1, 2)
);
}
}
/**
* Creates a particle stream with the specified parameters.
*
* @param start the start color of the particles
* @param end the end color of the particles
* @param speedVar the speed variation of the particles
* @param pos the position of the particles
* @param spawnVar the spawn rate variation of the particles
*/
private void particleStream(ColorRGBA start, ColorRGBA end, float speedVar, Vector3f pos, float spawnVar) {
Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md");
mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
mat.setTexture("Texture", app.getAssetManager().loadTexture("Images/particle/particle_cir.png"));
ParticleEmitter matrix = new ParticleEmitter("Effect", Type.Triangle, 50);
matrix.setMaterial(mat);
matrix.setImagesX(2); // columns
matrix.setImagesY(1); // rows
matrix.setSelectRandomImage(true);
matrix.setStartColor(start);
matrix.setEndColor(end);
matrix.getParticleInfluencer().setInitialVelocity(new Vector3f(0f, 0f, -6f - speedVar));
matrix.getParticleInfluencer().setVelocityVariation(0f);
matrix.setStartSize(0.4f);
matrix.setEndSize(0.6f);
matrix.setGravity(0, 0, 2f);
matrix.setLowLife(3f);
matrix.setHighLife(3f);
matrix.setLocalTranslation(spatial.getLocalTranslation().add(pos).add(new Vector3f(0, 0, 15)));
matrix.setParticlesPerSec(spawnVar);
app.getRootNode().attachChild(matrix);
activeEmitter.add(matrix);
}
/**
* Generates a random position vector.
*
* @return a random position vector
*/
public static Vector3f getRandomPosition() {
// Generate a random angle in radians (0 to 2π)
float angle = (float) (2 * Math.PI * RANDOM.nextDouble());
// Generate a random radius with uniform distribution
float radius = (float) Math.sqrt(RANDOM.nextDouble());
radius *= 1f;
// Convert polar coordinates to Cartesian
float x = radius * (float) Math.cos(angle);
float y = radius * (float) Math.sin(angle);
return new Vector3f(x, y, 0);
}
/**
* Generates a random float between the specified start and end values.
*
* @param start the start value
* @param end the end value
* @return a random float between start and end
*/
public static float getRandomFloat(float start, float end) {
if (start > end) {
throw new IllegalArgumentException("Start must be less than or equal to end.");
}
return start + RANDOM.nextFloat() * (end - start);
}
/**
* Generates a random color for the matrix particles.
*
* @return a random ColorRGBA object
*/
public static ColorRGBA generateMatrixColor() {
// Red is dominant
float red = 0.8f + RANDOM.nextFloat() * 0.2f; // Red channel: 0.8 to 1.0
// Green is moderately high
float green = 0.4f + RANDOM.nextFloat() * 0.3f; // Green channel: 0.4 to 0.7
// Blue is minimal
float blue = RANDOM.nextFloat() * 0.2f; // Blue channel: 0.0 to 0.2
float alpha = 1.0f; // Fully opaque
return new ColorRGBA(red, green, blue, alpha);
}
}

View File

@@ -1,4 +0,0 @@
package pp.mdga.client.animation;
public enum MdgaAnimation {
}

View File

@@ -0,0 +1,183 @@
package pp.mdga.client.animation;
import com.jme3.effect.ParticleEmitter;
import com.jme3.effect.ParticleMesh;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.control.AbstractControl;
import pp.mdga.client.Asset;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.acoustic.MdgaSound;
import pp.mdga.client.board.BoardHandler;
/**
* The {@code MissileAnimation} class handles the animation of a missile moving along a parabolic path
* towards a target point in a 3D environment. It also triggers an explosion at the target upon impact.
*/
public class MissileAnimation {
private final Node rootNode;
private final MdgaApp app;
private final Vector3f start;
private final Vector3f target;
private final float flightTime;
private Explosion explosion;
private Spatial missileModel;
private Runnable actionAfter;
private ParticleEmitter smoke;
private Node missileNode = new Node();
private final Material mat;
/**
* Constructor for the {@code MissileAnimation} class.
*
* @param app The main application managing the missile animation.
* @param rootNode The root node to which the missile model will be attached.
* @param target The target point where the missile will explode.
* @param flightTime The total flight time of the missile.
*/
public MissileAnimation(MdgaApp app, Node rootNode, Vector3f target, float flightTime, Runnable actionAfter) {
this.app = app;
this.rootNode = rootNode;
this.flightTime = flightTime;
this.actionAfter = actionAfter;
explosion = new Explosion(app, rootNode, target);
this.target = target.add(new Vector3f(1.5f, -1, 0));
start = BoardHandler.gridToWorld(12, 0);
start.add(new Vector3f(0, 0, 0));
this.mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", app.getAssetManager().loadTexture("Images/particle/vapor_cloud.png"));
smoke = new ParticleEmitter("Effect2", ParticleMesh.Type.Triangle, 400);
smoke.setMaterial(mat);
smoke.setImagesX(3);
smoke.setImagesY(3);
smoke.setStartColor(ColorRGBA.DarkGray);
smoke.setEndColor(new ColorRGBA(0.05f, 0.05f, 0.05f, 1));
smoke.getParticleInfluencer().setInitialVelocity(new Vector3f(0.0f, 0.0f, 0.0f));
smoke.getParticleInfluencer().setVelocityVariation(0.1f);
smoke.setStartSize(0.8f);
smoke.setEndSize(1.5f);
smoke.setGravity(0, 0, -0.3f);
smoke.setLowLife(1.2f);
smoke.setHighLife(3.5f);
smoke.setParticlesPerSec(100);
missileNode.attachChild(smoke);
smoke.move(1, 0.85f, 1.0f);
}
/**
* Starts the missile animation by loading the missile model and initiating its parabolic movement.
*/
public void start() {
Smoke s = new Smoke(app, rootNode, start);
s.trigger();
loadMissile();
app.getAcousticHandler().playSound(MdgaSound.MISSILE);
animateMissile();
}
/**
* Loads the missile model into the scene, applies scaling, material, and sets its initial position.
*/
private void loadMissile() {
missileModel = app.getAssetManager().loadModel(Asset.missile.getModelPath());
missileModel.scale(Asset.missile.getSize());
missileModel.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md");
mat.setTexture("DiffuseMap", app.getAssetManager().loadTexture(Asset.missile.getDiffPath()));
missileModel.setMaterial(mat);
missileNode.setLocalTranslation(start);
missileNode.attachChild(missileModel);
rootNode.attachChild(missileNode);
}
/**
* Animates the missile along a parabolic path, triggers the explosion near the target,
* and removes the missile model after the animation completes.
*/
private void animateMissile() {
missileNode.addControl(new AbstractControl() {
private float elapsedTime = 0;
@Override
protected void controlUpdate(float tpf) {
if (elapsedTime > 6) {
endAnim();
rootNode.detachChild(missileNode);
this.spatial.removeControl(this);
}
elapsedTime += tpf;
float progress = elapsedTime / flightTime;
if (progress >= 0.55) {
smoke.setParticlesPerSec(30);
}
if (progress >= 0.7) {
smoke.setParticlesPerSec(0);
}
if (progress >= 0.95f) {
explosion.trigger();
}
if (progress >= 1) {
explosion.trigger();
missileNode.detachChild(missileModel);
}
Vector3f currentPosition = computeParabolicPath(start, target, progress);
missileNode.setLocalTranslation(currentPosition);
Vector3f direction = computeParabolicPath(start, target, progress + 0.01f)
.subtract(currentPosition)
.normalizeLocal();
missileModel.lookAt(currentPosition.add(direction), Vector3f.UNIT_Y);
missileModel.rotate(0, FastMath.HALF_PI, 0);
}
@Override
protected void controlRender(RenderManager rm, ViewPort vp) {
}
});
}
private void endAnim() {
actionAfter.run();
}
/**
* Computes a position along a parabolic path at a given progress value {@code t}.
*
* @param start The starting point of the missile's flight.
* @param target The target point of the missile's flight.
* @param t The progress value (0.0 to 1.0) along the flight path.
* @return The interpolated position along the parabolic path.
*/
private Vector3f computeParabolicPath(Vector3f start, Vector3f target, float t) {
Vector3f midPoint = start.add(target).multLocal(0.5f);
midPoint.addLocal(0, 0, 20);
Vector3f startToMid = FastMath.interpolateLinear(t, start, midPoint);
Vector3f midToTarget = FastMath.interpolateLinear(t, midPoint, target);
return FastMath.interpolateLinear(t, startToMid, midToTarget);
}
}

View File

@@ -0,0 +1,98 @@
package pp.mdga.client.animation;
import com.jme3.math.Vector3f;
import static pp.mdga.client.Util.easeInOut;
import static pp.mdga.client.Util.quadInt;
/**
* A control that smoothly moves a spatial from an initial position to an end position
* using a quadratic interpolation, with the option to perform an action after the movement is complete.
* The movement path includes an intermediate "middle" position at a specified height.
*
* <p>Movement speed can be adjusted by modifying the MOVE_SPEED constant. The movement easing follows
* an ease-in-out curve to create a smooth start and stop effect.
* </p>
*/
public class MoveControl extends ActionControl {
private boolean moving;
private final Vector3f initPos;
private final Vector3f endPos;
private final Vector3f middlePos;
private final float height;
private final float duration;
private float timer = 0;
private boolean easing;
/**
* Creates a new MoveControl with specified initial and end positions, and an action to run after the movement.
* The movement follows a path with a midpoint at a fixed height.
*
* @param initPos The starting position of the spatial.
* @param endPos The target position of the spatial.
* @param actionAfter A Runnable that will be executed after the movement finishes.
*/
public MoveControl(Vector3f initPos, Vector3f endPos, Runnable actionAfter) {
this(initPos, endPos, actionAfter, 2, 1, true);
}
public MoveControl(Vector3f initPos, Vector3f endPos, Runnable actionAfter, float height, float duration, boolean easing) {
super(actionAfter);
moving = false;
this.initPos = initPos;
this.endPos = endPos;
this.height = height;
this.duration = duration;
this.easing = easing;
middlePos = new Vector3f(
(initPos.x + endPos.x) / 2,
(initPos.y + endPos.y) / 2,
height
);
}
/**
* Initializes the movement by resetting the progress and setting the moving flag to true.
* This is called automatically when the spatial is set.
*/
@Override
protected void initSpatial() {
moving = true;
timer = 0;
}
/**
* Updates the movement of the spatial by interpolating its position along the defined path.
* The movement is smoothed using an easing function.
* Once the movement reaches the target, the {@link #end()} method is called to finish the movement.
*
* @param tpf Time per frame, the time elapsed since the last frame.
*/
@Override
protected void controlUpdate(float tpf) {
if (!moving) return;
timer += tpf;
float t = timer / duration;
if (t >= 1) t = 1;
float interpolated = easing ? easeInOut(t) : t;
spatial.setLocalTranslation(quadInt(initPos, middlePos, endPos, interpolated));
if (t >= 1) end();
}
/**
* Ends the movement by stopping the interpolation, running the action after the movement,
* and removing this control from the spatial.
*/
private void end() {
moving = false;
spatial.removeControl(this);
action();
}
}

View File

@@ -0,0 +1,194 @@
package pp.mdga.client.animation;
import com.jme3.effect.ParticleEmitter;
import com.jme3.effect.ParticleMesh;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import com.jme3.scene.Spatial;
import pp.mdga.client.Asset;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.acoustic.MdgaSound;
import pp.mdga.client.board.TankTopControl;
import java.util.Timer;
import java.util.TimerTask;
import static com.jme3.material.Materials.LIGHTING;
/**
* ShellAnimation class handles the animation of a shell being fired from a tank.
*/
public class ShellAnimation extends ActionControl {
private static final float FLYING_DURATION = 1.25f;
private static final float FLYING_HEIGHT = 12f;
private TankTopControl tankTopControl;
private MdgaApp app;
/**
* Constructor for ShellAnimation.
*
* @param tankTopControl the control for the tank top
* @param app the application instance
* @param actionAfter the action to perform after the animation
*/
public ShellAnimation(TankTopControl tankTopControl, MdgaApp app, Runnable actionAfter) {
super(actionAfter);
this.tankTopControl = tankTopControl;
this.app = app;
}
/**
* Initializes the spatial for the animation.
*/
@Override
protected void initSpatial() {
tankTopControl.rotate(spatial.getLocalTranslation(), this::shoot);
app.getAcousticHandler().playSound(MdgaSound.TURRET_ROTATE);
//app.getRootNode().attachChild(createShell());
}
/**
* Calculates the shooting position based on the tank's turret rotation.
*
* @return the shooting position as a Vector3f
*/
private Vector3f getShootPos() {
Vector3f localOffset = new Vector3f(0, -5.4f, 2.9f);
Quaternion turretRotation = tankTopControl.getSpatial().getLocalRotation();
Vector3f transformedOffset = turretRotation.mult(localOffset);
return tankTopControl.getSpatial().getLocalTranslation().add(transformedOffset);
}
/**
* Handles the shooting action, including sound and visual effects.
*/
private void shoot() {
app.getAcousticHandler().playSound(MdgaSound.TANK_SHOOT);
Vector3f shootPos = getShootPos();
createEffect(
shootPos,
"Images/particle/flame.png",
2, 2,
1, 3,
1f,
0.3f, 0.7f,
new ColorRGBA(1f, 0.8f, 0.4f, 0.5f),
new ColorRGBA(1f, 0f, 0f, 0f)
);
createEffect(
shootPos,
"Images/particle/vapor_cloud.png",
3, 3,
0.3f, 0.8f,
10,
0.1f, 0.35f,
new ColorRGBA(0.5f, 0.5f, 0.5f, 0.5f),
ColorRGBA.Black
);
Spatial shell = createShell();
app.getRootNode().attachChild(shell);
shell.addControl(new ShellControl(this::hitExplosion, shootPos, spatial.getLocalTranslation(), FLYING_HEIGHT, FLYING_DURATION, app.getAssetManager()));
}
/**
* Creates the shell model and sets its initial properties.
*
* @return the created shell as a Spatial
*/
private Spatial createShell() {
Spatial model = app.getAssetManager().loadModel(Asset.shell.getModelPath());
model.scale(.16f);
model.setLocalTranslation(tankTopControl.getSpatial().getLocalTranslation());
Vector3f shootPos = tankTopControl.getSpatial().getLocalTranslation();
Vector3f targetPos = spatial.getLocalTranslation();
Vector3f direction = targetPos.subtract(shootPos).normalize();
Quaternion rotation = new Quaternion();
rotation.lookAt(direction, new Vector3f(1, 0, 0)); // Assuming UNIT_Y is the up vector
model.setLocalRotation(rotation);
model.rotate(FastMath.HALF_PI, 0, 0);
Material mat = new Material(app.getAssetManager(), LIGHTING);
mat.setBoolean("UseMaterialColors", true);
ColorRGBA color = ColorRGBA.fromRGBA255(143, 117, 0, 255);
mat.setColor("Diffuse", color);
mat.setColor("Ambient", color);
model.setMaterial(mat);
return model;
}
/**
* Handles the explosion effect when the shell hits a target.
*/
private void hitExplosion() {
app.getAcousticHandler().playSound(MdgaSound.TANK_EXPLOSION);
createEffect(
spatial.getLocalTranslation().setZ(1),
"Images/particle/flame.png",
2, 2,
1, 5,
2f,
0.3f, 0.7f,
new ColorRGBA(1f, 0.8f, 0.4f, 0.5f),
new ColorRGBA(1f, 0f, 0f, 0f)
);
app.getTimerManager().addTask(0.8f, super::action);
}
/**
* Creates a particle effect at the specified position.
*
* @param shootPos the position to create the effect
* @param image the image to use for the particles
* @param x the number of columns in the texture
* @param y the number of rows in the texture
* @param startSize the initial size of the particles
* @param endSize the final size of the particles
* @param velocity the initial velocity of the particles
* @param lowLife the minimum lifetime of the particles
* @param highLife the maximum lifetime of the particles
* @param start the starting color of the particles
* @param end the ending color of the particles
*/
private void createEffect(Vector3f shootPos,
String image,
int x, int y,
float startSize, float endSize,
float velocity,
float lowLife, float highLife,
ColorRGBA start, ColorRGBA end) {
// Create a particle emitter for the explosion
ParticleEmitter explosionEmitter = new ParticleEmitter("Explosion", ParticleMesh.Type.Triangle, 100);
Material explosionMat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md");
explosionMat.setTexture("Texture", app.getAssetManager().loadTexture(image));
explosionEmitter.setMaterial(explosionMat);
// Particle properties
explosionEmitter.setImagesX(x); // Columns in the texture
explosionEmitter.setImagesY(y); // Rows in the texture
explosionEmitter.setSelectRandomImage(true); // Randomize images for variety
explosionEmitter.setStartColor(start); // Bright yellowish orange
explosionEmitter.setEndColor(end); // Fade to transparent red
explosionEmitter.setStartSize(startSize); // Initial size
explosionEmitter.setEndSize(endSize); // Final size
explosionEmitter.setLowLife(lowLife); // Minimum lifetime of particles
explosionEmitter.setHighLife(highLife); // Maximum lifetime of particles
explosionEmitter.setGravity(0, 0, 1); // Gravity to pull particles down
explosionEmitter.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 0, velocity));
explosionEmitter.getParticleInfluencer().setVelocityVariation(1f); // Adds randomness to the initial velocity
explosionEmitter.setFacingVelocity(true); // Particles face their velocity direction
explosionEmitter.setLocalTranslation(shootPos);
explosionEmitter.setParticlesPerSec(0);
explosionEmitter.emitAllParticles();
app.getRootNode().attachChild(explosionEmitter);
app.getTimerManager().addTask(1, ()->app.getRootNode().detachChild(explosionEmitter));
}
}

View File

@@ -0,0 +1,112 @@
package pp.mdga.client.animation;
import com.jme3.asset.AssetManager;
import com.jme3.effect.ParticleEmitter;
import com.jme3.effect.ParticleMesh;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;
/**
* ShellControl is responsible for controlling the movement and visual effects of a shell.
*/
public class ShellControl extends ActionControl {
private final Vector3f shootPos;
private final Vector3f endPos;
private final float height;
private final float duration;
private Vector3f oldPos;
private ParticleEmitter emitter;
private AssetManager assetManager;
/**
* Constructs a new ShellControl.
*
* @param runnable the action to perform when the shell reaches its destination
* @param shootPos the starting position of the shell
* @param endPos the ending position of the shell
* @param height the height of the shell's trajectory
* @param duration the duration of the shell's flight
* @param assetManager the asset manager to load resources
*/
public ShellControl(Runnable runnable, Vector3f shootPos, Vector3f endPos, float height, float duration, AssetManager assetManager) {
super(runnable);
this.shootPos = shootPos;
this.endPos = endPos;
this.height = height;
this.duration = duration;
this.assetManager = assetManager;
}
/**
* Initializes the spatial with the necessary controls and particle emitter.
*/
@Override
protected void initSpatial() {
spatial.addControl(new MoveControl(
shootPos,
endPos,
() -> {
emitter.killAllParticles();
emitter.setParticlesPerSec(0);
emitter.removeFromParent();
spatial.removeControl(this);
spatial.removeFromParent();
action();
},
height,
duration,
false
));
oldPos = spatial.getLocalTranslation().clone();
createEmitter();
}
/**
* Creates and configures the particle emitter for the shell trail.
*/
private void createEmitter() {
emitter = new ParticleEmitter("ShellTrail", ParticleMesh.Type.Triangle, 200);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Images/particle/line.png")); // Nutze eine schmale, linienartige Textur
emitter.setMaterial(mat);
// Comic-Style Farben
emitter.setStartColor(new ColorRGBA(1f, 1f, 1f, 1f)); // Reinweiß
emitter.setEndColor(new ColorRGBA(1f, 1f, 1f, 0f)); // Transparent
// Partikelgröße und Lebensdauer
emitter.setStartSize(0.15f); // Startgröße
emitter.setEndSize(0.1f); // Endgröße
emitter.setLowLife(0.14f); // Sehr kurze Lebensdauer
emitter.setHighLife(0.14f);
emitter.setGravity(0, 0, 0); // Keine Gravitation
emitter.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 0, 0));
emitter.getParticleInfluencer().setVelocityVariation(0f); // Kein Variationsspielraum
// Hohe Dichte für eine glatte Spur
emitter.setParticlesPerSec(500);
// Zur Shell hinzufügen
spatial.getParent().attachChild(emitter);
}
/**
* Updates the control, adjusting the shell's rotation and emitter position.
*
* @param tpf time per frame
*/
@Override
protected void controlUpdate(float tpf) {
Vector3f direction = spatial.getLocalTranslation().subtract(oldPos).normalize();
if (direction.lengthSquared() > 0) {
spatial.getLocalRotation().lookAt(direction, Vector3f.UNIT_X);
spatial.rotate(FastMath.HALF_PI, 0, 0);
}
oldPos = spatial.getLocalTranslation().clone();
emitter.setLocalTranslation(spatial.getLocalTranslation().clone());
}
}

View File

@@ -0,0 +1,95 @@
package pp.mdga.client.animation;
import com.jme3.effect.ParticleEmitter;
import com.jme3.effect.ParticleMesh;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.jme3.scene.control.AbstractControl;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.acoustic.MdgaSound;
public class Smoke {
private final Node rootNode;
private final MdgaApp app;
private final Vector3f location;
private ParticleEmitter smoke;
private boolean triggered = false;
private final Material mat;
/**
* Constructor for the {@code Explosion} class.
*
* @param app The main application managing the explosion.
* @param rootNode The root node to which the explosion effects will be attached.
* @param location The location of the explosion in world coordinates.
*/
public Smoke(MdgaApp app, Node rootNode, Vector3f location) {
this.app = app;
this.rootNode = rootNode;
this.location = location;
this.mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", app.getAssetManager().loadTexture("Images/particle/vapor_cloud.png"));
}
/**
* Initializes the particle emitters for the explosion effect.
* Configures the fire and smoke emitters with appearance, behavior, and lifespan.
*/
private void initializeEmitter() {
smoke = new ParticleEmitter("Effect2", ParticleMesh.Type.Triangle, 50);
smoke.setMaterial(mat);
smoke.setImagesX(3);
smoke.setImagesY(3);
smoke.setSelectRandomImage(true);
smoke.setStartColor(ColorRGBA.DarkGray);
smoke.setEndColor(new ColorRGBA(0.05f, 0.05f, 0.05f, 1));
smoke.getParticleInfluencer().setInitialVelocity(new Vector3f(0.2f, 0.2f, 4f));
smoke.getParticleInfluencer().setVelocityVariation(0.5f);
smoke.setStartSize(0.7f);
smoke.setEndSize(3f);
smoke.setGravity(0, 0, -0.3f);
smoke.setLowLife(1.2f);
smoke.setHighLife(2.5f);
smoke.setParticlesPerSec(0);
smoke.setLocalTranslation(location);
app.getAcousticHandler().playSound(MdgaSound.EXPLOSION);
}
/**
* Triggers the explosion effect by attaching and activating the particle emitters for fire and smoke.
* Both emitters are automatically detached after a predefined duration.
*/
public void trigger() {
if (!triggered) {
triggered = true;
initializeEmitter();
}
rootNode.attachChild(smoke);
smoke.emitAllParticles();
smoke.addControl(new AbstractControl() {
private float elapsedTime = 0;
@Override
protected void controlUpdate(float tpf) {
elapsedTime += tpf;
if (elapsedTime > 10f) {
rootNode.detachChild(smoke);
smoke.removeControl(this);
}
}
@Override
protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) {
}
});
}
}

View File

@@ -0,0 +1,213 @@
package pp.mdga.client.animation;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import pp.mdga.client.InitControl;
import pp.mdga.game.BonusCard;
/**
* A control that manages the animation of symbols representing different bonus card states.
* The symbol can animate with zoom, rotation, and translation effects based on the state of the bonus card.
*
* <p>The control supports three main states: SHIELD, SWAP, and TURBO. Each state has its own specific animation logic:
* <ul>
* <li>SHIELD: Zooms in and out, with a scaling effect.</li>
* <li>SWAP: Rotates the symbol 360 degrees.</li>
* <li>TURBO: Moves the symbol along the Y-axis with a zoom effect.</li>
* </ul>
* </p>
*/
public class SymbolControl extends InitControl {
private boolean zoomingIn = false;
private boolean zoomingOut = false;
private float zoomSpeed = 1f;
private float zoomFactor = 3f;
private float progress = 0;
private BonusCard state;
private float rotationSpeed = 0.8f;
private Quaternion initialRotation = null;
private float y = 5;
/**
* Updates the symbol animation based on the current bonus card state.
* The method calls the corresponding update method for each state (SHIELD, SWAP, TURBO).
*
* @param tpf Time per frame, the time elapsed since the last frame.
*/
@Override
protected void controlUpdate(float tpf) {
if (state == null) return;
switch (state) {
case SHIELD -> shieldUpdate(tpf);
case SWAP -> swapUpdate(tpf);
case TURBO -> turboUpdate(tpf);
case HIDDEN -> throw new RuntimeException("forbidden state");
}
}
/**
* Updates the symbol when the state is SHIELD. The symbol zooms in and then zooms out.
* When the zooming out finishes, the symbol is removed from the parent spatial.
*
* @param tpf Time per frame, the time elapsed since the last frame.
*/
private void shieldUpdate(float tpf) {
if (zoomingIn) {
progress += tpf * zoomSpeed;
if (progress > 1) progress = 1;
spatial.setLocalScale(lerp(0, zoomFactor, easeOut(progress)));
if (progress >= 1) {
zoomingIn = false;
zoomingOut = true;
progress = 0;
}
} else if (zoomingOut) {
progress += tpf * zoomSpeed;
spatial.setLocalScale(lerp(zoomFactor, 0, easeIn(progress)));
if (progress > 1) {
zoomingIn = false;
spatial.removeFromParent();
state = null;
progress = 0;
}
}
}
/**
* Updates the symbol when the state is SWAP. The symbol rotates 360 degrees.
* After the rotation finishes, the symbol is removed from the parent spatial.
*
* @param tpf Time per frame, the time elapsed since the last frame.
*/
private void swapUpdate(float tpf) {
if (initialRotation == null) {
initialRotation = spatial.getLocalRotation().clone();
}
progress += tpf * rotationSpeed;
if (progress < 0) return;
float angle = lerp(0, 360, easeInOut(progress));
Quaternion newRotation = new Quaternion();
newRotation.fromAngleAxis((float) Math.toRadians(angle), new Vector3f(0, 1, 0));
spatial.setLocalRotation(initialRotation.mult(newRotation));
if (progress >= 1.2f) {
state = null;
initialRotation = null;
progress = 0;
spatial.removeFromParent();
}
}
/**
* Updates the symbol when the state is TURBO. The symbol moves along the Y-axis with a zoom effect.
* After the movement finishes, the symbol is removed from the parent spatial.
*
* @param tpf Time per frame, the time elapsed since the last frame.
*/
private void turboUpdate(float tpf) {
if (zoomingIn) {
progress += tpf * zoomSpeed;
if (progress > 1) progress = 1;
float y = lerp(-this.y, 0, easeOut(progress));
spatial.setLocalTranslation(0, y, 0);
if (progress >= 1) {
zoomingIn = false;
zoomingOut = true;
progress = 0;
}
} else if (zoomingOut) {
progress += tpf * zoomSpeed;
float y = lerp(0, this.y, easeIn(progress));
spatial.setLocalTranslation(0, y, 0);
if (progress > 1) {
zoomingIn = false;
spatial.removeFromParent();
state = null;
}
}
}
/**
* Starts the SHIELD animation by zooming the symbol in and out.
* The symbol will first zoom in and then zoom out, and will be removed from the parent spatial once done.
*/
public void shield() {
if (state != null) throw new RuntimeException("another state is avtive");
state = BonusCard.SHIELD;
zoomingIn = true;
zoomingOut = false;
progress = 0;
spatial.setLocalScale(1f);
}
/**
* Starts the SWAP animation by rotating the symbol 360 degrees.
* The symbol will rotate once and then be removed from the parent spatial.
*/
public void swap() {
if (state != null) throw new RuntimeException("another state is avtive");
spatial.setLocalScale(3);
state = BonusCard.SWAP;
progress = -0.2f;
}
/**
* Starts the TURBO animation by moving the symbol along the Y-axis.
* The symbol will move upwards and then return to its initial position.
*/
public void turbo() {
if (state != null) throw new RuntimeException("another state is avtive");
spatial.setLocalScale(2);
state = BonusCard.TURBO;
zoomingIn = true;
zoomingOut = false;
progress = 0;
}
/**
* Performs linear interpolation between two values.
*
* @param start The starting value.
* @param end The target value.
* @param t The interpolation parameter (0 <= t <= 1).
* @return The interpolated value.
*/
private static float lerp(float start, float end, float t) {
return (1 - t) * start + t * end;
}
/**
* Ease-out function for smoothing the interpolation.
*
* @param t The interpolation parameter (0 <= t <= 1).
* @return The eased value.
*/
private static float easeOut(float t) {
return (float) Math.sqrt(1 - Math.pow(t - 1, 2));
}
/**
* Ease-in-out function for smoothing the interpolation.
*
* @param t The interpolation parameter (0 <= t <= 1).
* @return The eased value.
*/
private float easeInOut(float t) {
if (t > 1) t = 1;
return (float) -(Math.cos(Math.PI * t) - 1) / 2;
}
/**
* Ease-in function for smoothing the interpolation.
*
* @param t The interpolation parameter (0 <= t <= 1).
* @return The eased value.
*/
private float easeIn(float t) {
return t * t * t * t;
}
}

View File

@@ -0,0 +1,79 @@
package pp.mdga.client.animation;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class TimerManager {
private final List<TimedTask> tasks = new ArrayList<>();
/**
* Add a timed task that will execute after the specified delay.
*
* @param delaySeconds The delay in seconds.
* @param task The Runnable task to execute after the delay.
*/
public void addTask(float delaySeconds, Runnable task) {
tasks.add(new TimedTask(delaySeconds, task));
}
/**
* Update the timer manager to process and execute tasks when their delay has elapsed.
* This should be called in the `controlUpdate` method or a similar update loop.
*
* @param tpf Time per frame (delta time) provided by the update loop.
*/
public void update(float tpf) {
Iterator<TimedTask> iterator = tasks.iterator();
while (iterator.hasNext()) {
TimedTask task = iterator.next();
task.update(tpf);
if (task.isReady()) {
task.run();
iterator.remove();
}
}
}
/**
* Clears all pending tasks from the manager.
*/
public void clearTasks() {
tasks.clear();
}
/**
* Checks if the manager has any pending tasks.
*
* @return True if there are pending tasks, otherwise false.
*/
public boolean hasPendingTasks() {
return !tasks.isEmpty();
}
/**
* Internal class representing a single timed task.
*/
private static class TimedTask {
private float remainingTime;
private final Runnable task;
public TimedTask(float delaySeconds, Runnable task) {
this.remainingTime = delaySeconds;
this.task = task;
}
public void update(float tpf) {
remainingTime -= tpf;
}
public boolean isReady() {
return remainingTime <= 0;
}
public void run() {
task.run();
}
}
}

View File

@@ -0,0 +1,110 @@
package pp.mdga.client.animation;
import pp.mdga.client.InitControl;
/**
* A control that applies a zoom effect to a spatial, smoothly scaling it in and out.
* The zoom effect can be customized with speed and scaling factor.
*
* <p>The control supports zooming in and out with ease-in and ease-out transitions.
* It starts by zooming in, and once complete, it zooms out, eventually removing the spatial from its parent when the animation ends.</p>
*/
public class ZoomControl extends InitControl {
private boolean zoomingIn = false;
private boolean zoomingOut = false;
private float progress = 0;
private float zoomSpeed = 1f;
private float zoomFactor = 1f;
/**
* Constructs a new ZoomControl with the default zoom speed.
*/
public ZoomControl() {
}
/**
* Constructs a new ZoomControl with a specified zoom speed.
*
* @param speed The speed at which the zoom effect occurs.
*/
public ZoomControl(float speed) {
zoomSpeed = speed;
}
/**
* Initializes the spatial for the zoom effect. This method is called when the control is added to the spatial.
* It sets the zooming state to zooming in.
*/
@Override
protected void initSpatial() {
zoomingIn = true;
}
/**
* Updates the zoom effect over time, either zooming in or zooming out.
*
* @param tpf Time per frame, the time elapsed since the last frame.
*/
@Override
protected void controlUpdate(float tpf) {
if (zoomingIn) {
progress += tpf * zoomSpeed;
if (progress > 1) progress = 1;
spatial.setLocalScale(lerp(0, zoomFactor, easeOut(progress)));
if (progress >= 1) {
zoomingIn = false;
zoomingOut = true;
progress = 0;
}
} else if (zoomingOut) {
progress += tpf * zoomSpeed;
spatial.setLocalScale(lerp(zoomFactor, 0, easeIn(progress)));
if (progress > 1) {
zoomingOut = false;
end();
}
}
}
/**
* Ends the zoom animation by removing the spatial from its parent and the control from the spatial.
*/
private void end() {
spatial.removeFromParent();
spatial.removeControl(this);
}
/**
* Performs linear interpolation between two values.
*
* @param start The starting value.
* @param end The target value.
* @param t The interpolation parameter (0 <= t <= 1).
* @return The interpolated value.
*/
private static float lerp(float start, float end, float t) {
return (1 - t) * start + t * end;
}
/**
* Ease-out function for smoothing the zoom-in transition.
*
* @param x The interpolation parameter (0 <= x <= 1).
* @return The eased value.
*/
private float easeOut(float x) {
return x == 1 ? 1 : (float) (1 - Math.pow(2, -10 * x));
}
/**
* Ease-in function for smoothing the zoom-out transition.
*
* @param x The interpolation parameter (0 <= x <= 1).
* @return The eased value.
*/
private float easeIn(float x) {
return x == 0 ? 0 : (float) Math.pow(2, 10 * x - 10);
}
}

View File

@@ -2,4 +2,8 @@
import pp.mdga.client.Asset;
record AssetOnMap(Asset asset, int x, int y, float rot) {}
/**
* Record for holding Asset information
*/
record AssetOnMap(Asset asset, int x, int y, float rot) {
}

View File

@@ -4,11 +4,23 @@
import com.jme3.light.DirectionalLight;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import com.jme3.post.FilterPostProcessor;
import com.jme3.post.filters.FXAAFilter;
import com.jme3.post.ssao.SSAOFilter;
import com.jme3.scene.Spatial;
import com.jme3.shadow.DirectionalLightShadowFilter;
import com.jme3.shadow.EdgeFilteringMode;
import com.jme3.util.SkyFactory;
import com.jme3.util.SkyFactory.EnvMapType;
import pp.mdga.client.MdgaApp;
import pp.mdga.game.Color;
/**
* Handles the camera position, rotation, and lighting effects for the game.
* Provides methods for camera initialization, updates based on user input, and shutdown operations.
*/
public class CameraHandler {
MdgaApp app;
@@ -17,8 +29,33 @@ public class CameraHandler {
private static final int SHADOWMAP_SIZE = 1024 * 8;
public CameraHandler(MdgaApp app, FilterPostProcessor fpp){
private Vector3f defaultCameraPosition;
private Quaternion defaultCameraRotation;
FilterPostProcessor fpp;
DirectionalLightShadowFilter dlsf;
Spatial sky;
private Color ownColor;
private boolean init;
private boolean initRot;
private SSAOFilter ssaoFilter;
private FXAAFilter fxaaFilter;
/**
* Constructor for the CameraHandler. Initializes the camera settings and lighting.
*
* @param app The main application instance that provides the camera and root node.
* @param fpp The FilterPostProcessor used for post-processing effects.
*/
public CameraHandler(MdgaApp app, FilterPostProcessor fpp) {
init = false;
initRot = false;
this.app = app;
this.fpp = fpp;
// Save the default camera state
this.defaultCameraPosition = app.getCamera().getLocation().clone();
this.defaultCameraRotation = app.getCamera().getRotation().clone();
sun = new DirectionalLight();
sun.setColor(ColorRGBA.White);
@@ -27,22 +64,67 @@ public CameraHandler(MdgaApp app, FilterPostProcessor fpp){
ambient = new AmbientLight();
ambient.setColor(new ColorRGBA(0.3f, 0.3f, 0.3f, 1));
DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter(app.getAssetManager(), SHADOWMAP_SIZE, 4);
dlsf = new DirectionalLightShadowFilter(app.getAssetManager(), SHADOWMAP_SIZE, 1);
dlsf.setLight(sun);
fpp.addFilter(dlsf);
dlsf.setEnabled(true);
dlsf.setEdgeFilteringMode(EdgeFilteringMode.PCFPOISSON);
dlsf.setShadowIntensity(0.7f);
ssaoFilter = new SSAOFilter(6, 10f, 0.33f, 0.61f);
// ssaoFilter = new SSAOFilter();
fxaaFilter = new FXAAFilter();
sky = SkyFactory.createSky(app.getAssetManager(), "Images/sky/sky.dds", EnvMapType.EquirectMap).rotate(FastMath.HALF_PI * 1, 0, FastMath.HALF_PI * 0.2f);
}
public void init() {
/**
* Initializes the camera with a specific color orientation.
* Adds lights, sky, and shadow filters to the scene.
*
* @param ownColor The color that defines the initial camera view angle.
*/
public void init(Color ownColor) {
app.getRootNode().addLight(sun);
app.getRootNode().addLight(ambient);
app.getRootNode().attachChild(sky);
fpp.addFilter(dlsf);
fpp.addFilter(ssaoFilter);
fpp.addFilter(fxaaFilter);
init = true;
initRot = true;
this.ownColor = ownColor;
app.getInputSynchronize().setRotation(getInitAngleByColor(ownColor) * 2);
}
/**
* Shuts down the camera handler by removing all lights, sky, and filters,
* and resets the camera position and rotation to its default state.
*/
public void shutdown() {
app.getRootNode().removeLight(sun);
init = false;
fpp.removeFilter(fxaaFilter);
fpp.removeFilter(ssaoFilter);
fpp.removeFilter(dlsf);
app.getRootNode().detachChild(sky);
app.getRootNode().removeLight(ambient);
app.getRootNode().removeLight(sun);
// Reset the camera to its default state
app.getCamera().setLocation(defaultCameraPosition);
app.getCamera().setRotation(defaultCameraRotation);
}
/**
* Updates the camera position and rotation based on user input (scroll and rotation).
* Adjusts the vertical angle and radius based on zoom and rotation values.
*
* @param scroll The scroll input, determining zoom level.
* @param rotation The rotation input, determining camera orientation.
*/
public void update(float scroll, float rotation) {
if (!init) return;
float scrollValue = Math.max(0, Math.min(scroll, 100));
float rotationValue = rotation % 360;
@@ -50,6 +132,7 @@ public void update(float scroll, float rotation) {
rotationValue += 360;
}
float radius;
float verticalAngle;
@@ -58,10 +141,9 @@ public void update(float scroll, float rotation) {
radius = 30f;
} else {
verticalAngle = 90f;
rotationValue = 270f;
rotationValue = getAngleByColor(ownColor);
radius = 50f;
}
float verticalAngleRadians = FastMath.DEG_TO_RAD * verticalAngle;
float z = radius * FastMath.sin(verticalAngleRadians);
@@ -74,4 +156,30 @@ public void update(float scroll, float rotation) {
app.getCamera().lookAt(Vector3f.ZERO, Vector3f.UNIT_Z);
}
/**
* Returns the camera angle based on the specified color.
*
* @param color The color used to determine the camera angle.
* @return The camera angle in degrees.
*/
private float getAngleByColor(Color color) {
return switch (color) {
case ARMY -> 0;
case AIRFORCE -> 90;
case NAVY -> 270;
case CYBER -> 180;
default -> throw new RuntimeException("None is not allowed");
};
}
/**
* Returns the initial camera angle based on the specified color.
*
* @param color The color used to determine the camera angle.
* @return The initial camera angle in degrees.
*/
private float getInitAngleByColor(Color color) {
return (getAngleByColor(color) + 180) % 360;
}
}

View File

@@ -10,17 +10,33 @@
import java.util.ArrayList;
import java.util.List;
/**
* A utility class for loading and parsing map data from a file.
* The map contains asset names and coordinates for objects placed on the map.
*/
class MapLoader {
/**
* Private constructor to prevent instantiation.
*/
private MapLoader() {
}
/**
* Loads a map file and parses its contents into a list of assets and their positions.
* Each line in the map file defines an asset, its coordinates, and its rotation.
*
* @param mapName The name of the map file to load. The file is expected to be located in the resources directory.
* @return A list of {@link AssetOnMap} objects representing the assets placed on the map.
* @throws IOException If an error occurs while reading the map file.
* @throws IllegalArgumentException If the map file contains invalid data.
*/
public static List<AssetOnMap> loadMap(String mapName) {
List<AssetOnMap> assetsOnMap = new ArrayList<>();
try (
InputStream inputStream = MapLoader.class.getClassLoader().getResourceAsStream(mapName);
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))
InputStream inputStream = MapLoader.class.getClassLoader().getResourceAsStream(mapName);
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))
) {
while (true) {
@@ -49,17 +65,22 @@ public static List<AssetOnMap> loadMap(String mapName) {
Asset asset = getLoadedAsset(assetName);
assetsOnMap.add(new AssetOnMap(asset, x, y, rot));
}
}
catch (IOException e) {
} catch (IOException e) {
e.printStackTrace();
}
catch (IllegalArgumentException e) {
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
return assetsOnMap;
}
/**
* Returns the corresponding {@link Asset} for a given asset name.
*
* @param assetName The name of the asset to load.
* @return The {@link Asset} associated with the given name.
* @throws IllegalStateException If the asset name is unrecognized.
*/
private static Asset getLoadedAsset(String assetName) {
return switch (assetName) {
case "lw" -> Asset.lw;
@@ -84,8 +105,11 @@ private static Asset getLoadedAsset(String assetName) {
case "radar" -> Asset.radar;
case "ship" -> Asset.ship;
case "tank" -> Asset.tank;
case "tree_small" -> Asset.tree_small;
case "tree_big" -> Asset.tree_big;
case "treeSmall" -> Asset.treeSmall;
case "treeBig" -> Asset.treeBig;
case "tank_shoot" -> Asset.tankShoot;
case "treesBigBackground" -> Asset.treesBigBackground;
case "treesSmallBackground" -> Asset.treesSmallBackground;
default -> throw new IllegalStateException("Unexpected value: " + assetName);
};
}

View File

@@ -1,22 +1,34 @@
package pp.mdga.client.board;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.control.AbstractControl;
import com.jme3.post.FilterPostProcessor;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.outline.OutlineControl;
public class NodeControl extends AbstractControl {
/**
* A control that adds highlighting functionality to a node in the game.
* This class extends {@link OutlineControl} to add an outline effect when the node is highlighted.
*/
public class NodeControl extends OutlineOEControl {
@Override
protected void controlUpdate(float v) {
/**
* Constructs a {@link NodeControl} with the specified application and post processor.
* This constructor sets up the necessary elements for highlighting functionality.
*
* @param app The {@link MdgaApp} instance to use for the application context.
* @param fpp The {@link FilterPostProcessor} to apply post-processing effects.
*/
public NodeControl(MdgaApp app, FilterPostProcessor fpp) {
super(app, fpp, app.getCamera());
}
@Override
protected void controlRender(RenderManager renderManager, ViewPort viewPort) {
}
public Vector3f getLocation(){
/**
* Returns the location of the node in 3D space.
* This is the node's local translation in the scene.
*
* @return The {@link Vector3f} representing the node's location.
*/
public Vector3f getLocation() {
return this.getSpatial().getLocalTranslation();
}
}

View File

@@ -1,79 +0,0 @@
package pp.mdga.client.board.Outline;
import com.jme3.asset.AssetManager;
import com.jme3.material.Material;
import com.jme3.material.MaterialDef;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector2f;
import com.jme3.post.Filter;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.texture.FrameBuffer;
public class OutlineFilter extends Filter {
private OutlinePreFilter outlinePreFilter;
private ColorRGBA outlineColor = new ColorRGBA(0, 1, 0, 1);
private float outlineWidth = 1;
public OutlineFilter(OutlinePreFilter outlinePreFilter) {
super("OutlineFilter");
this.outlinePreFilter = outlinePreFilter;
}
@Override
protected void initFilter(AssetManager assetManager, RenderManager renderManager, ViewPort vp, int w, int h) {
MaterialDef matDef = (MaterialDef) assetManager.loadAsset("MatDefs/SelectObjectOutliner/Outline.j3md");
material = new Material(matDef);
material.setVector2("Resolution", new Vector2f(w, h));
material.setColor("OutlineColor", outlineColor);
material.setFloat("OutlineWidth", outlineWidth);
}
@Override
protected void preFrame(float tpf) {
super.preFrame(tpf);
material.setTexture("OutlineDepthTexture", outlinePreFilter.getOutlineTexture());
// System.out.println("OutlineFilter.preFrame()");
}
@Override
protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) {
super.postFrame(renderManager, viewPort, prevFilterBuffer, sceneBuffer);
// material.setTexture("OutlineDepthTexture", outlinePreFilter.getDefaultPassDepthTexture());
// System.out.println("OutlineFilter.postFrame()");
}
@Override
protected Material getMaterial() {
return material;
}
public ColorRGBA getOutlineColor() {
return outlineColor;
}
public void setOutlineColor(ColorRGBA outlineColor) {
this.outlineColor = outlineColor;
if (material != null) {
material.setColor("OutlineColor", outlineColor);
}
}
public float getOutlineWidth() {
return outlineWidth;
}
public void setOutlineWidth(float outlineWidth) {
this.outlineWidth = outlineWidth;
if (material != null) {
material.setFloat("OutlineWidth", outlineWidth);
}
}
public OutlinePreFilter getOutlinePreFilter() {
return outlinePreFilter;
}
}

View File

@@ -1,67 +0,0 @@
package pp.mdga.client.board.Outline;
import com.jme3.asset.AssetManager;
import com.jme3.material.Material;
import com.jme3.post.Filter;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.Renderer;
import com.jme3.renderer.ViewPort;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.texture.FrameBuffer;
import com.jme3.texture.Image.Format;
import com.jme3.texture.Texture;
public class OutlinePreFilter extends Filter {
private Pass normalPass;
private RenderManager renderManager;
/**
* Creates a OutlinePreFilter
*/
public OutlinePreFilter() {
super("OutlinePreFilter");
}
@Override
protected boolean isRequiresDepthTexture() {
return true;
}
@Override
protected void postQueue(RenderQueue queue) {
Renderer r = renderManager.getRenderer();
r.setFrameBuffer(normalPass.getRenderFrameBuffer());
renderManager.getRenderer().clearBuffers(true, true, false);
}
@Override
protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) {
super.postFrame(renderManager, viewPort, prevFilterBuffer, sceneBuffer);
}
@Override
protected Material getMaterial() {
return material;
}
public Texture getOutlineTexture() {
return normalPass.getRenderedTexture();
}
@Override
protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) {
this.renderManager = renderManager;
normalPass = new Pass();
normalPass.init(renderManager.getRenderer(), w, h, Format.RGBA8, Format.Depth);
material = new Material(manager, "MatDefs/SelectObjectOutliner/OutlinePre.j3md");
}
@Override
protected void cleanUpFilter(Renderer r) {
normalPass.cleanup(r);
}
}

View File

@@ -1,71 +0,0 @@
package pp.mdga.client.board.Outline;
import com.jme3.asset.AssetManager;
import com.jme3.math.ColorRGBA;
import com.jme3.post.FilterPostProcessor;
import com.jme3.renderer.Camera;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Spatial;
public class SelectObjectOutliner {
private final FilterPostProcessor fpp;
private final RenderManager renderManager;
private final AssetManager assetManager;
private final Camera cam;
private final int width;
private boolean selected;
private ViewPort outlineViewport = null;
private OutlineFilter outlineFilter = null;
public SelectObjectOutliner(int width, FilterPostProcessor fpp, RenderManager renderManager, AssetManager assetManager, Camera cam) {
this.selected = false;
this.fpp = fpp;
this.renderManager = renderManager;
this.assetManager = assetManager;
this.cam = cam;
this.width = width;
}
public void deselect(Spatial model) {
if(selected){
selected = false;
hideOutlineFilterEffect(model);
}
}
public void select(Spatial model, ColorRGBA color) {
if(!selected){
selected = true;
showOutlineFilterEffect(model, width, color);
}
}
private void hideOutlineFilterEffect(Spatial model) {
outlineFilter.setEnabled(false);
outlineFilter.getOutlinePreFilter().setEnabled(false);
fpp.removeFilter(outlineFilter);
outlineViewport.detachScene(model);
renderManager.removePreView(outlineViewport);
outlineViewport = null;
}
private void showOutlineFilterEffect(Spatial model, int width, ColorRGBA color) {
outlineViewport = renderManager.createPreView("outlineViewport", cam);
FilterPostProcessor outlineFpp = new FilterPostProcessor(assetManager);
OutlinePreFilter outlinePreFilter = new OutlinePreFilter();
outlineFpp.addFilter(outlinePreFilter);
outlineViewport.attachScene(model);
outlineViewport.addProcessor(outlineFpp);
outlineFilter = new OutlineFilter(outlinePreFilter);
outlineFilter.setOutlineColor(color);
outlineFilter.setOutlineWidth(width);
fpp.addFilter(outlineFilter);
}
}

View File

@@ -0,0 +1,58 @@
package pp.mdga.client.board;
import com.jme3.math.ColorRGBA;
import com.jme3.post.FilterPostProcessor;
import com.jme3.renderer.Camera;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.outline.OutlineControl;
/**
* OutlineOEControl class extends OutlineControl to manage outline colors and widths
* for own and enemy objects, including hover and select states.
*/
public class OutlineOEControl extends OutlineControl {
private static final ColorRGBA OUTLINE_OWN_COLOR = ColorRGBA.White;
private static final ColorRGBA OUTLINE_ENEMY_COLOR = ColorRGBA.Red;
private static final ColorRGBA OUTLINE_OWN_HOVER_COLOR = ColorRGBA.Yellow;
private static final ColorRGBA OUTLINE_ENEMY_HOVER_COLOR = ColorRGBA.Green;
private static final ColorRGBA OUTLINE_OWN_SELECT_COLOR = ColorRGBA.Cyan;
private static final ColorRGBA OUTLINE_ENEMY_SELECT_COLOR = ColorRGBA.Orange;
private static final int OUTLINE_HIGHLIGHT_WIDTH = 8;
private static final int OUTLINE_HOVER_WIDTH = 8;
private static final int OUTLINE_SELECT_WIDTH = 10;
/**
* Constructor for OutlineOEControl.
*
* @param app the MdgaApp instance
* @param fpp the FilterPostProcessor instance
* @param cam the Camera instance
*/
public OutlineOEControl(MdgaApp app, FilterPostProcessor fpp, Camera cam){
super(app, fpp, cam,
OUTLINE_OWN_COLOR, OUTLINE_HIGHLIGHT_WIDTH,
OUTLINE_OWN_HOVER_COLOR, OUTLINE_HOVER_WIDTH,
OUTLINE_OWN_SELECT_COLOR, OUTLINE_SELECT_WIDTH
);
}
/**
* Sets the outline colors and enables selection for own objects.
*/
public void selectableOwn(){
setHighlightColor(OUTLINE_OWN_COLOR);
setHoverColor(OUTLINE_OWN_HOVER_COLOR);
setSelectColor(OUTLINE_OWN_SELECT_COLOR);
selectableOn();
}
/**
* Sets the outline colors and enables selection for enemy objects.
*/
public void selectableEnemy(){
setHighlightColor(OUTLINE_ENEMY_COLOR);
setHoverColor(OUTLINE_ENEMY_HOVER_COLOR);
setSelectColor(OUTLINE_ENEMY_SELECT_COLOR);
selectableOn();
}
}

View File

@@ -7,18 +7,21 @@
import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import com.jme3.post.FilterPostProcessor;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.control.AbstractControl;
import pp.mdga.client.Asset;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.board.Outline.SelectObjectOutliner;
import pp.mdga.client.outline.OutlineControl;
public class PieceControl extends AbstractControl {
/**
* A control that manages the behavior and properties of a game piece, such as its rotation,
* position, shield activation, and highlighting. This class extends {@link OutlineControl}
* to provide outline functionality and includes additional features like shield effects,
* hover states, and selection states.
*/
public class PieceControl extends OutlineOEControl {
private final float initRotation;
private final AssetManager assetManager;
private Spatial shieldRing;
@@ -30,88 +33,116 @@ public class PieceControl extends AbstractControl {
private static final ColorRGBA SHIELD_SUPPRESSED_COLOR = new ColorRGBA(1f, 0.5f, 0, SHIELD_TRANSPARENCY);
private static final float SHIELD_Z = 0f;
SelectObjectOutliner outlineOwn;
private static final ColorRGBA OUTLINE_OWN_COLOR = ColorRGBA.White;
private static final ColorRGBA OUTLINE_ENEMY_COLOR = ColorRGBA.Red;
private static final int OUTLINE_THICKNESS = 4;
private final Node parentNode;
private boolean enemy;
private boolean hoverable;
private boolean highlight;
private boolean selectable;
private boolean select;
public PieceControl(float initRotation, AssetManager assetManager, MdgaApp app, FilterPostProcessor fpp){
super();
/**
* Constructs a {@link PieceControl} with the specified initial rotation, asset manager,
* application, and post-processor.
*
* @param initRotation The initial rotation of the piece in degrees.
* @param assetManager The {@link AssetManager} used for loading models and materials.
* @param app The {@link MdgaApp} instance to use for the application context.
* @param fpp The {@link FilterPostProcessor} to apply post-processing effects.
*/
public PieceControl(float initRotation, AssetManager assetManager, MdgaApp app, FilterPostProcessor fpp) {
super(app, fpp, app.getCamera());
this.parentNode = new Node();
this.initRotation = initRotation;
this.assetManager = assetManager;
this.shieldRing = null;
this.shieldMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
this.shieldMat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
outlineOwn = new SelectObjectOutliner(OUTLINE_THICKNESS, fpp, app.getRenderManager(), app.getAssetManager(), app.getCamera());
}
/**
* Gets the current rotation of the piece in degrees.
*
* @return The rotation of the piece in degrees.
*/
public float getRotation() {
return (float) Math.toDegrees(this.spatial.getLocalRotation().toAngleAxis(new Vector3f(0,0,1)));
return (float) Math.toDegrees(spatial.getLocalRotation().toAngleAxis(new Vector3f(0, 0, 1)));
}
public void setRotation(float rot){
/**
* Sets the rotation of the piece to the specified value in degrees.
*
* @param rot The rotation in degrees to set.
*/
public void setRotation(float rot) {
if (rot < 0) rot = -360;
Quaternion quaternion = new Quaternion();
quaternion.fromAngleAxis((float) Math.toRadians(rot), new Vector3f(0,0,1));
this.spatial.setLocalRotation(quaternion);
quaternion.fromAngleAxis((float) Math.toRadians(rot), new Vector3f(0, 0, 1));
spatial.setLocalRotation(quaternion);
}
public Vector3f getLocation(){
return this.getSpatial().getLocalTranslation();
/**
* Gets the current location (position) of the piece.
*
* @return The location of the piece as a {@link Vector3f}.
*/
public Vector3f getLocation() {
return spatial.getLocalTranslation();
}
/**
* Updates the piece control every frame. If the shield is active, it will rotate.
*
* @param delta The time difference between frames (time per frame).
*/
@Override
protected void controlUpdate(float delta) {
if(shieldRing != null){
if (shieldRing != null) {
shieldRing.rotate(0, 0, delta * SHIELD_SPEED);
shieldRing.setLocalTranslation(spatial.getLocalTranslation().add(new Vector3f(0, 0, SHIELD_Z)));
}
}
/**
* Sets the location (position) of the piece.
*
* @param loc The location to set as a {@link Vector3f}.
*/
public void setLocation(Vector3f loc) {
this.spatial.setLocalTranslation(loc);
}
/**
* Initializes the spatial object and sets its rotation.
* This also moves the spatial to a new parent node for organizational purposes.
*/
@Override
protected void controlRender(RenderManager renderManager, ViewPort viewPort) {
}
public void setLocation(Vector3f loc){
this.getSpatial().setLocalTranslation(loc);
}
@Override
public void setSpatial(Spatial spatial){
if(this.getSpatial() == null && spatial != null){
super.setSpatial(spatial);
initSpatial();
}
else{
super.setSpatial(spatial);
}
}
public void initSpatial(){
public void initSpatial() {
setRotation(this.initRotation);
Node oldParent = this.spatial.getParent();
this.parentNode.setName(this.spatial.getName() + " Parent");
Node oldParent = spatial.getParent();
this.parentNode.setName(spatial.getName() + " Parent");
oldParent.detachChild(this.getSpatial());
this.parentNode.attachChild(this.getSpatial());
oldParent.attachChild(this.parentNode);
}
public void rotateInit() {
// rotate(rotation - initRotation);
setRotation(initRotation);
}
public void activateShield(){
shieldRing = assetManager.loadModel(Asset.shield_ring.getModelPath());
/**
* Activates the shield around the piece.
* This adds a visual shield effect in the form of a rotating ring.
*/
public void activateShield() {
if (shieldRing != null) {
deactivateShield();
}
shieldRing = assetManager.loadModel(Asset.shieldRing.getModelPath());
shieldRing.scale(1f);
shieldRing.rotate((float) Math.toRadians(0), 0, (float) Math.toRadians(0));
shieldRing.setLocalTranslation(spatial.getLocalTranslation().add(new Vector3f(0,0,SHIELD_Z)));
shieldRing.setLocalTranslation(spatial.getLocalTranslation().add(new Vector3f(0, 0, SHIELD_Z)));
shieldRing.setQueueBucket(RenderQueue.Bucket.Transparent); // Render in the transparent bucket
@@ -121,30 +152,28 @@ public void activateShield(){
parentNode.attachChild(shieldRing);
}
public void deactivateShield(){
/**
* Deactivates the shield by removing the shield ring from the scene.
*/
public void deactivateShield() {
parentNode.detachChild(shieldRing);
shieldRing = null;
}
public void suppressShield(){
assert(shieldRing != null) : "PieceControl: shieldRing is not set";
/**
* Suppresses the shield, changing its color to a suppressed state.
*/
public void suppressShield() {
assert (shieldRing != null) : "PieceControl: shieldRing is not set";
shieldMat.setColor("Color", SHIELD_SUPPRESSED_COLOR);
}
public void setMaterial(Material mat){
this.spatial.setMaterial(mat);
public void setMaterial(Material mat) {
spatial.setMaterial(mat);
}
public Material getMaterial(){
return ((Geometry) this.spatial).getMaterial();
}
public void outline(boolean enemy) {
ColorRGBA color = enemy ? OUTLINE_ENEMY_COLOR : OUTLINE_OWN_COLOR;
outlineOwn.select(this.getSpatial(), color);
}
public void deOutline() {
outlineOwn.deselect(this.getSpatial());
public Material getMaterial() {
return ((Geometry) getSpatial()).getMaterial();
}
}

View File

@@ -1,5 +0,0 @@
package pp.mdga.client.board;
class PileControl {
}

View File

@@ -1,12 +0,0 @@
package pp.mdga.client.board;
public enum Rotation {
UP,
RIGHT,
DOWN,
LEFT,
UP_LEFT,
UP_RIGHT,
DOWN_RIGHT,
DOWN_LEFT
}

View File

@@ -0,0 +1,130 @@
package pp.mdga.client.board;
import com.jme3.math.FastMath;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import pp.mdga.client.InitControl;
import static pp.mdga.client.Util.linInt;
/**
* Controls the rotation of the tank's top part to face an enemy position.
*/
public class TankTopControl extends InitControl {
private float timer = 0; // Time elapsed
private final static float DURATION = 1.5f; // Total rotation duration in seconds
private boolean rotating = false; // Flag to track if rotation is active
private float startAngle = 0;
private float endAngle = 0;
private Runnable actionAfter = null;
/**
* Updates the control each frame.
*
* @param tpf Time per frame
*/
@Override
protected void controlUpdate(float tpf) {
if (!rotating) return;
// Update the timer
timer += tpf;
// Calculate interpolation factor (0 to 1)
float t = timer / DURATION;
if (t >= 1) t = 1;
float curAngle = linInt(startAngle, endAngle, t);
// Interpolate the rotation
Quaternion interpolatedRotation = new Quaternion();
interpolatedRotation.fromAngleAxis((float) Math.toRadians(curAngle), Vector3f.UNIT_Z);
// Apply the interpolated rotation to the spatial
spatial.setLocalRotation(interpolatedRotation);
if (t >= 1) {
rotating = false;
if (actionAfter != null) actionAfter.run();
}
}
/**
* Initiates the rotation of the tank's top part to face the enemy position.
*
* @param enemyPos The position of the enemy
* @param actionAfter The action to execute after the rotation is complete
*/
public void rotate(Vector3f enemyPos, Runnable actionAfter) {
if (spatial == null) throw new RuntimeException("spatial is null");
startAngle = getOwnAngle();
endAngle = getEnemyAngle(enemyPos);
// Adjust endAngle to ensure the shortest path
float deltaAngle = endAngle - startAngle;
if (deltaAngle > 180) {
endAngle -= 360; // Rotate counterclockwise
} else if (deltaAngle < -180) {
endAngle += 360; // Rotate clockwise
}
timer = 0;
rotating = true;
this.actionAfter = actionAfter; // Store the action to execute after rotation
}
/**
* Calculates the angle to the enemy position.
*
* @param enemyPos The position of the enemy
* @return The angle to the enemy in degrees
*/
private float getEnemyAngle(Vector3f enemyPos) {
// Direction to the enemy in the XY plane
Vector3f direction = enemyPos.subtract(spatial.getLocalTranslation());
direction.z = 0; // Project to XY plane
direction.normalizeLocal();
Vector3f reference = Vector3f.UNIT_Y.mult(-1);
// Calculate the angle between the direction vector and the reference vector
float angle = FastMath.acos(reference.dot(direction));
// Determine rotation direction using the cross product
Vector3f cross = reference.cross(direction);
if (cross.z < 0) {
angle = -angle;
}
return (float) Math.toDegrees(angle); // Return the absolute angle in degrees
}
/**
* Calculates the tank's current angle.
*
* @return The tank's current angle in degrees
*/
private float getOwnAngle() {
// Tank's forward direction in the XY plane
Vector3f forward = spatial.getLocalRotation().mult(Vector3f.UNIT_Y);
forward.z = 0; // Project to XY plane
forward.normalizeLocal();
// Reference vector: Positive X-axis
Vector3f reference = Vector3f.UNIT_Y;
// Calculate the angle between the forward vector and the reference vector
float angle = FastMath.acos(reference.dot(forward));
// Determine rotation direction using the cross product
Vector3f cross = reference.cross(forward);
if (cross.z < 0) { // For Z-up, check the Z component of the cross product
angle = -angle;
}
return (float) Math.toDegrees(angle); // Return the absolute angle in radians
}
}

View File

@@ -0,0 +1,165 @@
package pp.mdga.client.button;
import com.jme3.font.BitmapFont;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector2f;
import com.jme3.scene.Node;
import com.jme3.ui.Picture;
import pp.mdga.client.MdgaApp;
/**
* Represents an abstract base class for creating customizable button components in a graphical user interface.
* This class provides the framework for rendering buttons with different visual states, such as normal and pressed,
* and supports position adjustments and font customization.
*
* <p>Subclasses must implement the {@link #show()} and {@link #hide()} methods to define how the button
* is displayed and hidden in the application.</p>
*/
public abstract class AbstractButton {
/**
* Color representing the normal state of the button.
*/
public static final ColorRGBA BUTTON_NORMAL = ColorRGBA.fromRGBA255(233, 236, 239, 255);
/**
* Color representing the pressed state of the button.
*/
public static final ColorRGBA BUTTON_PRESSED = ColorRGBA.fromRGBA255(105, 117, 89, 255);
/**
* Color representing the normal state of the button text.
*/
public static final ColorRGBA TEXT_NORMAL = ColorRGBA.Black;
/**
* Color representing the pressed state of the button text.
*/
public static final ColorRGBA TEXT_PRESSED = ColorRGBA.fromRGBA255(180, 195, 191, 255);
/**
* The image representing the normal state of the button.
*/
protected Picture pictureNormal = new Picture("normalButton");
/**
* The image representing the hover state of the button.
*/
protected Picture pictureHover = new Picture("normalButton");
/**
* The number of horizontal divisions for calculating relative sizes.
*/
public static final float HORIZONTAL = 16;
/**
* The number of vertical divisions for calculating relative sizes.
*/
public static final float VERTICAL = 9;
/**
* The font used for rendering text on the button.
*/
protected BitmapFont font;
/**
* Reference to the application instance for accessing assets and settings.
*/
protected final MdgaApp app;
/**
* Node in the scene graph to which the button belongs.
*/
protected final Node node;
/**
* The position of the button in 2D space.
*/
protected Vector2f pos;
/**
* Factor for scaling the font size.
*/
protected float fontSizeFactor = 1.0f;
/**
* Computed font size based on scaling factor and screen dimensions.
*/
protected float fontSize;
/**
* Computed horizontal step size based on screen dimensions.
*/
protected float horizontalStep;
/**
* Computed vertical step size based on screen dimensions.
*/
protected float verticalStep;
/**
* Computed height step size based on vertical steps.
*/
protected float heightStep;
/**
* Computed width step size based on horizontal steps.
*/
protected float widthStep;
/**
* Flag indicating whether adjustments are applied to the button.
*/
protected boolean adjust = false;
/**
* Constructs an AbstractButton instance with the specified application context and scene node.
* Initializes the button's visual elements and font.
*
* @param app the application instance for accessing resources
* @param node the node in the scene graph to which the button is attached
*/
public AbstractButton(MdgaApp app, Node node) {
this.app = app;
this.node = node;
pictureNormal.setImage(app.getAssetManager(), "Images/General_Button_normal.png", true);
pictureHover.setImage(app.getAssetManager(), "Images/General_Button_hover.png", true);
font = app.getAssetManager().loadFont("Fonts/Gunplay.fnt");
}
/**
* Displays the button. Implementation must define how the button is rendered on the screen.
*/
public abstract void show();
/**
* Hides the button. Implementation must define how the button is removed from the screen.
*/
public abstract void hide();
/**
* Sets the position of the button in 2D space.
*
* @param pos the position to set
*/
public void setPos(Vector2f pos) {
this.pos = pos;
}
/**
* Calculates relative sizes and dimensions for the button based on the screen resolution.
*/
protected void calculateRelative() {
fontSize = fontSizeFactor * 15 * (float) app.getCamera().getWidth() / 720;
horizontalStep = (float) app.getCamera().getWidth() / HORIZONTAL;
verticalStep = (float) app.getCamera().getHeight() / VERTICAL;
heightStep = verticalStep / 2;
widthStep = horizontalStep / 2;
}
public Vector2f getPos() {
return pos;
}
}

View File

@@ -0,0 +1,45 @@
package pp.mdga.client.button;
import com.jme3.math.Vector2f;
import com.jme3.scene.Node;
import pp.mdga.client.MdgaApp;
/**
* Represents a specific implementation of a clickable button positioned on the left side.
* This class extends {@link ClickButton} and provides a predefined position and size for the button.
* It also includes placeholder methods for handling hover events, which can be customized as needed.
*/
public class ButtonLeft extends ClickButton {
/**
* Constructs a ButtonLeft instance with the specified properties.
*
* @param app the application instance for accessing resources and settings
* @param node the node in the scene graph to which the button belongs
* @param action the action to execute when the button is clicked
* @param label the text label to display on the button
* @param narrowFactor a factor to adjust position of the button
*/
public ButtonLeft(MdgaApp app, Node node, Runnable action, String label, int narrowFactor) {
super(app, node, action, label, new Vector2f(5, 2), new Vector2f(0.5f * narrowFactor, 1.8f));
}
/**
* Called when the button is hovered over by the pointer.
* Subclasses can override this method to define specific hover behavior.
*/
@Override
public void onHover() {
// Placeholder for hover behavior
}
/**
* Called when the pointer stops hovering over the button.
* Subclasses can override this method to define specific unhover behavior.
*/
@Override
public void onUnHover() {
// Placeholder for unhover behavior
}
}

View File

@@ -0,0 +1,48 @@
package pp.mdga.client.button;
import com.jme3.math.Vector2f;
import com.jme3.scene.Node;
import pp.mdga.client.MdgaApp;
/**
* Represents a specific implementation of a clickable button positioned on the right side.
* This class extends {@link ClickButton} and provides a predefined position and size for the button.
* It includes placeholder methods for handling hover events, which can be customized as needed.
*/
public class ButtonRight extends ClickButton {
/**
* Constructs a ButtonRight instance with the specified properties.
*
* @param app the application instance for accessing resources and settings
* @param node the node in the scene graph to which the button belongs
* @param action the action to execute when the button is clicked
* @param label the text label to display on the button
* @param narrowFactor a factor to adjust the position of the button
*/
public ButtonRight(MdgaApp app, Node node, Runnable action, String label, int narrowFactor) {
super(app, node, action, label, new Vector2f(5, 2), new Vector2f(HORIZONTAL - 0.5f * narrowFactor, 1.8f));
// Enable adjustments specific to this button
adjust = true;
}
/**
* Called when the button is hovered over by the pointer.
* Subclasses can override this method to define specific hover behavior.
*/
@Override
public void onHover() {
// Placeholder for hover behavior
}
/**
* Called when the pointer stops hovering over the button.
* Subclasses can override this method to define specific unhover behavior.
*/
@Override
public void onUnHover() {
// Placeholder for unhover behavior
}
}

View File

@@ -0,0 +1,252 @@
package pp.mdga.client.button;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.simsilica.lemur.component.QuadBackgroundComponent;
import pp.mdga.client.Asset;
import pp.mdga.client.MdgaApp;
import pp.mdga.game.Color;
/**
* Represents a button used in a ceremony screen, with 3D model integration, customizable
* appearance based on type, and interactive behavior. The button can rotate and display
* different positions such as FIRST, SECOND, THIRD, and LOST.
*/
public class CeremonyButton extends ClickButton {
/**
* Enum representing the possible positions of the button in the ceremony screen.
*/
public enum Pos {
FIRST,
SECOND,
THIRD,
LOST,
}
/**
* Fixed width of the button in the UI layout.
*/
static final float WIDTH = 4.0f;
/**
* Node to which the 3D model associated with this button is attached.
*/
private final Node node3d;
/**
* Flag to determine if the button's 3D model should rotate.
*/
private boolean rotate = false;
/**
* The 3D model associated with the button.
*/
private Spatial model;
/**
* Current rotation angle of the button's 3D model.
*/
private float rot = 180;
/**
* The taken state of the button (default is NOT taken).
*/
private LobbyButton.Taken taken = LobbyButton.Taken.NOT;
/**
* A label associated with the button for displaying additional information.
*/
private LabelButton label;
/**
* Constructs a CeremonyButton with specified attributes such as type, position, and label.
* The button supports both 2D and 3D components for UI and visual effects.
*
* @param app the application instance for accessing resources and settings
* @param node the node in the scene graph to which the button belongs
* @param node3d the node for 3D scene components associated with this button
* @param tsk the type/color associated with the button
* @param pos the position of the button in the ceremony layout
* @param name the label or name displayed on the button
*/
public CeremonyButton(MdgaApp app, Node node, Node node3d, Color tsk, Pos pos, String name) {
super(app, node, () -> {
}, "", new Vector2f(WIDTH, 7), new Vector2f(0, 0));
this.node3d = node3d;
label = new LabelButton(app, node, name, new Vector2f(WIDTH, 1), new Vector2f(0, 0), true);
final float mid = HORIZONTAL / 2;
final float uiSpacing = 1.4f;
final float figSpacingX = 0.9f;
final float figSpacingY = 0.25f;
float uiX = mid;
float uiY = 6;
float figX = 0;
float figY = -0.32f;
Asset asset = switch (tsk) {
case CYBER -> {
instance.setText("CIR");
yield Asset.cir;
}
case AIRFORCE -> {
instance.setText("Luftwaffe");
yield Asset.lw;
}
case ARMY -> {
instance.setText("Heer");
yield Asset.heer;
}
case NAVY -> {
instance.setText("Marine");
yield Asset.marine;
}
default -> throw new RuntimeException("None is not valid");
};
switch (pos) {
case FIRST:
rotate = true;
uiX = 0;
figY -= 1 * figSpacingY;
break;
case SECOND:
adjust = true;
label.adjust = true;
uiX -= uiSpacing;
uiY -= 1;
figX -= figSpacingX;
figY -= 2 * figSpacingY;
figY -= 0.1f;
break;
case THIRD:
uiX += uiSpacing;
uiY -= 1.5f;
figX += figSpacingX;
figY -= 3 * figSpacingY;
figY -= 0.07f;
break;
case LOST:
adjust = true;
label.adjust = true;
uiX -= 2 * uiSpacing + 0.4f;
uiX -= WIDTH / 2;
uiY -= 2.0f;
figX -= 2.5f * figSpacingX + 0.05f;
figY -= 4.5f * figSpacingY;
break;
}
setPos(new Vector2f(uiX, uiY));
label.setPos(new Vector2f(uiX, uiY + 1));
createModel(asset, new Vector3f(figX, figY, 6));
}
/**
* Handles hover behavior by changing the button's background appearance.
*/
@Override
public void onHover() {
ColorRGBA buttonNormal = BUTTON_NORMAL.clone();
buttonNormal.a = 0.1f;
QuadBackgroundComponent background = new QuadBackgroundComponent(buttonNormal);
instance.setBackground(background);
}
/**
* Handles unhover behavior by resetting the button's background appearance.
*/
@Override
public void onUnHover() {
ColorRGBA buttonNormal = BUTTON_NORMAL.clone();
buttonNormal.a = 0.1f;
QuadBackgroundComponent background = new QuadBackgroundComponent(buttonNormal);
instance.setBackground(background);
}
/**
* Displays the button along with its 3D model and associated label.
*/
@Override
public void show() {
release();
calculateRelative();
setRelative();
node.attachChild(instance);
node3d.attachChild(model);
label.show();
}
/**
* Hides the button along with its 3D model and associated label.
*/
@Override
public void hide() {
node.detachChild(instance);
node3d.detachChild(model);
label.hide();
}
/**
* Updates the rotation of the button's 3D model over time.
*
* @param tpf time per frame, used for smooth rotation calculations
*/
public void update(float tpf) {
if (rotate) {
rot += 140.0f * tpf;
rot %= 360;
} else {
rot = 180;
}
model.setLocalRotation(new Quaternion().fromAngles(
(float) Math.toRadians(90),
(float) Math.toRadians(rot),
(float) Math.toRadians(180)
));
}
/**
* Creates a 3D model associated with the button and applies its materials and position.
*
* @param asset the asset representing the 3D model and texture
* @param pos the initial position of the model in 3D space
*/
private void createModel(Asset asset, Vector3f pos) {
String modelName = asset.getModelPath();
String texName = asset.getDiffPath();
model = app.getAssetManager().loadModel(modelName);
model.scale(asset.getSize() / 2);
model.rotate(
(float) Math.toRadians(90),
(float) Math.toRadians(rot),
(float) Math.toRadians(180)
);
model.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
model.setLocalTranslation(pos);
Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md");
mat.setTexture("DiffuseMap", app.getAssetManager().loadTexture(texName));
model.setMaterial(mat);
}
}

View File

@@ -0,0 +1,212 @@
package pp.mdga.client.button;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.jme3.ui.Picture;
import com.simsilica.lemur.Button;
import com.simsilica.lemur.HAlignment;
import com.simsilica.lemur.VAlignment;
import com.simsilica.lemur.component.QuadBackgroundComponent;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.acoustic.MdgaSound;
/**
* Abstract base class for creating interactive buttons with click functionality.
* This class extends {@link AbstractButton} and provides additional behavior such as
* click handling, hover effects, and alignment management.
*/
public abstract class ClickButton extends AbstractButton {
/**
* The action to be executed when the button is clicked.
*/
protected final Runnable action;
/**
* The label or text displayed on the button.
*/
protected String label;
/**
* The size of the button in relative units.
*/
protected Vector2f size;
/**
* The instance of the button being managed.
*/
protected Button instance;
/**
* Constructs a ClickButton with the specified properties.
*
* @param app the application instance for accessing resources
* @param node the node in the scene graph to which the button belongs
* @param action the action to execute on button click
* @param label the text label displayed on the button
* @param size the size of the button
* @param pos the position of the button in relative units
*/
ClickButton(MdgaApp app, Node node, Runnable action, String label, Vector2f size, Vector2f pos) {
super(app, node);
this.action = action;
this.label = label;
this.pos = pos;
this.size = size;
instance = new Button(label);
// Add click behavior
instance.addClickCommands((button) -> {
app.getAcousticHandler().playSound(MdgaSound.BUTTON_PRESSED);
action.run();
});
// Set text alignment
instance.setTextHAlignment(HAlignment.Center);
instance.setTextVAlignment(VAlignment.Center);
// Add hover commands
instance.addCommands(Button.ButtonAction.HighlightOn, (button) -> click());
instance.addCommands(Button.ButtonAction.HighlightOff, (button) -> release());
// Set font and colors
instance.setFont(font);
instance.setFocusColor(TEXT_NORMAL);
calculateRelative();
setRelative();
}
/**
* Displays the button by attaching it and its background image to the node.
*/
@Override
public void show() {
node.attachChild(pictureNormal);
release();
calculateRelative();
setRelative();
setImageRelative(pictureNormal);
node.attachChild(instance);
}
/**
* Hides the button by detaching it and its background images from the node.
*/
@Override
public void hide() {
node.detachChild(instance);
if (node.hasChild(pictureNormal)) {
node.detachChild(pictureNormal);
}
if (node.hasChild(pictureHover)) {
node.detachChild(pictureHover);
}
}
/**
* Abstract method to define hover behavior. Must be implemented by subclasses.
*/
protected abstract void onHover();
/**
* Abstract method to define unhover behavior. Must be implemented by subclasses.
*/
protected abstract void onUnHover();
/**
* Handles the button click behavior, including visual feedback and sound effects.
*/
protected void click() {
instance.setColor(TEXT_PRESSED);
instance.setHighlightColor(TEXT_PRESSED);
QuadBackgroundComponent background = new QuadBackgroundComponent(BUTTON_PRESSED);
instance.setBackground(background);
app.getAcousticHandler().playSound(MdgaSound.UI_CLICK);
if (node.hasChild(pictureNormal)) {
node.detachChild(pictureNormal);
setImageRelative(pictureHover);
node.attachChild(pictureHover);
}
onHover();
}
/**
* Resets the button to its normal state after a click or hover event.
*/
protected void release() {
instance.setColor(TEXT_NORMAL);
instance.setHighlightColor(TEXT_NORMAL);
QuadBackgroundComponent background = new QuadBackgroundComponent(BUTTON_NORMAL);
instance.setBackground(background);
if (node.hasChild(pictureHover)) {
node.detachChild(pictureHover);
setImageRelative(pictureNormal);
node.attachChild(pictureNormal);
}
onUnHover();
}
/**
* Sets the relative size and position of the button based on screen dimensions.
*/
protected void setRelative() {
instance.setFontSize(fontSize);
instance.setPreferredSize(new Vector3f(size.x * widthStep, size.y * heightStep, 0));
float xAdjust = 0.0f;
if (adjust) {
xAdjust = instance.getPreferredSize().x;
}
instance.setLocalTranslation(pos.x * horizontalStep - xAdjust, pos.y * verticalStep, -1);
final float horizontalMid = ((float) app.getCamera().getWidth() / 2) - (instance.getPreferredSize().x / 2);
final float verticalMid = ((float) app.getCamera().getHeight() / 2) - instance.getPreferredSize().y / 2;
if (0 == pos.x) {
instance.setLocalTranslation(horizontalMid, instance.getLocalTranslation().y, instance.getLocalTranslation().z);
}
if (0 == pos.y) {
instance.setLocalTranslation(instance.getLocalTranslation().x, verticalMid, instance.getLocalTranslation().z);
}
}
/**
* Sets the relative size and position of the button's background image.
*
* @param picture the background image to set
*/
protected void setImageRelative(Picture picture) {
if (null == picture) {
return;
}
final float larger = 10;
picture.setWidth(instance.getPreferredSize().x + larger);
picture.setHeight(instance.getPreferredSize().y + larger);
picture.setLocalTranslation(
instance.getLocalTranslation().x - larger / 2,
(instance.getLocalTranslation().y - picture.getHeight()) + larger / 2,
instance.getLocalTranslation().z + 0.01f
);
}
}

View File

@@ -0,0 +1,166 @@
package pp.mdga.client.button;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.simsilica.lemur.*;
import com.simsilica.lemur.component.QuadBackgroundComponent;
import pp.mdga.client.MdgaApp;
/**
* Represents an input button with a label and a text field, allowing users to input text.
* The button is designed for graphical user interfaces and supports configurable
* size, position, and character limit.
*/
public class InputButton extends AbstractButton {
/**
* The label associated with the input field, displayed above or beside the text field.
*/
private Label label;
/**
* The text field where users input their text.
*/
private TextField field;
/**
* A container to hold the label and the text field for layout management.
*/
private Container container = new Container();
/**
* The maximum allowed length of the input text.
*/
private final int maxLenght;
/**
* The size of the input button in relative units.
*/
protected Vector2f size;
/**
* Constructs an InputButton with the specified label, character limit, and other properties.
*
* @param app the application instance for accessing resources
* @param node the node in the scene graph to which the input button belongs
* @param label the label displayed with the input field
* @param maxLenght the maximum number of characters allowed in the input field
*/
public InputButton(MdgaApp app, Node node, String label, int maxLenght) {
super(app, node);
this.label = new Label(label);
this.maxLenght = maxLenght;
// Configure label properties
this.label.setColor(TEXT_NORMAL);
// Configure text field properties
field = new TextField("");
field.setColor(TEXT_NORMAL);
field.setTextHAlignment(HAlignment.Left);
field.setTextVAlignment(VAlignment.Center);
// Set background for the text field
QuadBackgroundComponent grayBackground = new QuadBackgroundComponent(BUTTON_NORMAL);
field.setBackground(grayBackground);
// Set fonts for label and text field
this.label.setFont(font);
field.setFont(font);
// Default position and size
pos = new Vector2f(0, 0);
size = new Vector2f(5.5f, 1);
// Add components to the container
container.addChild(this.label);
container.addChild(field);
}
/**
* Displays the input button by attaching it to the scene graph node.
*/
@Override
public void show() {
calculateRelative();
setRelative();
node.attachChild(container);
}
/**
* Hides the input button by detaching it from the scene graph node.
*/
@Override
public void hide() {
node.detachChild(container);
}
/**
* Updates the input field, enforcing the character limit.
* Trims the text if it exceeds the maximum allowed length.
*/
public void update() {
String text = field.getText();
int length = text.length();
if (length > maxLenght) {
field.setText(text.substring(0, maxLenght));
}
}
/**
* Adjusts the relative size and position of the input button based on the screen resolution.
*/
protected void setRelative() {
this.label.setFontSize(fontSize);
field.setFontSize(fontSize);
field.setPreferredSize(new Vector3f(size.x * widthStep, size.y * heightStep, 0));
float xAdjust = 0.0f;
if (adjust) {
xAdjust = container.getPreferredSize().x;
}
container.setLocalTranslation(pos.x * horizontalStep - xAdjust, pos.y * verticalStep, -1);
final float horizontalMid = ((float) app.getCamera().getWidth() / 2) - (container.getPreferredSize().x / 2);
final float verticalMid = ((float) app.getCamera().getHeight() / 2) - container.getPreferredSize().y / 2;
if (0 == pos.x) {
container.setLocalTranslation(horizontalMid, container.getLocalTranslation().y, -1);
}
if (0 == pos.y) {
container.setLocalTranslation(container.getLocalTranslation().x, verticalMid, -1);
}
}
/**
* Retrieves the text currently entered in the input field.
*
* @return the current text in the input field
*/
public String getString() {
return field.getText();
}
/**
* Sets the text of the input field to the specified string.
*
* @param string the text to set in the input field
*/
public void setString(String string) {
field.setText(string);
}
/**
* Resets the input field by clearing its text.
*/
public void reset() {
field.setText("");
}
}

View File

@@ -0,0 +1,132 @@
package pp.mdga.client.button;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector2f;
import com.jme3.scene.Node;
import com.simsilica.lemur.component.QuadBackgroundComponent;
import pp.mdga.client.MdgaApp;
/**
* A specialized button that can function as a label or a clickable button.
* It inherits from {@link ClickButton} and allows for flexible usage with or without button-like behavior.
*/
public class LabelButton extends ClickButton {
/**
* The color of the text displayed on the label or button.
*/
private ColorRGBA text = TEXT_NORMAL;
/**
* The color of the button's background.
*/
private ColorRGBA button = BUTTON_NORMAL;
/**
* Flag indicating whether this component functions as a button.
*/
private boolean isButton;
/**
* Constructs a LabelButton with specified properties.
*
* @param app the application instance for accessing resources
* @param node the node in the scene graph to which the button belongs
* @param label the text displayed on the label or button
* @param size the size of the label or button
* @param pos the position of the label or button in relative units
* @param isButton whether this component acts as a button or a simple label
*/
public LabelButton(MdgaApp app, Node node, String label, Vector2f size, Vector2f pos, boolean isButton) {
super(app, node, () -> {
}, label, size, pos);
this.isButton = isButton;
// Use the same image for hover and normal states
pictureHover = pictureNormal;
}
/**
* Displays the label or button, attaching it to the scene graph.
* If the component is a button, it also attaches the background image.
*/
@Override
public void show() {
if (isButton) {
node.attachChild(pictureNormal);
}
release();
calculateRelative();
setRelative();
setImageRelative(pictureNormal);
instance.setFontSize(fontSize / 2);
node.attachChild(instance);
}
/**
* Hides the label or button, detaching it from the scene graph.
*/
@Override
public void hide() {
node.detachChild(instance);
if (node.hasChild(pictureNormal)) {
node.detachChild(pictureNormal);
}
if (node.hasChild(pictureHover)) {
node.detachChild(pictureHover);
}
}
/**
* Handles hover behavior, updating the colors of the text and background.
*/
@Override
public void onHover() {
instance.setColor(text);
instance.setHighlightColor(text);
QuadBackgroundComponent background = new QuadBackgroundComponent(button);
instance.setBackground(background);
}
/**
* Handles unhover behavior, restoring the colors of the text and background.
*/
@Override
public void onUnHover() {
instance.setColor(text);
instance.setHighlightColor(text);
QuadBackgroundComponent background = new QuadBackgroundComponent(button);
instance.setBackground(background);
}
/**
* Sets the text displayed on the label or button.
*
* @param text the text to display
*/
public void setText(String text) {
instance.setText(text);
}
/**
* Sets the colors of the text and background, and refreshes the label or button.
*
* @param text the color of the text
* @param button the color of the button's background
*/
public void setColor(ColorRGBA text, ColorRGBA button) {
this.text = text;
this.button = button;
hide();
show();
}
}

View File

@@ -0,0 +1,329 @@
package pp.mdga.client.button;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.simsilica.lemur.component.QuadBackgroundComponent;
import pp.mdga.client.Asset;
import pp.mdga.client.MdgaApp;
import pp.mdga.game.Color;
/**
* Represents a button in a multiplayer lobby screen. The button supports multiple states
* (not taken, self, other) and displays a 3D model alongside its label. It can also indicate readiness
* and interactively respond to hover and click events.
*/
public class LobbyButton extends ClickButton {
/**
* Enum representing the possible ownership states of the lobby button.
*/
public enum Taken {
NOT, // The button is not taken
SELF, // The button is taken by the user
OTHER // The button is taken by another user
}
/**
* Color for a lobby button that is taken by another user.
*/
static final ColorRGBA LOBBY_TAKEN = ColorRGBA.fromRGBA255(193, 58, 59, 100);
/**
* Color for a lobby button that is ready but not hovered.
*/
static final ColorRGBA LOBBY_READY = ColorRGBA.fromRGBA255(55, 172, 190, 100);
/**
* Color for a lobby button that is ready and hovered.
*/
static final ColorRGBA LOBBY_READY_HOVER = ColorRGBA.fromRGBA255(17, 211, 218, 100);
/**
* Color for a lobby button owned by the user in normal state.
*/
static final ColorRGBA LOBBY_SELF_NORMAL = ColorRGBA.fromRGBA255(0, 151, 19, 100);
/**
* Color for a lobby button owned by the user when hovered.
*/
static final ColorRGBA LOBBY_SELF_HOVER = ColorRGBA.fromRGBA255(0, 230, 19, 100);
/**
* Fixed width for the lobby button.
*/
static final float WIDTH = 4.0f;
/**
* Node to which the 3D model associated with this button is attached.
*/
private final Node node3d;
/**
* Indicates whether the 3D model should rotate.
*/
private boolean rotate = false;
/**
* The 3D model displayed alongside the button.
*/
private Spatial model;
/**
* The rotation angle of the 3D model.
*/
private float rot = 180;
/**
* The current ownership state of the lobby button.
*/
private Taken taken = Taken.NOT;
/**
* Label displayed on the lobby button.
*/
private LabelButton label;
/**
* Indicates whether the button represents a ready state.
*/
private boolean isReady = false;
/**
* Constructs a LobbyButton with specified properties, including a 3D model and label.
*
* @param app the application instance for accessing resources
* @param node the node in the scene graph to which the button belongs
* @param node3d the node for 3D scene components associated with this button
* @param action the action to execute when the button is clicked
* @param tsk the type or category of the button (e.g., CYBER, AIRFORCE)
*/
public LobbyButton(MdgaApp app, Node node, Node node3d, Runnable action, Color tsk) {
super(app, node, action, "", new Vector2f(WIDTH, 7), new Vector2f(0, 0));
this.node3d = node3d;
label = new LabelButton(app, node, "- leer -", new Vector2f(WIDTH, 1), new Vector2f(0, 0), true);
final float mid = HORIZONTAL / 2;
final float uiSpacing = 0.4f;
final float figSpacing = 0.51f;
float uiX = mid;
float figX = 0;
Asset asset = null;
// Configure the button based on its type
switch (tsk) {
case CYBER:
adjust = true;
label.adjust = true;
uiX -= 3 * uiSpacing;
uiX -= WIDTH / 2;
asset = Asset.cir;
figX -= 3 * figSpacing;
instance.setText("CIR");
break;
case AIRFORCE:
adjust = true;
label.adjust = true;
uiX -= uiSpacing;
asset = Asset.lw;
figX -= figSpacing;
instance.setText("Luftwaffe");
break;
case ARMY:
uiX += uiSpacing;
asset = Asset.heer;
figX += figSpacing;
instance.setText("Heer");
break;
case NAVY:
uiX += 3 * uiSpacing;
uiX += WIDTH / 2;
asset = Asset.marine;
figX += 3 * figSpacing;
instance.setText("Marine");
break;
}
setPos(new Vector2f(uiX, 6));
label.setPos(new Vector2f(uiX, 7));
createModel(asset, new Vector3f(figX, -0.55f, 6));
}
/**
* Handles hover behavior, updating the button's color and enabling rotation.
*/
@Override
public void onHover() {
ColorRGBA buttonPressed = BUTTON_PRESSED.clone();
switch (taken) {
case NOT:
buttonPressed.a = 0.3f;
break;
case SELF:
buttonPressed = LOBBY_SELF_HOVER;
break;
case OTHER:
buttonPressed = LOBBY_TAKEN;
break;
}
if (isReady) {
buttonPressed = LOBBY_READY_HOVER;
}
QuadBackgroundComponent background = new QuadBackgroundComponent(buttonPressed);
instance.setBackground(background);
rotate = true;
}
/**
* Handles unhover behavior, restoring the button's color and disabling rotation.
*/
@Override
public void onUnHover() {
ColorRGBA buttonNormal = BUTTON_NORMAL.clone();
switch (taken) {
case NOT:
buttonNormal.a = 0.3f;
break;
case SELF:
buttonNormal = LOBBY_SELF_NORMAL;
break;
case OTHER:
buttonNormal = LOBBY_TAKEN;
break;
}
if (isReady) {
buttonNormal = LOBBY_READY;
}
QuadBackgroundComponent background = new QuadBackgroundComponent(buttonNormal);
instance.setBackground(background);
rotate = false;
}
/**
* Displays the lobby button and its associated components.
*/
@Override
public void show() {
release();
calculateRelative();
setRelative();
node.attachChild(instance);
node3d.attachChild(model);
label.show();
}
/**
* Hides the lobby button and its associated components.
*/
@Override
public void hide() {
node.detachChild(instance);
node3d.detachChild(model);
label.hide();
}
/**
* Updates the 3D model's rotation if the button is being hovered.
*
* @param tpf time per frame, used for smooth rotation calculations
*/
public void update(float tpf) {
if (rotate) {
rot += 140.0f * tpf;
rot %= 360;
} else {
rot = 180;
}
model.setLocalRotation(new Quaternion().fromAngles(
(float) Math.toRadians(90),
(float) Math.toRadians(rot),
(float) Math.toRadians(180)
));
}
/**
* Creates the 3D model associated with the lobby button and applies textures and positioning.
*
* @param asset the asset representing the 3D model
* @param pos the initial position of the 3D model
*/
private void createModel(Asset asset, Vector3f pos) {
String modelName = asset.getModelPath();
String texName = asset.getDiffPath();
model = app.getAssetManager().loadModel(modelName);
model.scale(asset.getSize() / 2);
model.rotate(
(float) Math.toRadians(90),
(float) Math.toRadians(rot),
(float) Math.toRadians(180)
);
model.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
model.setLocalTranslation(pos);
Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md");
mat.setTexture("DiffuseMap", app.getAssetManager().loadTexture(texName));
model.setMaterial(mat);
}
/**
* Gets the current ownership state of the lobby button.
*
* @return the current state of the button
*/
public Taken getTaken() {
return taken;
}
/**
* Sets the ownership state of the lobby button and updates its label accordingly.
*
* @param taken the new ownership state
* @param name the name to display on the button
*/
public void setTaken(Taken taken, String name) {
this.taken = taken;
if (taken == Taken.NOT) {
label.setText("- leer -");
isReady = false;
} else {
label.setText(name);
}
onUnHover();
}
/**
* Sets the ready state of the lobby button and updates its appearance.
*
* @param isReady whether the button represents a ready state
*/
public void setReady(boolean isReady) {
this.isReady = isReady;
onUnHover();
}
}

View File

@@ -0,0 +1,43 @@
package pp.mdga.client.button;
import com.jme3.math.Vector2f;
import com.jme3.scene.Node;
import pp.mdga.client.MdgaApp;
/**
* Represents a button used in menu screens for navigation or executing actions.
* Inherits from {@link ClickButton} and provides customizable text and actions.
*/
public class MenuButton extends ClickButton {
/**
* Constructs a MenuButton with specified properties.
*
* @param app the application instance for accessing resources
* @param node the node in the scene graph to which the button belongs
* @param action the action to execute when the button is clicked
* @param label the text label displayed on the button
*/
public MenuButton(MdgaApp app, Node node, Runnable action, String label) {
super(app, node, action, label, new Vector2f(5.5f, 2), new Vector2f(0, 0));
}
/**
* Called when the button is hovered over. Can be overridden to define hover-specific behavior.
* Currently, no additional behavior is implemented.
*/
@Override
public void onHover() {
// Placeholder for hover behavior
}
/**
* Called when the pointer stops hovering over the button. Can be overridden to define unhover-specific behavior.
* Currently, no additional behavior is implemented.
*/
@Override
public void onUnHover() {
// Placeholder for unhover behavior
}
}

View File

@@ -0,0 +1,50 @@
package pp.mdga.client.button;
import com.jme3.math.Vector2f;
import com.jme3.scene.Node;
import com.simsilica.lemur.component.IconComponent;
import pp.mdga.client.MdgaApp;
/**
* Represents a button in the settings menu, designed to display an icon and handle hover effects.
* Inherits from {@link ClickButton} and customizes its behavior for settings functionality.
*/
public class SettingsButton extends ClickButton {
/**
* The icon displayed on the button, which changes based on hover state.
*/
private IconComponent icon;
/**
* Constructs a SettingsButton with a predefined size and position.
*
* @param app the application instance for accessing resources
* @param node the node in the scene graph to which the button belongs
* @param action the action to execute when the button is clicked
*/
public SettingsButton(MdgaApp app, Node node, Runnable action) {
super(app, node, action, "", new Vector2f(2, 2), new Vector2f(HORIZONTAL - 0.5f, VERTICAL - 0.5f));
// Enable adjustment for positioning
adjust = true;
pictureNormal.setImage(app.getAssetManager(), "Images/Settings_Button_normal.png", true);
pictureHover.setImage(app.getAssetManager(), "Images/Settings_Button_hover.png", true);
}
/**
* Handles hover behavior by changing the icon to the hover state.
*/
@Override
public void onHover() {
}
/**
* Handles unhover behavior by restoring the icon to the normal state.
*/
@Override
public void onUnHover() {
}
}

View File

@@ -0,0 +1,168 @@
package pp.mdga.client.button;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.simsilica.lemur.*;
import com.simsilica.lemur.component.QuadBackgroundComponent;
import pp.mdga.client.MdgaApp;
/**
* Represents a slider button component with a label, providing functionality for
* adjusting values in a graphical user interface. It includes increment, decrement,
* and thumb buttons, allowing for interactive adjustments.
*/
public class SliderButton extends AbstractButton {
/**
* The label displayed next to the slider.
*/
private Label label;
/**
* The slider component for adjusting values.
*/
private Slider slider;
/**
* A container to hold the label and slider for layout management.
*/
private Container container = new Container();
/**
* The size of the slider button in relative units.
*/
protected Vector2f size;
/**
* Constructs a SliderButton with the specified label.
*
* @param app the application instance for accessing resources
* @param node the node in the scene graph to which the slider button belongs
* @param label the text label displayed alongside the slider
*/
public SliderButton(MdgaApp app, Node node, String label) {
super(app, node);
this.label = new Label(label);
this.label.setColor(TEXT_NORMAL);
// Configure the slider
slider = new Slider("slider");
// Configure decrement button
slider.getDecrementButton().setText(" - ");
slider.getDecrementButton().setFont(font);
slider.getDecrementButton().setFocusColor(TEXT_NORMAL);
slider.getDecrementButton().setTextVAlignment(VAlignment.Bottom);
slider.getDecrementButton().setColor(TEXT_NORMAL);
slider.getDecrementButton().setHighlightColor(TEXT_NORMAL);
// Configure increment button
slider.getIncrementButton().setText(" + ");
slider.getIncrementButton().setFont(font);
slider.getIncrementButton().setFocusColor(TEXT_NORMAL);
slider.getIncrementButton().setTextVAlignment(VAlignment.Bottom);
slider.getIncrementButton().setColor(TEXT_NORMAL);
slider.getIncrementButton().setHighlightColor(TEXT_NORMAL);
// Configure thumb button
slider.getThumbButton().setText("X");
slider.getThumbButton().setFont(font);
slider.getThumbButton().setFocusColor(TEXT_NORMAL);
slider.getThumbButton().setColor(TEXT_NORMAL);
slider.getThumbButton().setHighlightColor(TEXT_NORMAL);
// Set slider background
QuadBackgroundComponent background = new QuadBackgroundComponent(BUTTON_NORMAL);
slider.setBackground(background);
// Set label background
QuadBackgroundComponent labelBackground = new QuadBackgroundComponent(BUTTON_NORMAL);
this.label.setBackground(labelBackground);
// Configure the label font
this.label.setFont(font);
this.label.setTextHAlignment(HAlignment.Center);
// Default position and size
pos = new Vector2f(0, 0);
size = new Vector2f(6f, 1);
// Add label and slider to container
container.addChild(this.label);
container.addChild(slider);
}
/**
* Displays the slider button by attaching its container to the scene graph.
*/
@Override
public void show() {
calculateRelative();
setRelative();
node.attachChild(container);
}
/**
* Hides the slider button by detaching its container from the scene graph.
*/
@Override
public void hide() {
node.detachChild(container);
}
/**
* Sets the relative size and position of the slider button based on screen resolution.
*/
protected void setRelative() {
this.label.setFontSize(fontSize);
// Set font sizes for slider components
slider.getDecrementButton().setFontSize(fontSize);
slider.getIncrementButton().setFontSize(fontSize);
slider.getThumbButton().setFontSize(fontSize);
// Set slider size
slider.setPreferredSize(new Vector3f(size.x * widthStep, size.y * heightStep, 0));
float xAdjust = 0.0f;
if (adjust) {
xAdjust = container.getPreferredSize().x;
}
// Set container position
container.setLocalTranslation(pos.x * horizontalStep - xAdjust, pos.y * verticalStep, -1);
final float horizontalMid = ((float) app.getCamera().getWidth() / 2) - (container.getPreferredSize().x / 2);
final float verticalMid = ((float) app.getCamera().getHeight() / 2) - container.getPreferredSize().y / 2;
if (0 == pos.x) {
container.setLocalTranslation(horizontalMid, container.getLocalTranslation().y, -1);
}
if (0 == pos.y) {
container.setLocalTranslation(container.getLocalTranslation().x, verticalMid, -1);
}
}
/**
* Retrieves the current percentage value of the slider.
*
* @return the current percentage value as a float
*/
public float getPercent() {
return (float) slider.getModel().getPercent();
}
/**
* Sets the slider to the specified percentage value.
*
* @param percent the percentage value to set
*/
public void setPercent(float percent) {
slider.getModel().setPercent(percent);
}
}

Some files were not shown because too many files have changed in this diff Show More