334 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
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
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
283 changed files with 14404 additions and 11756 deletions

Binary file not shown.

View File

@@ -1,19 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="MdgaApp" type="Application" factoryName="Application" singleton="false" nameIsGenerated="true">
<option name="ALTERNATIVE_JRE_PATH" value="temurin-20" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="MAIN_CLASS_NAME" value="pp.mdga.client.MdgaApp" />
<module name="Projekte.mdga.client.main" />
<option name="VM_PARAMETERS" value="-Djava.util.logging.config.file=logging.properties -ea" />
<option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="pp.mdga.client.board.outline.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>

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
}

File diff suppressed because one or more lines are too long

View File

@@ -11,6 +11,7 @@ public enum Asset {
cir,
heer,
jet,
jet_noGear("Models/jet/jet_noGear.j3o", "Models/jet/jet_diff.png"),
lw,
marine,
node_home_blue("Models/node_home/node_home.j3o", "Models/node_home/node_home_blue_diff.png"),
@@ -40,7 +41,11 @@ public enum Asset {
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;
@@ -77,7 +82,8 @@ public enum Asset {
Asset(String modelPath) {
String folderFileName = "./" + ROOT + name() + "/" + name();
this.modelPath = modelPath;
this.diffPath = folderFileName + "_diff.png";;
this.diffPath = folderFileName + "_diff.png";
;
this.size = 1f;
}
@@ -100,7 +106,7 @@ public enum Asset {
* @param diffPath Path to the diffuse texture file.
* @param size Scaling factor for the asset.
*/
Asset(String modelPath, String diffPath, float size){
Asset(String modelPath, String diffPath, float size) {
this.modelPath = modelPath;
this.diffPath = diffPath;
this.size = size;

View File

@@ -12,19 +12,11 @@
import com.jme3.renderer.Camera;
import com.jme3.scene.Node;
import com.jme3.scene.control.AbstractControl;
import com.jme3.scene.control.Control;
import pp.mdga.client.board.NodeControl;
import pp.mdga.client.board.OutlineControl;
import pp.mdga.client.board.PieceControl;
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.BonusCard;
import pp.mdga.game.Color;
import pp.mdga.game.Piece;
import pp.mdga.notification.FinishNotification;
import pp.mdga.notification.MovePieceNotification;
import pp.mdga.notification.SelectableCardsNotification;
import java.util.List;
import java.util.UUID;
@@ -38,7 +30,7 @@ public class InputSynchronizer {
private float rotationAngle = 180f;
private int scrollValue = 0;
private CardControl hoverCard;
private PieceControl hoverPiece;
private OutlineOEControl hoverPiece;
private boolean clickAllowed = true;
@@ -60,14 +52,19 @@ public class InputSynchronizer {
setupInput();
}
/**
* Updates the rotation angle based on user input.
*
* @param tpf The time per frame.
*/
public void update(float tpf) {
if(isRotateLeft && isRotateRight) {
if (isRotateLeft && isRotateRight) {
return;
}
if(isRotateLeft) {
if (isRotateLeft) {
rotationAngle += 180 * tpf;
}
if(isRotateRight) {
if (isRotateRight) {
rotationAngle -= 180 * tpf;
}
}
@@ -94,7 +91,7 @@ private void setupInput() {
inputManager.addListener(actionListener, "Settings", "Forward", "RotateRightMouse", "Click", "Left", "Right", "Test");
inputManager.addListener(analogListener, "MouseLeft", "MouseRight", "MouseScrollUp", "MouseScrollDown");
}
UUID p = null;
/**
* Handles action-based input events such as key presses and mouse clicks.
*/
@@ -110,34 +107,22 @@ public void onAction(String name, boolean isPressed, float tpf) {
if (name.equals("RotateRightMouse")) {
rightMousePressed = isPressed;
}
if(name.equals("Click") && isPressed) {
if(!clickAllowed) {
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);
OutlineControl boardSelect = checkHover(app.getCamera(), app.getRootNode(), OutlineControl.class);
OutlineOEControl boardSelect = checkHover(app.getCamera(), app.getRootNode(), OutlineOEControl.class);
if(diceSelect != null) {
if (diceSelect != null) {
app.getModelSynchronize().rolledDice();
}
else if(cardLayerSelect != null) {
//cardSelect
if(cardLayerSelect.isSelectable()) gameView.getGuiHandler().selectCard(cardLayerSelect);
}
else if(boardSelect != null) {
//boardSelect
if(boardSelect instanceof PieceControl pieceControl){
if(pieceControl.isSelectable()) gameView.getBoardHandler().pieceSelect(pieceControl);
}
if(boardSelect instanceof NodeControl nodeControl){
//
}
}
else {
//both null
} else if (cardLayerSelect != null) {
if (cardLayerSelect.isSelectable()) gameView.getGuiHandler().selectCard(cardLayerSelect);
} else if (boardSelect != null) {
if (boardSelect.isSelectable()) gameView.getBoardHandler().pieceSelect(boardSelect);
}
}
@@ -149,34 +134,9 @@ else if(boardSelect != null) {
if (name.equals("Right")) {
isRotateRight = !isRotateRight;
}
if(name.equals("Test2") &&isPressed){
if(app.getView() instanceof GameView gameView){
if(p == null) {
p = UUID.randomUUID();
gameView.getBoardHandler().addPlayer(Color.AIRFORCE,List.of(p,UUID.randomUUID(),UUID.randomUUID(),UUID.randomUUID()));
gameView.getBoardHandler().movePieceStartAnim(p,0);
//gameView.getBoardHandler().movePieceAnim(p,0, 8);
} else {
gameView.getBoardHandler().throwMissileAnim(p);
//gameView.getBoardHandler().movePieceStartAnim(p,0);
}
// gameView.getGuiHandler().rollRankingResult(Color.AIRFORCE, 1);
// gameView.getGuiHandler().rollRankingResult(Color.ARMY, 2);
// gameView.getGuiHandler().rollRankingResult(Color.NAVY, 3);
// gameView.getGuiHandler().rollRankingResult(Color.CYBER, 4);
// gameView.getGuiHandler().showDice();
// UUID p1 = UUID.randomUUID();
// gameView.getBoardHandler().addPlayer(Color.AIRFORCE,List.of(p1,UUID.randomUUID(),UUID.randomUUID(),UUID.randomUUID()));
// gameView.getBoardHandler().movePieceStartAnim(p1,0);
//gameView.getGuiHandler().drawCard(Color.ARMY);
//gameView.getGuiHandler().addCardOwn(BonusCard.SHIELD);
//gameView.getGuiHandler().playCardOwn(BonusCard.SHIELD);
if (name.equals("Test") && isPressed) {
if (app.getView() instanceof GameView gameView) {
//Test Code
}
}
}
@@ -190,17 +150,13 @@ else if(boardSelect != null) {
public void onAnalog(String name, float value, float tpf) {
if (name.equals("MouseLeft") && rightMousePressed) {
rotationAngle -= value * 360f;
}
else if (name.equals("MouseRight") && rightMousePressed) {
} else if (name.equals("MouseRight") && rightMousePressed) {
rotationAngle += value * 360f;
}
else if (name.equals("MouseScrollUp")) {
} else if (name.equals("MouseScrollUp")) {
scrollValue = Math.max(1, scrollValue - 5);
}
else if (name.equals("MouseScrollDown")) {
} else if (name.equals("MouseScrollDown")) {
scrollValue = Math.min(100, scrollValue + 5);
}
else if (name.equals("MouseLeft") || name.equals("MouseRight") || name.equals("MouseVertical")){
} else if (name.equals("MouseLeft") || name.equals("MouseRight") || name.equals("MouseVertical")) {
hoverPiece();
hoverCard();
}
@@ -211,12 +167,13 @@ else if (name.equals("MouseLeft") || name.equals("MouseRight") || name.equals("M
* 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;
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);
for (CollisionResult collisionResult : results) {
if (collisionResult.getGeometry().getControl(controlType) != null)
return collisionResult.getGeometry().getControl(controlType);
}
return null;
}
@@ -225,16 +182,16 @@ private <T extends AbstractControl> T checkHover(Camera cam, Node root, Class<T>
* 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;
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 ){
for (CollisionResult res : results) {
T control = res.getGeometry().getControl(controlType);
if(control != null) return control;
if (control != null) return control;
}
}
return null;
@@ -246,15 +203,15 @@ private <T extends AbstractControl> T checkHoverOrtho(Camera cam, Node root, Cla
*/
private void hoverPiece() {
if (app.getView() instanceof GameView gameView) {
PieceControl control = checkPiece();
OutlineOEControl control = checkPiece();
if (control != null) {
if (control != hoverPiece) {
pieceOff();
pieceOff(gameView);
hoverPiece = control;
hoverPiece.hover();
if(hoverPiece.isHoverable()) gameView.getBoardHandler().hoverOn(hoverPiece);
}
} else {
pieceOff();
pieceOff(gameView);
}
}
}
@@ -270,7 +227,7 @@ private void hoverCard() {
if (control != hoverCard) {
cardOff();
hoverCard = control;
hoverCard.hover();
hoverCard.hoverOn();
}
} else {
cardOff();
@@ -283,8 +240,8 @@ private void hoverCard() {
*
* @return The PieceControl of the hovered piece, or null if no piece is hovered.
*/
private PieceControl checkPiece() {
return checkHover(app.getCamera(), app.getRootNode(), PieceControl.class);
private OutlineOEControl checkPiece() {
return checkHover(app.getCamera(), app.getRootNode(), OutlineOEControl.class);
}
/**
@@ -295,17 +252,19 @@ private PieceControl checkPiece() {
*/
private CardControl checkCard(GameView gameView) {
return checkHoverOrtho(
gameView.getGuiHandler().getCardLayerCamera(),
gameView.getGuiHandler().getCardLayerRootNode(),
CardControl.class
gameView.getGuiHandler().getCardLayerCamera(),
gameView.getGuiHandler().getCardLayerRootNode(),
CardControl.class
);
}
/**
* Disables the hover effect on the currently hovered piece, if any.
*/
private void pieceOff() {
if (hoverPiece != null) hoverPiece.hoverOff();
private void pieceOff(GameView gameView) {
if (hoverPiece != null) {
if(hoverPiece.isHoverable()) gameView.getBoardHandler().hoverOff(hoverPiece);
}
hoverPiece = null;
}
@@ -339,7 +298,7 @@ public float getRotation() {
return (rotationAngle / 2) % 360;
}
public void setRotation(float rotationAngle){
public void setRotation(float rotationAngle) {
this.rotationAngle = rotationAngle;
}

View File

@@ -1,10 +1,10 @@
package pp.mdga.client;
import com.jme3.app.SimpleApplication;
import com.simsilica.lemur.GuiGlobals;
import com.sun.tools.javac.Main;
import pp.mdga.client.acoustic.AcousticHandler;
import com.jme3.system.AppSettings;
import com.simsilica.lemur.GuiGlobals;
import pp.mdga.client.acoustic.AcousticHandler;
import pp.mdga.client.animation.TimerManager;
import pp.mdga.client.dialog.JoinDialog;
import pp.mdga.client.view.*;
@@ -26,46 +26,79 @@ public class MdgaApp extends SimpleApplication {
private static Preferences prefs = Preferences.userNodeForPackage(JoinDialog.class);
/** Handles acoustic effects and state-based sounds. */
/**
* Handles acoustic effects and state-based sounds.
*/
private AcousticHandler acousticHandler;
/** Synchronizes notifications throughout the application. */
/**
* Synchronizes notifications throughout the application.
*/
private NotificationSynchronizer notificationSynchronizer;
/** Manages input events and synchronization. */
/**
* Manages input events and synchronization.
*/
private InputSynchronizer inputSynchronizer;
/** Synchronizes game models. */
/**
* Synchronizes game models.
*/
private ModelSynchronizer modelSynchronizer;
/** The currently active view in the application. */
/**
* The currently active view in the application.
*/
private MdgaView view = null;
/** The current state of the application. */
/**
* The current state of the application.
*/
private MdgaState state = null;
/** Scale for rendering images. */
/**
* Scale for rendering images.
*/
private final float imageScale = prefs.getInt("scale", 1);
/** The main menu view. */
/**
* The main menu view.
*/
private MainView mainView;
/** The lobby view. */
/**
* The lobby view.
*/
private LobbyView lobbyView;
/** The game view. */
/**
* The game view.
*/
private GameView gameView;
/** The ceremony view. */
/**
* The ceremony view.
*/
private CeremonyView ceremonyView;
/** The client game logic. */
private final ClientGameLogic clientGameLogic;
/**
* 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);
@@ -81,7 +114,7 @@ public static void main(String[] args) {
AppSettings settings = new AppSettings(true);
settings.setSamples(128);
if(prefs.getBoolean("fullscreen", false)) {
if (prefs.getBoolean("fullscreen", false)) {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
int screenWidth = (int) screenSize.getWidth();
int screenHeight = (int) screenSize.getHeight();
@@ -104,6 +137,16 @@ public static void main(String[] args) {
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();
}
@@ -142,6 +185,7 @@ public void simpleUpdate(float tpf) {
acousticHandler.update();
notificationSynchronizer.update();
inputSynchronizer.update(tpf);
timerManager.update(tpf);
}
/**
@@ -160,6 +204,7 @@ public void enter(MdgaState state) {
switch (state) {
case MAIN:
view = mainView;
clientGameLogic = new ClientGameLogic(networkConnection);
break;
case LOBBY:
view = lobbyView;
@@ -247,14 +292,22 @@ public NotificationSynchronizer getNotificationSynchronizer() {
* 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();
@@ -263,12 +316,25 @@ public ExecutorService getExecutor() {
return this.executor;
}
public ServerConnection getNetworkSupport(){
/**
* 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) {
if (isFullscreen) {
int baseWidth = 1280;
int baseHeight = 720;
float baseAspectRatio = (float) baseWidth / baseHeight;
@@ -292,6 +358,9 @@ public void updateResolution(int width, int height, float imageFactor, boolean i
}
}
/**
* Restarts the application.
*/
public static void restartApp() {
try {
String javaBin = System.getProperty("java.home") + "/bin/java";
@@ -299,7 +368,7 @@ public static void restartApp() {
String className = System.getProperty("sun.java.command");
ProcessBuilder builder = new ProcessBuilder(
javaBin, "-cp", classPath, className
javaBin, "-cp", classPath, className
);
builder.start();
@@ -310,17 +379,54 @@ public static void restartApp() {
}
}
/**
* Cleans up the application after a game.
*/
public void afterGameCleanup() {
MainView main = (MainView) mainView;
main.getJoinDialog().disconnect();
main.getHostDialog().shutdownServer();
if (clientGameLogic.isHost()) {
main.getHostDialog().shutdownServer();
}
ceremonyView.afterGameCleanup();
}
public GameView getGameView(){
/**
* 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,93 +1,124 @@
package pp.mdga.client;
import pp.mdga.client.acoustic.MdgaSound;
import pp.mdga.client.server.MdgaServer;
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.message.client.LobbyReadyMessage;
import pp.mdga.notification.AcquireCardNotification;
import pp.mdga.notification.DrawCardNotification;
import pp.mdga.notification.TskSelectNotification;
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 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() {
app.getGameLogic().selectAnimationEnd();
if (app.getNotificationSynchronizer().waitForAnimation) {
app.getNotificationSynchronizer().waitForAnimation = false;
} else {
app.getGameLogic().selectAnimationEnd();
}
}
public void select(UUID a, UUID b){
if(swap) selectSwap(a,b);
/**
* 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) {
// TODO call from somewhere
LOGGER.log(Level.INFO, "selectPiece");
this.a = a;
this.b = b;
GameView gameView = (GameView) app.getView();
if(a != null && b != null) {
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) {
// TODO call from somewhere
LOGGER.log(Level.INFO, "selectPiece");
this.a = piece;
GameView gameView = (GameView) app.getView();
if(piece != null) {
if (piece != null) {
gameView.needConfirm();
} else {
gameView.noConfirm();
}
}
/**
* Selects a bonus card.
*
* @param card the BonusCard instance
*/
public void selectCard(BonusCard card) {
// TODO call from somewhere
LOGGER.log(Level.INFO, "selectCard");
this.card = card;
GameView gameView = (GameView) app.getView();
if(card == null) {
if (card != null) {
gameView.needConfirm();
} else {
gameView.needNoPower();
gameView.showNoPower();
}
}
/**
* Confirms the current selection.
*/
public void confirm() {
LOGGER.log(Level.INFO, "confirm");
GameView gameView = (GameView) app.getView();
if(a != null && b != null) {
gameView.getGuiHandler().hideText();
if (a != null && b != null) {
app.getGameLogic().selectPiece(a);
app.getGameLogic().selectPiece(b);
gameView.getBoardHandler().clearSelectable();
@@ -95,62 +126,118 @@ public void confirm() {
app.getGameLogic().selectPiece(a);
gameView.getBoardHandler().clearSelectable();
} else {
if(null == card) {
app.getGameLogic().selectCard(null);
} else {
app.getGameLogic().selectCard(card);
gameView.getGuiHandler().clearSelectableCards();
}
app.getGameLogic().selectCard(card);
gameView.getGuiHandler().clearSelectableCards();
}
a = null;
b = null;
card = null;
gameView.noConfirm();
gameView.noNoPower();
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) {
// TODO call from somewhere
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);
}
public void setSwap(boolean swap){
/**
* 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

@@ -6,23 +6,47 @@
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");
@@ -36,6 +60,9 @@ public void connect() {
}
/**
* Disconnects the client from the server.
*/
public void disconnect() {
if (this.client != null) {
this.client.close();
@@ -44,6 +71,13 @@ public void disconnect() {
}
}
/**
* 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");
@@ -55,6 +89,12 @@ public void initNetwork(String host, int port) throws IOException {
}
}
/**
* 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) {
@@ -63,10 +103,21 @@ public void messageReceived(Client client, Message message) {
}
/**
* 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) {
@@ -78,6 +129,11 @@ public void clientDisconnected(Client client, ClientStateListener.DisconnectInfo
}
}
/**
* 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});

View File

@@ -1,34 +1,72 @@
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;
}
/**
* 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() {
Notification n = app.getGameLogic().getNotification();
while (n != null) {
if(n instanceof InfoNotification infoNotification) {
while (timer.getTimeInSeconds() >= delay) {
if (waitForAnimation) {
return;
}
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) {
if (n != null) {
switch (app.getState()) {
case MAIN:
handleMain(n);
@@ -45,22 +83,34 @@ public void update() {
case NONE:
throw new RuntimeException("no notification expected: " + n.getClass().getName());
}
}
n = app.getGameLogic().getNotification();
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 in main: "+ notification.getClass().getName());
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();
@@ -71,7 +121,7 @@ private void handleLobby(Notification notification) {
app.enter(MdgaState.MAIN);
} else if (notification instanceof TskUnselectNotification n) {
lobbyView.setTaken(n.getColor(), false, false, null);
} else if(notification instanceof LobbyReadyNotification lobbyReadyNotification) {
} else if (notification instanceof LobbyReadyNotification lobbyReadyNotification) {
lobbyView.setReady(lobbyReadyNotification.getColor(), lobbyReadyNotification.isReady());
} else if (notification instanceof GameNotification n) {
app.getGameView().setOwnColor(n.getOwnColor());
@@ -81,30 +131,45 @@ private void handleLobby(Notification notification) {
}
}
/**
* 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 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());
boardHandler.showDice(n.getColor());
if (n.getColor() != ownColor) boardHandler.showDice(n.getColor());
app.getAcousticHandler().playSound(MdgaSound.UI90);
delay = STANDARD_DELAY;
} else if (notification instanceof CeremonyNotification ceremonyNotification) {
app.enter(MdgaState.CEREMONY);
CeremonyView ceremonyView = (CeremonyView) app.getView();
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) {
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.");
}
@@ -118,53 +183,75 @@ private void handleGame(Notification notification) {
int v5 = ceremonyNotification.getNodesMoved().get(i);
int v6 = ceremonyNotification.getBonusNodes().get(i);
ceremonyView.addCeremonyParticipant(color, i, name);
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) {
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.movePieceHomeAnim(home.getPieceId(), home.getHomeIndex());
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()) {
if (n.isMoveStart()) {
//StartMove
boardHandler.movePieceStartAnim(n.getPiece(), n.getMoveIndex());
}
else {
boardHandler.movePieceStart(n.getPiece(), n.getMoveIndex());
waitForAnimation = true;
} else {
//InfieldMove
boardHandler.movePieceAnim(n.getPiece(), n.getStartIndex(), n.getMoveIndex());
boardHandler.movePiece(n.getPiece(), n.getStartIndex(), n.getMoveIndex());
waitForAnimation = true;
}
guiHandler.hideText();
} else if (notification instanceof ThrowPieceNotification n) {
boardHandler.throwBombAnim(n.getPieceId());
} else if (notification instanceof NoShieldNotification n) {
boardHandler.unshieldPiece(n.getPieceId());
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.getColor() == gameView.getOwnColor()) guiHandler.playCardOwn(n.getCard());
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());
boardHandler.addPlayer(n.getColor(), n.getPiecesList());
guiHandler.addPlayer(n.getColor(), n.getName());
} else if (notification instanceof ResumeNotification) {
gameView.leaveInterrupt();
} else if (notification instanceof RollDiceNotification n) {
gameView.getGuiHandler().hideText();
if(n.getColor() == gameView.getOwnColor()){
if (n.getColor() == ownColor) {
guiHandler.rollDice(n.getEyes(), n.isTurbo() ? n.getMultiplier() : -1);
}
else {
boardHandler.hideDice();
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.needNoPower();
gameView.showNoPower();
} else if (notification instanceof ShieldActiveNotification n) {
boardHandler.shieldPiece(n.getPieceId());
} else if (notification instanceof ShieldSuppressedNotification n) {
@@ -173,28 +260,33 @@ private void handleGame(Notification notification) {
app.afterGameCleanup();
app.enter(MdgaState.MAIN);
} else if (notification instanceof SwapPieceNotification n) {
// boardHandler.swapPieces(n.getFirstPiece(), n.getSecondPiece());
boardHandler.swapPieces(n.getFirstPiece(), n.getSecondPiece());
guiHandler.swap();
} else if (notification instanceof WaitMoveNotification) {
//TODO ???
//nothing
} else if (notification instanceof SelectableMoveNotification n) {
boardHandler.outlineMove(n.getPieces(), n.getMoveIndices(), n.getHomeMoves());
boardHandler.setSelectableMove(n.getPieces(), n.getMoveIndices(), n.getHomeMoves());
modelSynchronizer.setSwap(false);
} else if (notification instanceof SelectableSwapNotification n) {
boardHandler.outlineSwap(n.getOwnPieces(), n.getEnemyPieces());
boardHandler.setSelectableSwap(n.getOwnPieces(), n.getEnemyPieces());
modelSynchronizer.setSwap(true);
} else if (notification instanceof SelectableShieldNotification n) {
boardHandler.outlineShield(n.getPieces());
} else if (notification instanceof SelectableShieldNotification n) {
boardHandler.setSelectableShield(n.getPieces());
modelSynchronizer.setSwap(false);
} else if (notification instanceof TurboActiveNotification){
guiHandler.turbo();
} else if (notification instanceof FinishNotification n){
} else if (notification instanceof TurboActiveNotification) {
//nothing
} else if (notification instanceof FinishNotification n) {
guiHandler.finish(n.getColorFinished());
} else {
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();

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,10 @@
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 {
@@ -18,12 +21,14 @@ 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 GameMusic birds;
private float mainVolume = 0.0f;
private float musicVolume = 1.0f;
private float soundVolume = 1.0f;
@@ -38,6 +43,8 @@ public AcousticHandler(MdgaApp 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);
}
/**
@@ -60,6 +67,8 @@ public void update() {
iterator.remove();
}
}
birds.update(Math.min(getSoundVolumeTotal(), getMusicVolumeTotal() > 0 ? 0 : 1));
}
/**
@@ -132,6 +141,25 @@ public void playSound(MdgaSound sound) {
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;
}
@@ -153,6 +181,10 @@ public void playState(MdgaState state) {
}
MusicAsset asset = null;
birds.pause();
float pause = 0.0f;
switch (state) {
case MAIN:
playGame = false;
@@ -163,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;
@@ -178,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);
}
/**
@@ -195,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.
@@ -260,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.
@@ -312,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.
@@ -371,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;
}
@@ -454,7 +488,7 @@ public void setSoundVolume(float soundVolume) {
*/
float getMusicVolumeTotal() {
return getMusicVolume() * getMainVolume();
return getMusicVolume() * getMainVolume() / 2;
}
/**

View File

@@ -38,4 +38,10 @@ public enum MdgaSound {
UI90,
MISSILE,
MATRIX,
TURRET_ROTATE,
TANK_SHOOT,
TANK_EXPLOSION,
SHIELD,
TURBO,
SWAP,
}

View File

@@ -7,15 +7,16 @@
* 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;

View File

@@ -37,7 +37,14 @@ enum SoundAsset {
LOSE("lose.ogg"),
MISSILE("missile.ogg"),
MATRIX("matrix.wav"),
CONNECTED("connected.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;

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

@@ -10,6 +10,10 @@
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;
@@ -20,35 +24,43 @@ public class Explosion {
private boolean triggered = false;
private final Material mat;
private final Material fireMat;
private final Material smokeMat;
/**
* Konstruktor für die Explosion.
* Constructor for the {@code Explosion} class.
*
* @param app Die Hauptanwendung.
* @param rootNode Der Root-Knoten, an den die Explosion angefügt wird.
* @param location Der Ort der Explosion in World-Koordinaten.
* @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.mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md");
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"));
}
/**
* Initialisiert den Partikel-Emitter für die Explosion.
* 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(mat);
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().setInitialVelocity(new Vector3f(0.2f, 0.2f, 4f));
fire.getParticleInfluencer().setVelocityVariation(0.4f);
fire.setStartSize(0.1f);
fire.setEndSize(0.8f);
fire.setStartSize(0.7f);
fire.setEndSize(1.8f);
fire.setGravity(0, 0, -0.1f);
fire.setLowLife(0.5f);
fire.setHighLife(2.2f);
@@ -56,16 +68,17 @@ private void initializeEmitter() {
fire.setLocalTranslation(location);
smoke = new ParticleEmitter("Effect2", Type.Triangle,40);
smoke.setMaterial(mat);
smoke.setImagesX(2);
smoke.setImagesY(2);
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.7f));
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.2f);
smoke.setEndSize(0.5f);
smoke.setStartSize(0.8f);
smoke.setEndSize(1.5f);
smoke.setGravity(0, 0, -0.3f);
smoke.setLowLife(1.2f);
smoke.setHighLife(5.5f);
@@ -77,7 +90,8 @@ private void initializeEmitter() {
}
/**
* Löst die Explosion aus.
* 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) {
@@ -100,7 +114,8 @@ protected void controlUpdate(float tpf) {
}
@Override
protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) {}
protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) {
}
});
rootNode.attachChild(smoke);
@@ -118,7 +133,8 @@ protected void controlUpdate(float tpf) {
}
@Override
protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) {}
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

@@ -12,35 +12,35 @@
import pp.mdga.client.Asset;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.acoustic.MdgaSound;
import pp.mdga.client.board.BoardHandler;
import pp.mdga.client.view.GameView;
import java.util.UUID;
/**
* 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; // Referenz auf die Hauptanwendung
private final Node rootNode; // Root-Knoten, an dem die Animation hängt
private Spatial jetModel; // Das Model des "jet"
private final Vector3f spawnPoint; // Spawnpunkt des Jets
private final Vector3f nodePoint; // Punkt des überflogenen Knotens
private final Vector3f despawnPoint; // Punkt, an dem der Jet despawnt
private final float curveHeight; // Maximale Höhe der Kurve
private final float animationDuration; // Dauer der Animation
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 final UUID id;
private Runnable actionAfter;
/**
* Konstruktor für die ThrowAnimation-Klasse.
* Constructor for the {@code JetAnimation} class.
*
* @param app Die Hauptanwendung
* @param rootNode Der Root-Knoten, an dem der Jet angefügt wird
* @param uuid Die UUID des pieces
* @param targetPoint Der Punkt, an dem der Jet spawnt
* @param curveHeight Die maximale Höhe der Flugkurve
* @param animationDuration Die Gesamtdauer der Animation in Sekunden
* @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, UUID uuid, Vector3f targetPoint, float curveHeight, float animationDuration) {
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));
@@ -55,13 +55,12 @@ public JetAnimation(MdgaApp app, Node rootNode, UUID uuid, Vector3f targetPoint,
this.curveHeight = curveHeight;
this.animationDuration = animationDuration;
id = uuid;
explosion = new Explosion(app, rootNode, targetPoint);
this.actionAfter = actionAfter;
}
/**
* Startet die Animation.
* 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);
@@ -70,23 +69,25 @@ public void start() {
}
/**
* Spawnt den Jet an der spezifizierten Position.
* Spawns the jet model at the designated spawn point, applying material, scaling, and rotation.
*/
private void spawnJet() {
jetModel = app.getAssetManager().loadModel(Asset.jet.getModelPath());
jetModel = app.getAssetManager().loadModel(Asset.jet_noGear.getModelPath());
jetModel.setLocalTranslation(spawnPoint);
jetModel.scale(Asset.jet.getSize());
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.getDiffPath()));
mat.setTexture("DiffuseMap", app.getAssetManager().loadTexture(Asset.jet_noGear.getDiffPath()));
jetModel.setMaterial(mat);
rootNode.attachChild(jetModel);
}
/**
* Animiert den Jet entlang einer Kurve und lässt ihn anschließend verschwinden.
* 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);
@@ -102,7 +103,7 @@ protected void controlUpdate(float tpf) {
elapsedTime += tpf;
float progress = elapsedTime / animationDuration;
if(elapsedTime > 4.2f) {
if (elapsedTime > 4.2f) {
explosion.trigger();
}
@@ -118,26 +119,35 @@ protected void controlUpdate(float tpf) {
}
if (elapsedTime > 6.0f) {
GameView gameView = (GameView) app.getView();
BoardHandler boardHandler = gameView.getBoardHandler();
boardHandler.throwPieceAnim(id);
endAnim();
}
}
@Override
protected void controlRender(RenderManager rm, ViewPort vp) {
// Wird hier nicht benötigt
}
});
}
private void endAnim() {
actionAfter.run();
}
/**
* Repräsentiert eine 3D-Bezier-Kurve mit vier Kontrollpunkten.
* 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;
@@ -145,6 +155,12 @@ public BezierCurve3f(Vector3f p0, Vector3f p1, Vector3f p2, Vector3f p3) {
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;
@@ -159,6 +175,12 @@ public Vector3f interpolate(float t) {
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;

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,6 +1,9 @@
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;
@@ -14,123 +17,165 @@
import pp.mdga.client.acoustic.MdgaSound;
import pp.mdga.client.board.BoardHandler;
import java.util.UUID;
/**
* 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; // Root-Knoten, an den die Animation gehängt wird
private final MdgaApp app; // Referenz auf die Hauptanwendung
private final Vector3f start; // Startpunkt der Rakete
private final Vector3f target; // Zielpunkt der Rakete
private final float flightTime; // Gesamtdauer des Flugs
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; // 3D-Modell der Rakete
private Spatial missileModel;
private Runnable actionAfter;
private ParticleEmitter smoke;
private UUID id;
private Node missileNode = new Node();
private final Material mat;
/**
* Konstruktor für die MissileAnimation.
* Constructor for the {@code MissileAnimation} class.
*
* @param app Die Hauptanwendung.
* @param rootNode Der Root-Knoten, an den die Animation gehängt wird.
* @param target Der Zielpunkt der Rakete.
* @param flightTime Die Zeit, die die Rakete für den gesamten Flug benötigt.
* @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, UUID uuid, Vector3f target, float flightTime) {
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);
id = uuid;
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);
}
/**
* Startet die Raketenanimation.
* 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();
}
/**
* Lädt das Raketenmodell und setzt es auf den Startpunkt.
* 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()); // Lade das Missile-Modell
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);
missileModel.setLocalTranslation(start); // Setze Startposition
rootNode.attachChild(missileModel); // Füge das Modell zur Szene hinzu
missileNode.setLocalTranslation(start);
missileNode.attachChild(missileModel);
rootNode.attachChild(missileNode);
}
/**
* Animiert die Rakete entlang einer Parabel.
* 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() {
missileModel.addControl(new AbstractControl() {
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();
// Flug abgeschlossen
rootNode.detachChild(missileModel); // Entferne Rakete nach dem Ziel
this.spatial.removeControl(this); // Entferne die Steuerung
return;
missileNode.detachChild(missileModel);
}
// Berechne die aktuelle Position entlang der Parabel
Vector3f currentPosition = computeParabolicPath(start, target, progress);
missileModel.setLocalTranslation(currentPosition);
missileNode.setLocalTranslation(currentPosition);
// Passe die Ausrichtung an (Nase der Rakete zeigt in Flugrichtung)
Vector3f direction = computeParabolicPath(start, target, progress + 0.01f)
.subtract(currentPosition)
.normalizeLocal();
missileModel.lookAt(currentPosition.add(direction), Vector3f.UNIT_Y); // Z ist oben, Y ist "Up"
.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) {
// Keine Render-Logik benötigt
}
});
}
private void endAnim() {
actionAfter.run();
}
/**
* Berechnet eine Parabelbewegung von `start` zu `target`.
* Computes a position along a parabolic path at a given progress value {@code t}.
*
* @param start Der Startpunkt der Rakete.
* @param target Der Zielpunkt der Rakete.
* @param t Der Fortschritt des Flugs (0 bis 1).
* @return Die Position der Rakete entlang der Parabel.
* @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); // Berechne die Mitte zwischen Start und Ziel
midPoint.addLocal(0, 0, 20); // Erhöhe den Scheitelpunkt der Parabel entlang der Z-Achse
Vector3f midPoint = start.add(target).multLocal(0.5f);
midPoint.addLocal(0, 0, 20);
// Quadratische Interpolation (Parabel)
Vector3f startToMid = FastMath.interpolateLinear(t, start, midPoint);
Vector3f midToTarget = FastMath.interpolateLinear(t, midPoint, target);
return FastMath.interpolateLinear(t, startToMid, midToTarget);

View File

@@ -1,7 +1,9 @@
package pp.mdga.client.animation;
import com.jme3.math.Vector3f;
import pp.mdga.client.InitControl;
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
@@ -12,35 +14,42 @@
* an ease-in-out curve to create a smooth start and stop effect.
* </p>
*/
public class MoveControl extends InitControl {
public class MoveControl extends ActionControl {
private boolean moving;
private final Vector3f initPos;
private final Vector3f endPos;
private final Vector3f middlePos;
private final static float HEIGHT = 2;
private final static float MOVE_SPEED = 1f;
private float progress = 0;
private final Runnable actionAfter;
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 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){
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
(initPos.x + endPos.x) / 2,
(initPos.y + endPos.y) / 2,
height
);
this.actionAfter = actionAfter;
}
/**
@@ -50,7 +59,7 @@ public MoveControl(Vector3f initPos, Vector3f endPos, Runnable actionAfter){
@Override
protected void initSpatial() {
moving = true;
progress = 0;
timer = 0;
}
/**
@@ -62,48 +71,28 @@ protected void initSpatial() {
*/
@Override
protected void controlUpdate(float tpf) {
if(!moving) return;
progress += tpf * MOVE_SPEED;
if(progress > 1) progress = 1;
spatial.setLocalTranslation(quadInt(initPos,middlePos,endPos, easeInOut(progress)));
if(progress == 1) end();
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(){
private void end() {
moving = false;
actionAfter.run();
spatial.removeControl(this);
action();
}
/**
* 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.
*/
private 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.
*/
private float easeInOut(float x){
return x < 0.5 ? 4 * x * x * x : (float) (1 - Math.pow(-2 * x + 2, 3) / 2);
}
}

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

@@ -172,8 +172,8 @@ public void turbo() {
* Performs linear interpolation between two values.
*
* @param start The starting value.
* @param end The target value.
* @param t The interpolation parameter (0 <= t <= 1).
* @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) {

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

@@ -17,8 +17,8 @@ public class ZoomControl extends InitControl {
private float zoomFactor = 1f;
/**
* Constructs a new ZoomControl with the default zoom speed.
*/
* Constructs a new ZoomControl with the default zoom speed.
*/
public ZoomControl() {
}
@@ -78,8 +78,8 @@ private void end() {
* Performs linear interpolation between two values.
*
* @param start The starting value.
* @param end The target value.
* @param t The interpolation parameter (0 <= t <= 1).
* @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) {

View File

@@ -5,4 +5,5 @@
/**
* Record for holding Asset information
*/
record AssetOnMap(Asset asset, int x, int y, float rot) {}
record AssetOnMap(Asset asset, int x, int y, float rot) {
}

View File

@@ -1,6 +1,8 @@
package pp.mdga.client.board;
import com.jme3.material.Material;
import com.jme3.material.RenderState;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.post.FilterPostProcessor;
import com.jme3.renderer.queue.RenderQueue;
@@ -10,9 +12,7 @@
import pp.mdga.client.Asset;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.acoustic.MdgaSound;
import pp.mdga.client.animation.MissileAnimation;
import pp.mdga.client.animation.MoveControl;
import pp.mdga.client.animation.JetAnimation;
import pp.mdga.client.animation.*;
import pp.mdga.client.gui.DiceControl;
import pp.mdga.game.Color;
@@ -52,21 +52,26 @@ public class BoardHandler {
// Flags and lists for handling piece selection and movement
private List<PieceControl> selectableOwnPieces;
private List<PieceControl> selectableEnemyPieces;
private Map<PieceControl, NodeControl> selectedPieceNodeMap;
private List<NodeControl> outlineNodes;
private PieceControl selectedOwnPiece;
private PieceControl selectedEnemyPiece;
private DiceControl diceControl;
//Radar Position for Matrix animation
private Vector3f radarPos;
//TankTop for shellAnimation
private TankTopControl tankTop;
/**
* Creates a new BoardHandler.
*
* @param app The main application instance
* @param app The main application instance
* @param rootNode The root node where the board will be attached
* @param fpp The post-processor for effects like shadows or filters
* @param fpp The post-processor for effects like shadows or filters
* @throws RuntimeException if the app is null
*/
public BoardHandler(MdgaApp app, Node rootNode, FilterPostProcessor fpp) {
if(app == null) throw new RuntimeException("app is null");
if (app == null) throw new RuntimeException("app is null");
this.app = app;
this.fpp = fpp;
@@ -82,6 +87,7 @@ public void init() {
isInitialised = true;
selectableOwnPieces = new ArrayList<>();
selectableEnemyPieces = new ArrayList<>();
selectedPieceNodeMap = new HashMap<>();
outlineNodes = new ArrayList<>();
selectedOwnPiece = null;
selectedEnemyPiece = null;
@@ -92,7 +98,7 @@ public void init() {
/**
* Shuts down the board handler by detaching all board-related nodes and clearing selected pieces.
*/
public void shutdown(){
public void shutdown() {
clearSelectable();
isInitialised = false;
rootNode.detachChild(rootNodeBoard);
@@ -101,7 +107,7 @@ public void shutdown(){
/**
* Adds an asset to the map of player assets, ensuring that the player does not have too many assets.
*
* @param col The color of the player
* @param col The color of the player
* @param assetOnMap The asset to be added
* @throws RuntimeException if there are too many assets for the player
*/
@@ -122,7 +128,7 @@ private void initMap() {
waitingPiecesMap = new HashMap<>();
pieceColor = new HashMap<>();
diceControl = new DiceControl(app.getAssetManager());
diceControl.create(new Vector3f(0,0,0), 0.7f, true);
diceControl.create(new Vector3f(0, 0, 0), 0.7f, true);
waitingNodes = new HashMap<>();
waitingNodes.put(Color.AIRFORCE, new HashMap<>());
waitingNodes.put(Color.ARMY, new HashMap<>());
@@ -139,7 +145,7 @@ private void initMap() {
case cir -> addFigureToPlayerMap(assetToColor(Asset.cir), assetOnMap);
case marine -> addFigureToPlayerMap(assetToColor(Asset.marine), assetOnMap);
case node_normal, node_bonus, node_start ->
infield.add(displayAndControl(assetOnMap, new NodeControl(app, fpp)));
infield.add(displayAndControl(assetOnMap, new NodeControl(app, fpp)));
case node_home_black -> addHomeNode(homeNodesMap, Color.AIRFORCE, assetOnMap);
case node_home_blue -> addHomeNode(homeNodesMap, Color.NAVY, assetOnMap);
case node_home_green -> addHomeNode(homeNodesMap, Color.ARMY, assetOnMap);
@@ -148,12 +154,24 @@ private void initMap() {
case node_wait_blue -> addHomeNode(waitingNodesMap, Color.NAVY, assetOnMap);
case node_wait_green -> addHomeNode(waitingNodesMap, Color.ARMY, assetOnMap);
case node_wait_yellow -> addHomeNode(waitingNodesMap, Color.CYBER, assetOnMap);
case radar -> addRadar(assetOnMap);
case tankShoot -> addTankShoot(assetOnMap);
default -> displayAsset(assetOnMap);
}
}
}
private void addTankShoot(AssetOnMap assetOnMap) {
displayAsset(assetOnMap);
tankTop = displayAndControl(new AssetOnMap(Asset.tankShootTop, assetOnMap.x(), assetOnMap.y(), assetOnMap.rot()), new TankTopControl());
}
private void addRadar(AssetOnMap assetOnMap) {
radarPos = gridToWorld(assetOnMap.x(), assetOnMap.y());
displayAsset(assetOnMap);
}
/**
* Converts an asset to its corresponding color.
*
@@ -175,8 +193,8 @@ private Color assetToColor(Asset asset) {
* Creates a 3D model of an asset and adds it to the board.
*
* @param asset The asset to be displayed
* @param pos The position of the asset on the board
* @param rot The rotation of the asset
* @param pos The position of the asset on the board
* @param rot The rotation of the asset
* @return The Spatial representation of the asset
*/
private Spatial createModel(Asset asset, Vector3f pos, float rot) {
@@ -187,11 +205,16 @@ private Spatial createModel(Asset asset, Vector3f pos, float rot) {
model.rotate((float) Math.toRadians(0), 0, (float) Math.toRadians(rot));
model.setLocalTranslation(pos);
model.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md");
mat.setTexture("DiffuseMap", app.getAssetManager().loadTexture(texName));
mat.setBoolean("UseMaterialColors", true); // Required for Material Colors
mat.setColor("Diffuse", new ColorRGBA(1, 1, 1, 1)); // White color with full alpha
mat.setColor("Ambient", new ColorRGBA(1, 1, 1, 1)); // Ambient color with full alpha
mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
model.setMaterial(mat);
rootNodeBoard.attachChild(model);
rootNodeBoard.attachChild(model);
return model;
}
@@ -218,17 +241,39 @@ private Spatial displayAsset(AssetOnMap assetOnMap) {
return createModel(assetOnMap.asset(), gridToWorld(x, y), assetOnMap.rot());
}
/**
* Adds a visual representation of an asset to the scene, attaches a control to it, and returns the control.
*
* @param assetOnMap The asset to be displayed in the 3D environment.
* @param control The control to be added to the spatial representing the asset.
* @param <T> The type of control, extending {@code AbstractControl}.
* @return The control that was added to the spatial.
*/
private <T extends AbstractControl> T displayAndControl(AssetOnMap assetOnMap, T control) {
Spatial spatial = displayAsset(assetOnMap);
spatial.addControl(control);
return control;
}
private void movePieceToNode(PieceControl pieceControl, NodeControl nodeControl){
/**
* Moves a piece in the 3D environment to the location of a specified node.
*
* @param pieceControl The control managing the piece to be moved.
* @param nodeControl The control managing the target node to which the piece will move.
*/
private void movePieceToNode(PieceControl pieceControl, NodeControl nodeControl) {
pieceControl.setLocation(nodeControl.getLocation());
}
private void addHomeNode(Map<Color, List<NodeControl>> map, Color color, AssetOnMap assetOnMap){
/**
* Adds a home node for a specific player color, attaching it to the map of home nodes.
*
* @param map The map storing lists of home nodes by player color.
* @param color The color associated with the home nodes to be added.
* @param assetOnMap The asset representing the home node in the 3D environment.
* @throws RuntimeException if more than 4 home nodes are added for a single color.
*/
private void addHomeNode(Map<Color, List<NodeControl>> map, Color color, AssetOnMap assetOnMap) {
List<NodeControl> homeNodes = addItemToMapList(map, color, displayAndControl(assetOnMap, new NodeControl(app, fpp)));
if (homeNodes.size() > 4) throw new RuntimeException("too many homeNodes for " + color);
}
@@ -244,47 +289,74 @@ private float getRotationMove(Vector3f prev, Vector3f next) {
Vector3f direction = next.subtract(prev).normalizeLocal();
//I had to reverse dir.y, because then it worked.
float newRot = (float) Math.toDegrees(Math.atan2(direction.x, -direction.y));
if(newRot < 0) newRot += 360;
if (newRot < 0) newRot += 360;
return newRot;
}
/**
* Recursively moves a piece from its current index to the destination index,
* to keep track of the piece rotation.
*
* @param uuid The UUID of the piece to move.
* @param curIndex The current index of the piece.
* @param moveIndex The target index to move the piece to.
* Recursively moves a piece from its current index to the destination index,
* to keep track of the piece rotation.
*
* @param uuid The UUID of the piece to move.
* @param curIndex The current index of the piece.
* @param moveIndex The target index to move the piece to.
*/
private void movePieceRek(UUID uuid, int curIndex, int moveIndex){
private void movePieceRek(UUID uuid, int curIndex, int moveIndex) {
if (curIndex == moveIndex) return;
curIndex = (curIndex + 1) % infield.size();
int nextIndex = (curIndex + 1) % infield.size();
PieceControl pieceControl = pieces.get(uuid);
NodeControl nodeControl = infield.get(curIndex);
NodeControl nodeCur = infield.get(curIndex);
NodeControl nodeMove = infield.get(nextIndex);
pieceControl.setRotation(getRotationMove(pieceControl.getLocation(),nodeControl.getLocation()));
pieceControl.setRotation(getRotationMove(nodeCur.getLocation(), nodeMove.getLocation()));
movePieceToNode(pieceControl, nodeControl);
movePieceToNode(pieceControl, nodeMove);
movePieceRek(uuid, curIndex, moveIndex);
movePieceRek(uuid, nextIndex, moveIndex);
}
private <T, E> List<T> addItemToMapList(Map<E,List<T>> map, E key, T item){
/**
* Adds an item to a list in a map. If the key does not exist in the map, a new list is created.
*
* @param map The map containing lists of items.
* @param key The key associated with the list in the map.
* @param item The item to be added to the list.
* @param <T> The type of items in the list.
* @param <E> The type of the key in the map.
* @return The updated list associated with the specified key.
*/
private <T, E> List<T> addItemToMapList(Map<E, List<T>> map, E key, T item) {
List<T> list = map.getOrDefault(key, new ArrayList<>());
list.add(item);
map.put(key, list);
return list;
}
private <T, E> void removeItemFromMapList(Map<E,List<T>> map, E key, T item){
/**
* Removes an item from a list in a map. If the key does not exist in the map, a new list is created.
*
* @param map The map containing lists of items.
* @param key The key associated with the list in the map.
* @param item The item to be removed from the list.
* @param <T> The type of items in the list.
* @param <E> The type of the key in the map.
*/
private <T, E> void removeItemFromMapList(Map<E, List<T>> map, E key, T item) {
List<T> list = map.getOrDefault(key, new ArrayList<>());
list.remove(item);
map.put(key, list);
}
private Vector3f getWaitingPos(Color color){
/**
* Calculates the mean position of the waiting nodes for a specific color.
*
* @param color The color associated with the waiting nodes.
* @return The mean position of the waiting nodes as a {@code Vector3f}.
*/
private Vector3f getWaitingPos(Color color) {
return getMeanPosition(waitingNodesMap.get(color).stream().map(NodeControl::getLocation).toList());
}
@@ -294,7 +366,7 @@ private Vector3f getWaitingPos(Color color){
* @param vectors The list of vectors.
* @return The mean position as a Vector3f.
*/
public static Vector3f getMeanPosition(List<Vector3f> vectors) {
private static Vector3f getMeanPosition(List<Vector3f> vectors) {
if (vectors.isEmpty()) return new Vector3f(0, 0, 0);
Vector3f sum = new Vector3f(0, 0, 0);
@@ -308,20 +380,22 @@ public static Vector3f getMeanPosition(List<Vector3f> vectors) {
* Adds a player to the game by associating a color and a list of UUIDs to corresponding assets and waiting nodes.
*
* @param color the color of the player
* @param uuid the list of UUIDs representing the player's assets
* @param uuid the list of UUIDs representing the player's assets
* @throws RuntimeException if the number of assets or waiting nodes does not match the provided UUIDs
*/
public void addPlayer(Color color, List<UUID> uuid) {
List<AssetOnMap> playerAssets = colorAssetsMap.get(color);
if (playerAssets == null) throw new RuntimeException("Assets for Player color are not defined");
if (uuid.size() != playerAssets.size()) throw new RuntimeException("UUID array and playerAssets are not the same size");
if (uuid.size() != playerAssets.size())
throw new RuntimeException("UUID array and playerAssets are not the same size");
List<NodeControl> waitNodes = waitingNodesMap.get(color);
if (waitNodes.size() != playerAssets.size()) throw new RuntimeException("waitNodes size does not match playerAssets size");
if (waitNodes.size() != playerAssets.size())
throw new RuntimeException("waitNodes size does not match playerAssets size");
for (int i = 0; i < playerAssets.size(); i++){
for (int i = 0; i < playerAssets.size(); i++) {
AssetOnMap assetOnMap = playerAssets.get(i);
UUID pieceUuid = uuid.get(i);
@@ -346,18 +420,18 @@ public void addPlayer(Color color, List<UUID> uuid) {
/**
* Moves a piece to its corresponding home node based on the given index.
*
* @param uuid the UUID of the piece to move
* @param uuid the UUID of the piece to move
* @param index the index of the home node to move the piece to
* @throws RuntimeException if the UUID is not mapped to a color or if the home nodes are not properly defined
*/
private void moveHomePiece(UUID uuid, int index){
private void executeHomeMove(UUID uuid, int index) {
Color color = pieceColor.get(uuid);
if(color == null) throw new RuntimeException("uuid is not mapped to a color");
if (color == null) throw new RuntimeException("uuid is not mapped to a color");
List<NodeControl> homeNodes = homeNodesMap.get(color);
if(homeNodesMap.size() != 4) throw new RuntimeException("HomeNodes for" + color + " are not properly defined");
if (homeNodesMap.size() != 4) throw new RuntimeException("HomeNodes for" + color + " are not properly defined");
PieceControl pieceControl = pieces.get(uuid);
NodeControl nodeControl = homeNodes.get(index);
@@ -365,21 +439,22 @@ private void moveHomePiece(UUID uuid, int index){
//rotate piece in direction of homeNodes
NodeControl firstHomeNode = homeNodes.get(0);
NodeControl lastHomeNode = homeNodes.get(homeNodes.size()-1);
NodeControl lastHomeNode = homeNodes.get(homeNodes.size() - 1);
pieceControl.setRotation(getRotationMove(firstHomeNode.getLocation(), lastHomeNode.getLocation()));
app.getModelSynchronize().animationEnd();
app.getModelSynchronize().animationEnd();
}
/**
* Starts the movement of a piece to a target node based on the given index.
*
* @param uuid the UUID of the piece to move
* @param uuid the UUID of the piece to move
* @param nodeIndex the index of the target node to move the piece to
* @throws RuntimeException if the UUID is not mapped to a color or the piece control is not found
* @throws RuntimeException if the UUID is not mapped to a color or the piece control is not found
* @throws IllegalArgumentException if the node index is invalid
*/
private void movePieceStart(UUID uuid, int nodeIndex){
private void executeStartMove(UUID uuid, int nodeIndex) {
// Farbe des Pieces abrufen
Color color = pieceColor.get(uuid);
@@ -400,19 +475,21 @@ private void movePieceStart(UUID uuid, int nodeIndex){
removeItemFromMapList(waitingPiecesMap, color, pieceControl);
waitingNodes.get(color).remove(uuid);
app.getModelSynchronize().animationEnd();
app.getModelSynchronize().animationEnd();
}
/**
* Moves a piece from its current position to the target position based on the given indexes.
*
* @param uuid the UUID of the piece to move
* @param curIndex the current index of the piece
* @param uuid the UUID of the piece to move
* @param curIndex the current index of the piece
* @param moveIndex the target index of the move
*/
private void movePiece(UUID uuid, int curIndex, int moveIndex){
private void executeMove(UUID uuid, int curIndex, int moveIndex) {
movePieceRek(uuid, curIndex, moveIndex);
app.getModelSynchronize().animationEnd();
app.getModelSynchronize().animationEnd();
}
/**
@@ -421,7 +498,7 @@ private void movePiece(UUID uuid, int curIndex, int moveIndex){
* @param uuid the UUID of the piece to throw
* @throws RuntimeException if the UUID is not mapped to a color or if no available waiting nodes are found
*/
private void throwPiece(UUID uuid){
private void throwPiece(UUID uuid) {
// Farbe des Pieces abrufen
Color color = pieceColor.get(uuid);
@@ -455,8 +532,7 @@ private void throwPiece(UUID uuid){
*
* @param uuid the UUID of the piece to shield
*/
public void shieldPiece(UUID uuid){
public void shieldPiece(UUID uuid) {
pieces.get(uuid).activateShield();
}
@@ -465,8 +541,7 @@ public void shieldPiece(UUID uuid){
*
* @param uuid the UUID of the piece to unshield
*/
public void unshieldPiece(UUID uuid){
public void unshieldPiece(UUID uuid) {
pieces.get(uuid).deactivateShield();
}
@@ -475,7 +550,7 @@ public void unshieldPiece(UUID uuid){
*
* @param uuid the UUID of the piece to suppress the shield
*/
public void suppressShield(UUID uuid){
public void suppressShield(UUID uuid) {
pieces.get(uuid).suppressShield();
}
@@ -483,14 +558,14 @@ public void suppressShield(UUID uuid){
/**
* Swaps the positions and rotations of two pieces.
*
* @param p1 the first piece to swap
* @param p2 the second piece to swap
* @param p1 the first piece to swap
* @param p2 the second piece to swap
* @param loc1 the original location of the first piece
* @param rot1 the original rotation of the first piece
* @param loc2 the original location of the second piece
* @param rot2 the original rotation of the second piece
*/
private void swapPieces(PieceControl p1, PieceControl p2, Vector3f loc1, float rot1, Vector3f loc2, float rot2){
private void executeSwap(PieceControl p1, PieceControl p2, Vector3f loc1, float rot1, Vector3f loc2, float rot2) {
p1.setLocation(loc2);
p2.setLocation(loc1);
@@ -503,13 +578,14 @@ private void swapPieces(PieceControl p1, PieceControl p2, Vector3f loc1, float r
/**
* Outlines the possible move nodes for a list of pieces based on the move indices and whether it's a home move.
*
* @param pieces the list of UUIDs representing the pieces to outline
* @param pieces the list of UUIDs representing the pieces to outline
* @param moveIndexe the list of indices for the target move nodes
* @param homeMoves the list indicating whether the move is a home move
* @param homeMoves the list indicating whether the move is a home move
* @throws RuntimeException if the sizes of the input lists do not match
*/
public void outlineMove(List<UUID> pieces, List<Integer> moveIndexe, List<Boolean> homeMoves) {
if(pieces.size() != moveIndexe.size() || pieces.size() != homeMoves.size()) throw new RuntimeException("arrays are not the same size");
public void setSelectableMove(List<UUID> pieces, List<Integer> moveIndexe, List<Boolean> homeMoves) {
if (pieces.size() != moveIndexe.size() || pieces.size() != homeMoves.size())
throw new RuntimeException("arrays are not the same size");
selectableEnemyPieces.clear();
selectableOwnPieces.clear();
@@ -524,44 +600,38 @@ public void outlineMove(List<UUID> pieces, List<Integer> moveIndexe, List<Boolea
if (homeMoves.get(i)) {
Color color = pieceColor.get(uuid);
nodeControl = homeNodesMap.get(color).get(moveIndexe.get(i));
}
else {
} else {
nodeControl = infield.get(moveIndexe.get(i));
}
nodeControl.highlight();
pieceControl.highlight(false);
pieceControl.setHoverable(true);
pieceControl.setSelectable(true);
pieceControl.selectableOwn();
nodeControl.selectableOwn();
outlineNodes.add(nodeControl);
selectableOwnPieces.add(pieceControl);
selectedPieceNodeMap.put(pieceControl, nodeControl);
}
}
/**
* Outlines the pieces that can be swapped based on the provided own and enemy pieces.
*
* @param ownPieces the list of UUIDs representing the player's pieces
* @param ownPieces the list of UUIDs representing the player's pieces
* @param enemyPieces the list of UUIDs representing the enemy's pieces
*/
public void outlineSwap(List<UUID> ownPieces, List<UUID> enemyPieces){
public void setSelectableSwap(List<UUID> ownPieces, List<UUID> enemyPieces) {
selectableEnemyPieces.clear();
selectableOwnPieces.clear();
selectedOwnPiece = null;
selectedEnemyPiece = null;
for(UUID uuid : ownPieces) {
for (UUID uuid : ownPieces) {
PieceControl p = pieces.get(uuid);
p.highlight(false);
p.setHoverable(true);
p.setSelectable(true);
p.selectableOwn();
selectableOwnPieces.add(p);
}
for(UUID uuid : enemyPieces) {
for (UUID uuid : enemyPieces) {
PieceControl p = pieces.get(uuid);
p.highlight(true);
p.setHoverable(true);
p.setSelectable(true);
p.selectableEnemy();
selectableEnemyPieces.add(p);
}
}
@@ -571,17 +641,15 @@ public void outlineSwap(List<UUID> ownPieces, List<UUID> enemyPieces){
*
* @param pieces the list of UUIDs representing the pieces to be shielded
*/
public void outlineShield(List<UUID> pieces){
public void setSelectableShield(List<UUID> pieces) {
selectableOwnPieces.clear();
selectableEnemyPieces.clear();
selectedOwnPiece = null;
selectedEnemyPiece = null;
for (UUID uuid : pieces){
for (UUID uuid : pieces) {
PieceControl p = this.pieces.get(uuid);
p.highlight(false);
p.setHoverable(true);
p.setSelectable(true);
p.selectableOwn();
selectableOwnPieces.add(p);
}
}
@@ -591,59 +659,87 @@ public void outlineShield(List<UUID> pieces){
*
* @param pieceSelected the PieceControl instance representing the piece selected by the user
*/
public void pieceSelect(PieceControl pieceSelected) {
boolean isSelected = pieceSelected.isSelected();
if(selectableOwnPieces.contains(pieceSelected)){
for(PieceControl p : selectableOwnPieces) {
p.unSelect();
public void pieceSelect(OutlineOEControl selected) {
PieceControl piece = getPieceByOE(selected);
NodeControl node = selectedPieceNodeMap.get(piece);
boolean isSelected = piece.isSelected();
if (selectableOwnPieces.contains(piece)) {
for (PieceControl p : selectableOwnPieces) {
p.selectOff();
NodeControl n = selectedPieceNodeMap.get(p);
if (n != null) n.selectOff();
}
if (!isSelected) {
pieceSelected.select();
selectedOwnPiece = pieceSelected;
}
else {
pieceSelected.unSelect();
piece.selectOn();
if (node != null) node.selectOn();
selectedOwnPiece = piece;
} else {
piece.selectOff();
if (node != null) node.selectOff();;
selectedOwnPiece = null;
}
}
else if(selectableEnemyPieces.contains(pieceSelected)) {
for(PieceControl p : selectableEnemyPieces) {
p.unSelect();
} else if (selectableEnemyPieces.contains(piece)) {
for (PieceControl p : selectableEnemyPieces) {
p.selectOff();
}
if (!isSelected) {
pieceSelected.select();
selectedEnemyPiece = pieceSelected;
}
else {
pieceSelected.unSelect();
piece.selectOn();
selectedEnemyPiece = piece;
} else {
piece.selectOff();
selectedEnemyPiece = null;
}
}
else throw new RuntimeException("pieceSelected is not in own/enemySelectablePieces");
} else throw new RuntimeException("pieceSelected is not in own/enemySelectablePieces");
app.getModelSynchronize().select(getKeyByValue(pieces, selectedOwnPiece), getKeyByValue(pieces, selectedEnemyPiece));
}
public void hoverOn(OutlineOEControl hover) {
PieceControl piece = getPieceByOE(hover);
NodeControl node = selectedPieceNodeMap.get(piece);
piece.hoverOn();
if(node != null) node.hoverOn();
}
public void hoverOff(OutlineOEControl hover) {
PieceControl piece = getPieceByOE(hover);
NodeControl node = selectedPieceNodeMap.get(piece);
piece.hoverOff();
if(node != null) node.hoverOff();
}
private PieceControl getPieceByOE(OutlineOEControl control){
PieceControl piece;
if (control instanceof PieceControl p){
piece = p;
}
else if (control instanceof NodeControl n){
piece = getKeyByValue(selectedPieceNodeMap, n);
}
else throw new RuntimeException("selected is not instanceof piece or node");
return piece;
}
/**
* Clears all highlighted, selectable, and selected pieces and nodes.
*/
public void clearSelectable(){
for(PieceControl p : selectableEnemyPieces) {
p.unSelect();
p.unHighlight();
p.setSelectable(false);
public void clearSelectable() {
for (PieceControl p : selectableOwnPieces) {
p.selectableOff();
NodeControl n = selectedPieceNodeMap.get(p);
if(n != null) n.selectableOff();
}
for(PieceControl p : selectableOwnPieces) {
p.unSelect();
p.unHighlight();
p.setSelectable(false);
}
for(NodeControl n : outlineNodes){
n.deOutline();
for (PieceControl p : selectableEnemyPieces) {
p.selectableOff();
}
outlineNodes.clear();
selectableEnemyPieces.clear();
selectableOwnPieces.clear();
selectedPieceNodeMap.clear();
selectedEnemyPiece = null;
selectedOwnPiece = null;
}
@@ -653,16 +749,16 @@ public void clearSelectable(){
*
* @param color the color of the player whose dice should be displayed
*/
public void showDice(Color color){
public void showDice(Color color) {
rootNodeBoard.attachChild(diceControl.getSpatial());
diceControl.setPos(getWaitingPos(color).add(new Vector3f(0,0,4)));
diceControl.setPos(getWaitingPos(color).add(new Vector3f(0, 0, 4)));
diceControl.spin();
}
/**
* Hides the dice from the view.
*/
public void hideDice(){
public void hideDice() {
diceControl.hide();
}
@@ -678,41 +774,42 @@ private <K, V> K getKeyByValue(Map<K, V> map, V value) {
/**
* Animates the movement of a piece from its current index to a target index.
*
* @param uuid the UUID of the piece to animate
* @param curIndex the current index of the piece
* @param uuid the UUID of the piece to animate
* @param curIndex the current index of the piece
* @param moveIndex the target index to animate the piece to
*/
public void movePieceAnim(UUID uuid, int curIndex, int moveIndex){
public void movePiece(UUID uuid, int curIndex, int moveIndex) {
pieces.get(uuid).getSpatial().addControl(new MoveControl(
infield.get(curIndex).getLocation(),
infield.get(moveIndex).getLocation(),
()->movePiece(uuid,curIndex,moveIndex)));
infield.get(curIndex).getLocation(),
infield.get(moveIndex).getLocation(),
() -> executeMove(uuid, curIndex, moveIndex)));
}
/**
* Animates the movement of a piece to its home position based on the given home index.
*
* @param uuid the UUID of the piece to animate
* @param uuid the UUID of the piece to animate
* @param homeIndex the index of the home node to move the piece to
*/
public void movePieceHomeAnim(UUID uuid, int homeIndex){
public void movePieceHome(UUID uuid, int homeIndex) {
pieces.get(uuid).getSpatial().addControl(new MoveControl(
pieces.get(uuid).getLocation(),
homeNodesMap.get(pieceColor.get(uuid)).get(homeIndex).getLocation(),
()->moveHomePiece(uuid,homeIndex)));
pieces.get(uuid).getLocation(),
homeNodesMap.get(pieceColor.get(uuid)).get(homeIndex).getLocation(),
() -> executeHomeMove(uuid, homeIndex)));
}
/**
* Animates the start of the movement of a piece to a target index.
*
* @param uuid the UUID of the piece to animate
* @param uuid the UUID of the piece to animate
* @param moveIndex the target index to animate the piece to
*/
public void movePieceStartAnim(UUID uuid, int moveIndex){
public void movePieceStart(UUID uuid, int moveIndex) {
pieces.get(uuid).getSpatial().addControl(new MoveControl(
pieces.get(uuid).getLocation(),
infield.get(moveIndex).getLocation(),
()->movePieceStart(uuid, moveIndex)
pieces.get(uuid).getLocation(),
infield.get(moveIndex).getLocation(),
() -> executeStartMove(uuid, moveIndex)
));
}
@@ -721,43 +818,61 @@ public void movePieceStartAnim(UUID uuid, int moveIndex){
*
* @param uuid the UUID of the piece to animate
*/
public void throwPieceAnim(UUID uuid){
private void throwPieceAnim(UUID uuid) {
pieces.get(uuid).getSpatial().addControl(new MoveControl(
pieces.get(uuid).getLocation(), getNextWaitingNode(pieceColor.get(uuid)).getLocation(), ()->throwPiece(uuid))
pieces.get(uuid).getLocation(), getNextWaitingNode(pieceColor.get(uuid)).getLocation(),
() -> throwPiece(uuid))
);
}
/**
* Animates the throwing of a piece to the next available waiting node and plays jet animation.
*
* @param uuid the UUID of the piece to animate
*/
public void throwBombAnim(UUID uuid){
Vector3f targetPoint = pieces.get(uuid).getLocation();
JetAnimation anim = new JetAnimation(app, rootNode, uuid, targetPoint, 40, 6);
anim.start();
public void throwPiece(UUID uuid, Color throwColor) {
switch (throwColor) {
case ARMY -> throwShell(uuid);
case NAVY -> throwMissile(uuid);
case CYBER -> throwMatrix(uuid);
case AIRFORCE -> throwBomb(uuid);
default -> throw new RuntimeException("invalid color");
}
}
/**
* Animates the throwing of a piece to the next available waiting node and plays ship animation.
* Animates the throwing of a piece to the next available waiting node.
*
* @param uuid the UUID of the piece to animate
*/
public void throwMissileAnim(UUID uuid){
private void throwBomb(UUID uuid) {
Vector3f targetPoint = pieces.get(uuid).getLocation();
MissileAnimation anim = new MissileAnimation(app, rootNode, uuid, targetPoint, 2);
JetAnimation anim = new JetAnimation(app, rootNode, targetPoint, 40, 6, () -> throwPieceAnim(uuid));
anim.start();
}
private void throwMatrix(UUID uuid) {
app.getAcousticHandler().playSound(MdgaSound.MATRIX);
Spatial piece = pieces.get(uuid).getSpatial();
piece.addControl(new MatrixAnimation(app, radarPos, () -> {
throwPieceAnim(uuid);
}));
}
private void throwMissile(UUID uuid) {
Vector3f targetPoint = pieces.get(uuid).getLocation();
MissileAnimation anim = new MissileAnimation(app, rootNode, targetPoint, 2f, () -> throwPieceAnim(uuid));
anim.start();
}
private void throwShell(UUID uuid) {
pieces.get(uuid).getSpatial().addControl(new ShellAnimation(tankTop, app, () -> throwPieceAnim(uuid)));
}
/**
* Animates the swapping of two pieces by swapping their positions and rotations.
*
* @param piece1 the UUID of the first piece
* @param piece2 the UUID of the second piece
*/
public void swapPieceAnim(UUID piece1, UUID piece2){
public void swapPieces(UUID piece1, UUID piece2) {
PieceControl piece1Control = pieces.get(piece1);
PieceControl piece2Control = pieces.get(piece2);
@@ -767,14 +882,15 @@ public void swapPieceAnim(UUID piece1, UUID piece2){
float rot2 = piece2Control.getRotation();
piece1Control.getSpatial().addControl(new MoveControl(
piece1Control.getLocation().clone(),
piece2Control.getLocation().clone(),
()->{}
piece1Control.getLocation().clone(),
piece2Control.getLocation().clone(),
() -> {
}
));
piece2Control.getSpatial().addControl(new MoveControl(
piece2Control.getLocation().clone(),
piece1Control.getLocation().clone(),
()->swapPieces(piece1Control,piece2Control,loc1,rot1,loc2,rot2)
piece2Control.getLocation().clone(),
piece1Control.getLocation().clone(),
() -> executeSwap(piece1Control, piece2Control, loc1, rot1, loc2, rot2)
));
}

View File

@@ -73,7 +73,7 @@ public CameraHandler(MdgaApp app, FilterPostProcessor fpp) {
// 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);
sky = SkyFactory.createSky(app.getAssetManager(), "Images/sky/sky.dds", EnvMapType.EquirectMap).rotate(FastMath.HALF_PI * 1, 0, FastMath.HALF_PI * 0.2f);
}
@@ -94,7 +94,7 @@ public void init(Color ownColor) {
init = true;
initRot = true;
this.ownColor = ownColor;
app.getInputSynchronize().setRotation(getInitAngleByColor(ownColor)*2);
app.getInputSynchronize().setRotation(getInitAngleByColor(ownColor) * 2);
}
/**
@@ -102,26 +102,29 @@ public void init(Color ownColor) {
* and resets the camera position and rotation to its default state.
*/
public void shutdown() {
app.getRootNode().removeLight(sun);
app.getRootNode().removeLight(ambient);
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);
fpp.removeFilter(dlsf);
}
/**
* 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 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;
if (!init) return;
float scrollValue = Math.max(0, Math.min(scroll, 100));
float rotationValue = rotation % 360;
@@ -159,8 +162,8 @@ public void update(float scroll, float rotation) {
* @param color The color used to determine the camera angle.
* @return The camera angle in degrees.
*/
private float getAngleByColor(Color color){
return switch (color){
private float getAngleByColor(Color color) {
return switch (color) {
case ARMY -> 0;
case AIRFORCE -> 90;
case NAVY -> 270;
@@ -175,7 +178,7 @@ private float getAngleByColor(Color color){
* @param color The color used to determine the camera angle.
* @return The initial camera angle in degrees.
*/
private float getInitAngleByColor(Color color){
private float getInitAngleByColor(Color color) {
return (getAngleByColor(color) + 180) % 360;
}

View File

@@ -28,15 +28,15 @@ private MapLoader() {
*
* @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 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) {
@@ -65,11 +65,9 @@ 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();
}
@@ -109,6 +107,9 @@ private static Asset getLoadedAsset(String assetName) {
case "tank" -> Asset.tank;
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,21 +1,15 @@
package pp.mdga.client.board;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.post.FilterPostProcessor;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.control.AbstractControl;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.outline.OutlineControl;
/**
* 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 OutlineControl {
private static final ColorRGBA OUTLINE_HIGHLIGHT_COLOR = ColorRGBA.White;
private static final int OUTLINE_HIGHLIGHT_WIDTH = 6;
public class NodeControl extends OutlineOEControl {
/**
* Constructs a {@link NodeControl} with the specified application and post processor.
@@ -25,7 +19,7 @@ public class NodeControl extends OutlineControl {
* @param fpp The {@link FilterPostProcessor} to apply post-processing effects.
*/
public NodeControl(MdgaApp app, FilterPostProcessor fpp) {
super(app, fpp);
super(app, fpp, app.getCamera());
}
/**
@@ -34,15 +28,7 @@ public NodeControl(MdgaApp app, FilterPostProcessor fpp) {
*
* @return The {@link Vector3f} representing the node's location.
*/
public Vector3f getLocation(){
public Vector3f getLocation() {
return this.getSpatial().getLocalTranslation();
}
/**
* Highlights the node by applying an outline effect.
* The outline color and width are predefined as white and 6, respectively.
*/
public void highlight() {
super.outline(OUTLINE_HIGHLIGHT_COLOR, OUTLINE_HIGHLIGHT_WIDTH);
}
}

View File

@@ -1,67 +0,0 @@
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.InitControl;
import pp.mdga.client.outline.SelectObjectOutliner;
/**
* A control that provides outline functionality to a spatial object.
* This class is responsible for adding an outline effect to a spatial
* object, allowing it to be highlighted or deselected.
*/
public class OutlineControl extends InitControl {
/** The {@link SelectObjectOutliner} responsible for managing the outline effect. */
private final SelectObjectOutliner outlineOwn;
private static final int THICKNESS_DEFAULT = 6;
private MdgaApp app;
public OutlineControl(MdgaApp app, FilterPostProcessor fpp){
this.app = app;
outlineOwn = new SelectObjectOutliner(THICKNESS_DEFAULT, fpp, app.getRenderManager(), app.getAssetManager(), app.getCamera(), app);
}
public OutlineControl(MdgaApp app, FilterPostProcessor fpp, Camera cam){
this.app = app;
outlineOwn = new SelectObjectOutliner(THICKNESS_DEFAULT, fpp, app.getRenderManager(), app.getAssetManager(), cam, app);
}
public OutlineControl(MdgaApp app, FilterPostProcessor fpp, Camera cam, int thickness){
this.app = app;
outlineOwn = new SelectObjectOutliner(thickness, fpp, app.getRenderManager(), app.getAssetManager(), cam, app);
}
/**
* Applies an outline to the spatial object with the given color.
*
* @param color The {@link ColorRGBA} representing the color of the outline.
*/
public void outline(ColorRGBA color){
outlineOwn.select(spatial, color);
}
/**
* Applies an outline to the spatial object with the given color and width.
*
* @param color The {@link ColorRGBA} representing the color of the outline.
* @param width The width of the outline.
*/
public void outline(ColorRGBA color, int width){
deOutline();
outlineOwn.select(spatial, color, width);
}
/**
* Removes the outline effect from the spatial object.
*/
public void deOutline(){
outlineOwn.deselect(spatial);
}
public MdgaApp getApp() {
return app;
}
}

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

@@ -13,6 +13,7 @@
import com.jme3.scene.Spatial;
import pp.mdga.client.Asset;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.outline.OutlineControl;
/**
* A control that manages the behavior and properties of a game piece, such as its rotation,
@@ -20,7 +21,7 @@
* to provide outline functionality and includes additional features like shield effects,
* hover states, and selection states.
*/
public class PieceControl extends OutlineControl {
public class PieceControl extends OutlineOEControl {
private final float initRotation;
private final AssetManager assetManager;
private Spatial shieldRing;
@@ -32,16 +33,6 @@ public class PieceControl extends OutlineControl {
private static final ColorRGBA SHIELD_SUPPRESSED_COLOR = new ColorRGBA(1f, 0.5f, 0, SHIELD_TRANSPARENCY);
private static final float SHIELD_Z = 0f;
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;
private final Node parentNode;
private boolean enemy;
private boolean hoverable;
@@ -55,22 +46,17 @@ public class PieceControl extends OutlineControl {
*
* @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.
* @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);
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);
enemy = false;
hoverable = false;
highlight = false;
selectable = false;
select = false;
}
/**
@@ -79,7 +65,7 @@ public PieceControl(float initRotation, AssetManager assetManager, MdgaApp app,
* @return The rotation of the piece in degrees.
*/
public float getRotation() {
return (float) Math.toDegrees(spatial.getLocalRotation().toAngleAxis(new Vector3f(0,0,1)));
return (float) Math.toDegrees(spatial.getLocalRotation().toAngleAxis(new Vector3f(0, 0, 1)));
}
/**
@@ -87,11 +73,11 @@ public float getRotation() {
*
* @param rot The rotation in degrees to set.
*/
public void setRotation(float rot){
if(rot < 0) rot =- 360;
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));
quaternion.fromAngleAxis((float) Math.toRadians(rot), new Vector3f(0, 0, 1));
spatial.setLocalRotation(quaternion);
}
@@ -100,7 +86,7 @@ public void setRotation(float rot){
*
* @return The location of the piece as a {@link Vector3f}.
*/
public Vector3f getLocation(){
public Vector3f getLocation() {
return spatial.getLocalTranslation();
}
@@ -111,8 +97,9 @@ public Vector3f getLocation(){
*/
@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)));
}
}
@@ -121,7 +108,7 @@ protected void controlUpdate(float delta) {
*
* @param loc The location to set as a {@link Vector3f}.
*/
public void setLocation(Vector3f loc){
public void setLocation(Vector3f loc) {
this.spatial.setLocalTranslation(loc);
}
@@ -130,7 +117,7 @@ public void setLocation(Vector3f loc){
* This also moves the spatial to a new parent node for organizational purposes.
*/
@Override
public void initSpatial(){
public void initSpatial() {
setRotation(this.initRotation);
Node oldParent = spatial.getParent();
@@ -141,18 +128,21 @@ public void initSpatial(){
}
public void rotateInit() {
// rotate(rotation - initRotation);
setRotation(initRotation);
}
/**
* Activates the shield around the piece.
* This adds a visual shield effect in the form of a rotating ring.
*/
public void activateShield(){
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
@@ -166,7 +156,7 @@ public void activateShield(){
* Deactivates the shield by removing the shield ring from the scene.
*/
public void deactivateShield(){
public void deactivateShield() {
parentNode.detachChild(shieldRing);
shieldRing = null;
}
@@ -174,108 +164,16 @@ public void deactivateShield(){
/**
* Suppresses the shield, changing its color to a suppressed state.
*/
public void suppressShield(){
assert(shieldRing != null) : "PieceControl: shieldRing is not set";
public void suppressShield() {
assert (shieldRing != null) : "PieceControl: shieldRing is not set";
shieldMat.setColor("Color", SHIELD_SUPPRESSED_COLOR);
}
public void setMaterial(Material mat){
public void setMaterial(Material mat) {
spatial.setMaterial(mat);
}
public Material getMaterial(){
public Material getMaterial() {
return ((Geometry) getSpatial()).getMaterial();
}
/**
* Highlights the piece with the appropriate outline color based on whether it is an enemy or not.
*
* @param enemy True if the piece is an enemy, false if it is owned by the player.
*/
public void highlight(boolean enemy) {
this.enemy = enemy;
highlight = true;
super.outline(enemy ? OUTLINE_ENEMY_COLOR : OUTLINE_OWN_COLOR, OUTLINE_HIGHLIGHT_WIDTH);
}
/**
* Removes the highlight effect from the piece.
*/
public void unHighlight(){
highlight = false;
deOutline();
}
/**
* Applies a hover effect on the piece if it is hoverable.
*/
public void hover(){
if(!hoverable) return;
super.outline(enemy ? OUTLINE_ENEMY_HOVER_COLOR : OUTLINE_OWN_HOVER_COLOR, OUTLINE_HOVER_WIDTH);
}
/**
* Removes the hover effect from the piece.
*/
public void hoverOff(){
if(!hoverable) return;
if(select) select();
else if(highlight) highlight(enemy);
else deOutline();
}
/**
* Deselects the piece and removes the selection outline. If the piece was highlighted,
* it will be re-highlighted. Otherwise, the outline is removed.
*/
public void unSelect(){
select = false;
if(highlight) highlight(enemy);
else deOutline();
}
/**
* Selects the piece and applies the selection outline. If the piece is an enemy, it will
* be outlined with the enemy selection color; otherwise, the own selection color will be used.
*/
public void select(){
if(!selectable) return;
select = true;
super.outline(enemy ? OUTLINE_ENEMY_SELECT_COLOR : OUTLINE_OWN_SELECT_COLOR, OUTLINE_SELECT_WIDTH);
}
/**
* Sets whether the piece is selectable.
*
* @param selectable True if the piece can be selected, false otherwise.
*/
public void setSelectable(boolean selectable){
this.selectable = selectable;
}
/**
* Checks if the piece is selected.
*
* @return True if the piece is selected, false otherwise.
*/
public boolean isSelected() { return select; }
/**
* Checks if the piece is selectable.
*
* @return True if the piece is selectable, false otherwise.
*/
public boolean isSelectable() {
return selectable;
}
/**
* Sets whether the piece is hoverable.
*
* @param hoverable True if the piece can be hovered over, false otherwise.
*/
public void setHoverable(boolean hoverable) {
this.hoverable = hoverable;
}
}

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

@@ -115,7 +115,7 @@ public abstract class AbstractButton {
* 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 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) {

View File

@@ -3,7 +3,6 @@
import com.jme3.math.Vector2f;
import com.jme3.scene.Node;
import pp.mdga.client.MdgaApp;
import com.jme3.ui.Picture;
/**
* Represents a specific implementation of a clickable button positioned on the left side.

View File

@@ -69,15 +69,16 @@ public enum Pos {
* 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 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
* @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));
super(app, node, () -> {
}, "", new Vector2f(WIDTH, 7), new Vector2f(0, 0));
this.node3d = node3d;
@@ -217,9 +218,9 @@ public void update(float tpf) {
}
model.setLocalRotation(new Quaternion().fromAngles(
(float) Math.toRadians(90),
(float) Math.toRadians(rot),
(float) Math.toRadians(180)
(float) Math.toRadians(90),
(float) Math.toRadians(rot),
(float) Math.toRadians(180)
));
}
@@ -236,9 +237,9 @@ private void createModel(Asset asset, Vector3f pos) {
model = app.getAssetManager().loadModel(modelName);
model.scale(asset.getSize() / 2);
model.rotate(
(float) Math.toRadians(90),
(float) Math.toRadians(rot),
(float) Math.toRadians(180)
(float) Math.toRadians(90),
(float) Math.toRadians(rot),
(float) Math.toRadians(180)
);
model.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);

View File

@@ -41,12 +41,12 @@ public abstract class ClickButton extends AbstractButton {
/**
* 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 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
* @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);
@@ -203,9 +203,9 @@ protected void setImageRelative(Picture picture) {
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
instance.getLocalTranslation().x - larger / 2,
(instance.getLocalTranslation().y - picture.getHeight()) + larger / 2,
instance.getLocalTranslation().z + 0.01f
);
}
}

View File

@@ -38,7 +38,8 @@ public class LabelButton extends ClickButton {
* @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);
super(app, node, () -> {
}, label, size, pos);
this.isButton = isButton;

View File

@@ -1,17 +1,13 @@
package pp.mdga.client.button;
import com.jme3.light.AmbientLight;
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.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Quad;
import com.jme3.texture.Texture;
import com.simsilica.lemur.component.QuadBackgroundComponent;
import pp.mdga.client.Asset;
import pp.mdga.client.MdgaApp;
@@ -101,11 +97,11 @@ public enum Taken {
/**
* 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)
* @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));
@@ -261,9 +257,9 @@ public void update(float tpf) {
}
model.setLocalRotation(new Quaternion().fromAngles(
(float) Math.toRadians(90),
(float) Math.toRadians(rot),
(float) Math.toRadians(180)
(float) Math.toRadians(90),
(float) Math.toRadians(rot),
(float) Math.toRadians(180)
));
}
@@ -280,9 +276,9 @@ private void createModel(Asset asset, Vector3f pos) {
model = app.getAssetManager().loadModel(modelName);
model.scale(asset.getSize() / 2);
model.rotate(
(float) Math.toRadians(90),
(float) Math.toRadians(rot),
(float) Math.toRadians(180)
(float) Math.toRadians(90),
(float) Math.toRadians(rot),
(float) Math.toRadians(180)
);
model.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);

View File

@@ -13,10 +13,10 @@ 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
* @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));

View File

@@ -2,8 +2,6 @@
import com.jme3.math.Vector2f;
import com.jme3.scene.Node;
import com.simsilica.lemur.HAlignment;
import com.simsilica.lemur.VAlignment;
import com.simsilica.lemur.component.IconComponent;
import pp.mdga.client.MdgaApp;

View File

@@ -77,12 +77,17 @@ public SliderButton(MdgaApp app, Node node, String label) {
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(5.5f, 1);
size = new Vector2f(6f, 1);
// Add label and slider to container
container.addChild(this.label);

View File

@@ -7,6 +7,11 @@
import pp.mdga.client.button.SliderButton;
import pp.mdga.client.view.MdgaView;
/**
* The {@code AudioSettingsDialog} class represents a dialog for adjusting audio settings in the application.
* It provides controls for managing main volume, music volume, and sound effect volume, and includes
* a button to return to the previous menu.
*/
public class AudioSettingsDialog extends Dialog {
private final MdgaView view;
@@ -18,6 +23,13 @@ public class AudioSettingsDialog extends Dialog {
private boolean active = false;
/**
* Constructs an {@code AudioSettingsDialog}.
*
* @param app The main application managing the dialog.
* @param node The root node for attaching UI elements.
* @param view The current view, used for navigation and interaction with the dialog.
*/
public AudioSettingsDialog(MdgaApp app, Node node, MdgaView view) {
super(app, node);
@@ -42,6 +54,9 @@ public AudioSettingsDialog(MdgaApp app, Node node, MdgaView view) {
backButton.setPos(new Vector2f(0, 1.8f));
}
/**
* Called when the dialog is shown. Initializes and displays the volume controls and back button.
*/
@Override
protected void onShow() {
active = true;
@@ -57,6 +72,9 @@ protected void onShow() {
soundVolume.show();
}
/**
* Called when the dialog is hidden. Hides all volume controls and the back button.
*/
@Override
protected void onHide() {
active = false;
@@ -68,8 +86,12 @@ protected void onHide() {
soundVolume.hide();
}
/**
* Updates the application audio settings based on the current values of the sliders.
* This method is called continuously while the dialog is active.
*/
public void update() {
if(!active) {
if (!active) {
return;
}

View File

@@ -10,17 +10,30 @@
import java.util.ArrayList;
/**
* The {@code CeremonyDialog} class displays a dialog containing statistical data in a tabular format.
* It allows adding rows of statistics and manages their visibility when shown or hidden.
*/
public class CeremonyDialog extends Dialog {
private ArrayList<ArrayList<LabelButton>> labels;
float offsetX;
/**
* Constructs a {@code CeremonyDialog}.
*
* @param app The main application managing the dialog.
* @param node The root node for attaching UI elements.
*/
public CeremonyDialog(MdgaApp app, Node node) {
super(app, node);
prepare();
}
/**
* Called when the dialog is shown. Makes all label buttons in the table visible.
*/
@Override
protected void onShow() {
for (ArrayList<LabelButton> row : labels) {
@@ -30,6 +43,9 @@ protected void onShow() {
}
}
/**
* Called when the dialog is hidden. Hides all label buttons in the table.
*/
@Override
protected void onHide() {
for (ArrayList<LabelButton> row : labels) {
@@ -39,6 +55,17 @@ protected void onHide() {
}
}
/**
* Adds a row of statistical data to the dialog.
*
* @param name The name of the player or category for the row.
* @param v1 The value for the first column.
* @param v2 The value for the second column.
* @param v3 The value for the third column.
* @param v4 The value for the fourth column.
* @param v5 The value for the fifth column.
* @param v6 The value for the sixth column.
*/
public void addStatisticsRow(String name, int v1, int v2, int v3, int v4, int v5, int v6) {
float offsetYSmall = 0.5f;
@@ -61,7 +88,7 @@ public void addStatisticsRow(String name, int v1, int v2, int v3, int v4, int v5
int j = 0;
for (LabelButton b : row) {
if(j > 0) {
if (j > 0) {
b.setColor(colorText, colorButton);
}
@@ -76,6 +103,9 @@ public void addStatisticsRow(String name, int v1, int v2, int v3, int v4, int v5
labels.add(row);
}
/**
* Prepares the initial layout of the dialog, including header labels.
*/
public void prepare() {
offsetX = 0.5f;

View File

@@ -1,33 +1,55 @@
package pp.mdga.client.dialog;
import com.jme3.scene.Node;
import com.simsilica.lemur.Container;
import pp.mdga.client.MdgaApp;
/**
* The {@code Dialog} class serves as an abstract base class for dialogs in the application.
* It provides functionality for showing and hiding the dialog and defines abstract methods
* for custom behavior when the dialog is shown or hidden.
*/
public abstract class Dialog {
protected final MdgaApp app;
protected final Node node = new Node();
private final Node root;
/**
* Constructs a {@code Dialog}.
*
* @param app The main application managing the dialog.
* @param node The root node to which the dialog's node will be attached.
*/
Dialog(MdgaApp app, Node node) {
this.app = app;
this.root = node;
}
/**
* Shows the dialog by attaching its node to the root node and invoking the {@code onShow} method.
*/
public void show() {
root.attachChild(node);
onShow();
}
/**
* Hides the dialog by detaching its node from the root node and invoking the {@code onHide} method.
*/
public void hide() {
root.detachChild(node);
onHide();
}
/**
* Called when the dialog is shown. Subclasses must implement this method to define custom behavior.
*/
protected abstract void onShow();
/**
* Called when the dialog is hidden. Subclasses must implement this method to define custom behavior.
*/
protected abstract void onHide();
}

View File

@@ -12,7 +12,11 @@
import java.util.prefs.Preferences;
public class HostDialog extends NetworkDialog {
/**
* The {@code HostDialog} class represents a dialog for hosting a network game session.
* It allows users to input a port number, start hosting a server, and navigate back to the previous view.
*/
public class HostDialog extends NetworkDialog {
private InputButton portInput;
private ButtonRight hostButton;
@@ -22,6 +26,13 @@ public class HostDialog extends NetworkDialog {
private Preferences prefs = Preferences.userNodeForPackage(JoinDialog.class);
/**
* Constructs a {@code HostDialog}.
*
* @param app The main application managing the dialog.
* @param node The root node for attaching UI elements.
* @param view The main view used for navigation and interaction with the dialog.
*/
public HostDialog(MdgaApp app, Node node, MainView view) {
super(app, node, (NetworkSupport) app.getNetworkSupport());
@@ -39,6 +50,9 @@ public HostDialog(MdgaApp app, Node node, MainView view) {
offset += 1.5f;
}
/**
* Called when the dialog is shown. Displays all input fields and buttons.
*/
@Override
protected void onShow() {
portInput.show();
@@ -46,6 +60,9 @@ protected void onShow() {
backButton.show();
}
/**
* Called when the dialog is hidden. Hides all input fields and buttons.
*/
@Override
protected void onHide() {
portInput.hide();
@@ -53,27 +70,44 @@ protected void onHide() {
backButton.hide();
}
/**
* Updates the state of the port input field.
* This method is called periodically to synchronize the dialog state.
*/
public void update() {
portInput.update();
}
/**
* Retrieves the currently entered port number, saves it to preferences, and sets it as the active port.
*
* @return The port number as a string.
*/
public String getPort() {
prefs.put("hostPort", portInput.getString());
setPortNumber(Integer.parseInt(portInput.getString()));
return portInput.getString();
}
/**
* Resets the port input field to its default value and updates preferences accordingly.
*/
public void resetPort() {
portInput.reset();
prefs.put("hostPort", "11111");
}
/**
* Starts the server to host a network game.
*/
public void hostServer() {
startServer();
}
/**
* Connects to the server as a client.
*/
public void connectServerAsClient() {
connectServer();
}
}

View File

@@ -3,13 +3,15 @@
import com.jme3.math.Vector2f;
import com.jme3.scene.Node;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.button.AbstractButton;
import pp.mdga.client.button.ButtonRight;
import pp.mdga.client.button.LabelButton;
import pp.mdga.client.button.MenuButton;
import pp.mdga.client.view.MdgaView;
import pp.mdga.game.Color;
/**
* The {@code InterruptDialog} class represents a dialog that interrupts the game flow,
* providing a message and the option to force an action if the user is a host.
*/
public class InterruptDialog extends Dialog {
private ButtonRight forceButton;
@@ -17,33 +19,50 @@ public class InterruptDialog extends Dialog {
private String text = "";
/**
* Constructs an {@code InterruptDialog}.
*
* @param app The main application managing the dialog.
* @param node The root node for attaching UI elements.
*/
public InterruptDialog(MdgaApp app, Node node) {
super(app, node);
forceButton = new ButtonRight(app, node, () -> app.getModelSynchronize().force(), "Erzwingen", 1);
}
/**
* Called when the dialog is shown. Displays the label and optionally the force button if the user is the host.
*/
@Override
protected void onShow() {
if (app.getGameLogic().isHost()) {
forceButton.show();
}
label = new LabelButton(app, node, "Warte auf " + text + "...", new Vector2f(5.5f * 1.5f, 2), new Vector2f(0.5f, 0f), false);
float offset = 2.8f;
label.setPos(new Vector2f(0, MenuButton.VERTICAL - offset));
}
@Override
protected void onShow() {
if(app.getGameLogic().isHost()) {
forceButton.show();
}
label.show();
}
/**
* Called when the dialog is hidden. Hides the label and the force button.
*/
@Override
protected void onHide() {
forceButton.hide();
label.hide();
}
/**
* Sets the displayed text based on the specified color.
*
* @param color The color used to determine the text (e.g., "Luftwaffe" for AIRFORCE).
*/
public void setColor(Color color) {
switch (color) {
case AIRFORCE:

View File

@@ -4,7 +4,6 @@
import com.jme3.scene.Node;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.NetworkSupport;
import pp.mdga.client.acoustic.AcousticHandler;
import pp.mdga.client.button.ButtonLeft;
import pp.mdga.client.button.ButtonRight;
import pp.mdga.client.button.InputButton;
@@ -13,6 +12,10 @@
import java.util.prefs.Preferences;
/**
* The {@code JoinDialog} class represents a dialog for joining a network game.
* It allows users to input an IP address and port number, connect to a server, or navigate back to the previous view.
*/
public class JoinDialog extends NetworkDialog {
private InputButton ipInput;
private InputButton portInput;
@@ -24,6 +27,13 @@ public class JoinDialog extends NetworkDialog {
private Preferences prefs = Preferences.userNodeForPackage(JoinDialog.class);
/**
* Constructs a {@code JoinDialog}.
*
* @param app The main application managing the dialog.
* @param node The root node for attaching UI elements.
* @param view The main view used for navigation and interaction with the dialog.
*/
public JoinDialog(MdgaApp app, Node node, MainView view) {
super(app, node, (NetworkSupport) app.getNetworkSupport());
@@ -46,6 +56,9 @@ public JoinDialog(MdgaApp app, Node node, MainView view) {
offset += 1.5f;
}
/**
* Called when the dialog is shown. Displays all input fields and buttons.
*/
@Override
protected void onShow() {
ipInput.show();
@@ -54,6 +67,9 @@ protected void onShow() {
backButton.show();
}
/**
* Called when the dialog is hidden. Hides all input fields and buttons.
*/
@Override
protected void onHide() {
ipInput.hide();
@@ -62,37 +78,62 @@ protected void onHide() {
backButton.hide();
}
/**
* Updates the state of the input fields. This method is called periodically to synchronize the dialog state.
*/
public void update() {
ipInput.update();
portInput.update();
}
/**
* Retrieves the currently entered IP address, saves it to preferences, and sets it as the hostname.
*
* @return The IP address as a string.
*/
public String getIpt() {
prefs.put("joinIp", ipInput.getString());
setHostname(ipInput.getString());
return ipInput.getString();
}
/**
* Resets the IP input field to its default value and updates preferences accordingly.
*/
public void resetIp() {
ipInput.reset();
prefs.put("joinIp", "");
}
/**
* Retrieves the currently entered port number, saves it to preferences, and sets it as the active port.
*
* @return The port number as a string.
*/
public String getPort() {
prefs.put("joinPort", portInput.getString());
setPortNumber(Integer.parseInt(portInput.getString()));
return portInput.getString();
}
/**
* Resets the port input field to its default value and updates preferences accordingly.
*/
public void resetPort() {
portInput.reset();
prefs.put("joinPort", "11111");
}
/**
* Connects to the server using the current IP address and port number.
*/
public void connectToServer() {
connectServer();
}
/**
* Disconnects from the server if a network connection exists.
*/
public void disconnect() {
NetworkSupport network = getNetwork();
if (network != null) {
@@ -104,4 +145,3 @@ public void disconnect() {
}
}
}

View File

@@ -8,6 +8,11 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
/**
* The {@code NetworkDialog} class serves as an abstract base class for dialogs
* that involve network-related functionalities, such as connecting to a server or hosting a game.
* It provides methods for initializing, connecting to, and managing a network server.
*/
public abstract class NetworkDialog extends Dialog {
private NetworkSupport network;
@@ -17,19 +22,41 @@ public abstract class NetworkDialog extends Dialog {
private MdgaServer serverInstance;
private Thread serverThread;
/**
* Constructs a {@code NetworkDialog}.
*
* @param app The main application managing the dialog.
* @param node The root node for attaching UI elements.
* @param network The network support instance for managing network interactions.
*/
public NetworkDialog(MdgaApp app, Node node, NetworkSupport network) {
super(app, node);
this.network = network;
}
/**
* Sets the hostname for the network connection.
*
* @param hostname The hostname or IP address of the server.
*/
public void setHostname(String hostname) {
this.hostname = hostname;
}
/**
* Sets the port number for the network connection.
*
* @param portNumber The port number to use for the connection.
*/
public void setPortNumber(int portNumber) {
this.portNumber = portNumber;
}
/**
* Initializes the network connection using the current hostname and port number.
*
* @return {@code null} if successful, otherwise throws an exception.
*/
protected Object initNetwork() {
try {
this.network.initNetwork(this.hostname, this.portNumber);
@@ -39,6 +66,9 @@ protected Object initNetwork() {
}
}
/**
* Starts the process of connecting to a server asynchronously.
*/
protected void connectServer() {
try {
connectionFuture = this.network.getApp().getExecutor().submit(this::initNetwork);
@@ -47,6 +77,9 @@ protected void connectServer() {
}
}
/**
* Starts hosting a server in a separate thread.
*/
protected void startServer() {
serverThread = new Thread(() -> {
try {
@@ -60,31 +93,27 @@ protected void startServer() {
serverThread.start();
}
/**
* Shuts down the hosted server and cleans up resources.
*/
public void shutdownServer() {
serverInstance.shutdown();
// Wait for the server to shut down
try {
Thread.sleep(1000);
serverThread.join(); // Wait for the server thread to finish
System.out.println("Server shutdown successfully.");
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
System.err.println("Thread was interrupted: " + e.getMessage());
}
if (serverInstance != null) {
serverInstance.shutdown();
serverInstance = null;
}
if (serverThread != null && serverThread.isAlive()) {
serverThread.interrupt();
try {
serverThread.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
serverThread = null;
}
}
/**
* Updates the state of the connection process.
*
* @param delta The time elapsed since the last update call.
*/
public void update(float delta) {
if (this.connectionFuture != null && this.connectionFuture.isDone()) {
try {
@@ -97,6 +126,11 @@ public void update(float delta) {
}
}
/**
* Retrieves the {@code NetworkSupport} instance associated with this dialog.
*
* @return The {@code NetworkSupport} instance.
*/
public NetworkSupport getNetwork() {
return network;
}

View File

@@ -3,11 +3,13 @@
import com.jme3.math.Vector2f;
import com.jme3.scene.Node;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.button.InputButton;
import pp.mdga.client.button.MenuButton;
import pp.mdga.client.view.MainView;
import pp.mdga.client.view.MdgaView;
/**
* The {@code SettingsDialog} class represents a dialog for navigating to various settings sections,
* such as video and audio settings, or returning to the previous view.
*/
public class SettingsDialog extends Dialog {
private MenuButton videoButton;
private MenuButton audioButton;
@@ -15,6 +17,13 @@ public class SettingsDialog extends Dialog {
private final MdgaView view;
/**
* Constructs a {@code SettingsDialog}.
*
* @param app The main application managing the dialog.
* @param node The root node for attaching UI elements.
* @param view The view managing navigation and interaction with the settings dialog.
*/
public SettingsDialog(MdgaApp app, Node node, MdgaView view) {
super(app, node);
@@ -34,6 +43,9 @@ public SettingsDialog(MdgaApp app, Node node, MdgaView view) {
backButton.setPos(new Vector2f(0, 1.8f));
}
/**
* Called when the dialog is shown. Displays all buttons for video settings, audio settings, and back navigation.
*/
@Override
protected void onShow() {
videoButton.show();
@@ -41,6 +53,9 @@ protected void onShow() {
backButton.show();
}
/**
* Called when the dialog is hidden. Hides all buttons for video settings, audio settings, and back navigation.
*/
@Override
protected void onHide() {
videoButton.hide();

View File

@@ -1,19 +1,18 @@
package pp.mdga.client.dialog;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.simsilica.lemur.Container;
import com.simsilica.lemur.component.QuadBackgroundComponent;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.button.InputButton;
import pp.mdga.client.button.MenuButton;
import pp.mdga.client.view.MainView;
import java.util.Random;
import java.util.random.RandomGenerator;
/**
* The {@code StartDialog} class represents the initial dialog in the application,
* allowing the user to input their name, host or join a game, or exit the application.
*/
public class StartDialog extends Dialog {
private InputButton nameInput;
@@ -23,6 +22,13 @@ public class StartDialog extends Dialog {
private final MainView view;
/**
* Constructs a {@code StartDialog}.
*
* @param app The main application managing the dialog.
* @param node The root node for attaching UI elements.
* @param view The main view used for navigation and interaction with the dialog.
*/
public StartDialog(MdgaApp app, Node node, MainView view) {
super(app, node);
@@ -48,6 +54,9 @@ public StartDialog(MdgaApp app, Node node, MainView view) {
endButton.setPos(new Vector2f(0, 1.8f));
}
/**
* Called when the dialog is shown. Displays the name input field and all buttons.
*/
@Override
protected void onShow() {
nameInput.show();
@@ -57,9 +66,11 @@ protected void onShow() {
endButton.show();
}
/**
* Called when the dialog is hidden. Hides the name input field and all buttons.
*/
@Override
protected void onHide ()
{
protected void onHide() {
nameInput.hide();
hostButton.hide();
@@ -67,219 +78,227 @@ protected void onHide ()
endButton.hide();
}
/**
* Updates the state of the name input field. This method is called periodically to synchronize the dialog state.
*/
public void update() {
nameInput.update();
}
/**
* Retrieves the name entered by the user. If no name is provided, a random name is generated.
*
* @return The user's name or a randomly generated name.
*/
public String getName() {
String name = nameInput.getString();
if (name == null || name.trim().isEmpty()) {
String[] names = {
"PixelPirat",
"NoobJäger",
"LagMeister",
"KnopfDrücker",
"SpawnCamper",
"AFKHeld",
"RageQuitter",
"GameOverPro",
"Checkpoint",
"RespawnHeld",
"Teebeutel",
"GlitchHexer",
"QuickScope",
"LootSammler",
"EpicLauch",
"KartoffelPro",
"StilleKlinge",
"TastenHeld",
"PixelKrieger",
"HacknSlash",
"JoystickJoe",
"SpawnFalle",
"OneHitWanda",
"CamperKing",
"GameGenie",
"HighPing",
"CheesePro",
"Speedy",
"GigaGamer",
"LevelNoob",
"SkillTobi",
"HeadshotMax",
"PentaPaul",
"CritKarl",
"ManaLeerer",
"Nachlader",
"ClutchKönig",
"FriendlyFe",
"ZonenHeld",
"SchleichKatze",
"ShotgunPro",
"SniperUdo",
"BossHunter",
"HeldenNoob",
"KillFranz",
"FragKarl",
"TeamNiete",
"LootPaul",
"UltraNoob",
"ProfiScout",
"PunkteKlaus",
"KrüppelKill",
"PixelNinja",
"NoobCrusher",
"LagBoss",
"SpawnKing",
"AFKSlayer",
"RespawnPro",
"Killjoy",
"GameBreaker",
"FastFingers",
"LootKing",
"QuickFlick",
"SilentShot",
"HackGod",
"GlitchHero",
"SpeedyBot",
"AimWizard",
"FragMaster",
"OneTapPro",
"KnifeLord",
"MetaHunter",
"PingWarrior",
"KeyBash",
"ClutchPro",
"ScopeBot",
"TrollMage",
"PowerLooter",
"TankHero",
"CampLord",
"SmurfSlayer",
"SkillThief",
"SniperGod",
"LevelHack",
"GhostAim",
"BossTamer",
"ShotgunJoe",
"AimRider",
"KillCount",
"PixelManiac",
"TrollOver",
"SneakPro",
"ReloadKing",
"SpawnTrap",
"LagLover",
"MetaHater",
"BoomMaker",
"WipeLord",
"CarryPro",
"ProBaiter",
"GameWarden",
"KartoffelKönig",
"SaufenderWolf",
"WurstGriller",
"Flitzekacke",
"BratwurstBub",
"Hoppeldoppels",
"BananenMensch",
"KlopapierGuru",
"SchnitzelKing",
"NerdNomade",
"Dönertänzer",
"GlitzerGurke",
"SchinkenShrek",
"KäseKalle",
"SchokoSchnecke",
"KeksKämpfer",
"QuarkPiraten",
"Müslimonster",
"KnuddelNase",
"FantaFighter",
"SchnapsSaurier",
"Wackelpudding",
"ZitronenZock",
"FettWurst",
"PlüschPanda",
"Zuckerschnur",
"FluffiKopf",
"DonutDöner",
"VollpfostenX",
"Schraubenschlüssel",
"Witzepumper",
"ToastTraum",
"FroschFighter",
"KrümelTiger",
"RegenWolke",
"PuddingPower",
"KoffeinKrieger",
"SpeckSchlumpf",
"SuperSuppe",
"BierBärchen",
"FischBär",
"Flauschi",
"Schokomonster",
"ChaosKäse",
"FlitzLappen",
"WurstWombat",
"KrümelMensch",
"PuddingBär",
"ZickZack",
"Schwabel",
"Fluffi",
"RülpsFrosch",
"PommesPapa",
"QuarkBär",
"KnusperKönig",
"ToastBrot",
"Ploppster",
"Schleimschwein",
"Äpfelchen",
"Knallbonbon",
"KaffeeKopf",
"WackelWurst",
"RennKeks",
"BröselBub",
"ZockerBrot",
"BierWurm",
"StinkFlummi",
"SchlumpfKing",
"PurzelBär",
"FlinkFluff",
"PloppPudel",
"Schnorchel",
"FliegenKopf",
"PixelPommes",
"SchwipsWürst",
"WutzBär",
"KnuddelKeks",
"FantaFlumm",
"ZockerKäse",
"LachHäufchen",
"GurkenGuru",
"PonySchnitzel",
"NudelNinja",
"VulkanKeks",
"WasserToast",
"MenschSalat",
"KampfKohlenhydrate",
"SockenZirkus",
"SchwimmBärchen",
"TanzenderDachgepäckträger",
"PizzamarktMensch",
"ZahnarztZocker",
"RollerCoasterTester",
"WaschmaschinenPilot",
"WitzigeZwiebel",
"Pillenschlucker",
"ZwiebelReiter",
"HüpfenderKaktus",
"KochenderAsteroid",
"ChaosKarotte",
"WolkenFurz",
"SchnitzelPartikel",
"WackelBiene",
"PixelPirat",
"NoobJäger",
"LagMeister",
"KnopfDrücker",
"SpawnCamper",
"AFKHeld",
"RageQuitter",
"GameOverPro",
"Checkpoint",
"RespawnHeld",
"Teebeutel",
"GlitchHexer",
"QuickScope",
"LootSammler",
"EpicLauch",
"KartoffelPro",
"StilleKlinge",
"TastenHeld",
"PixelKrieger",
"HacknSlash",
"JoystickJoe",
"SpawnFalle",
"OneHitWanda",
"CamperKing",
"GameGenie",
"HighPing",
"CheesePro",
"Speedy",
"GigaGamer",
"LevelNoob",
"SkillTobi",
"HeadshotMax",
"PentaPaul",
"CritKarl",
"ManaLeerer",
"Nachlader",
"ClutchKönig",
"FriendlyFe",
"ZonenHeld",
"SchleichKatze",
"ShotgunPro",
"SniperUdo",
"BossHunter",
"HeldenNoob",
"KillFranz",
"FragKarl",
"TeamNiete",
"LootPaul",
"UltraNoob",
"ProfiScout",
"PunkteKlaus",
"KrüppelKill",
"PixelNinja",
"NoobCrusher",
"LagBoss",
"SpawnKing",
"AFKSlayer",
"RespawnPro",
"Killjoy",
"GameBreaker",
"FastFingers",
"LootKing",
"QuickFlick",
"SilentShot",
"HackGod",
"GlitchHero",
"SpeedyBot",
"AimWizard",
"FragMaster",
"OneTapPro",
"KnifeLord",
"MetaHunter",
"PingWarrior",
"KeyBash",
"ClutchPro",
"ScopeBot",
"TrollMage",
"PowerLooter",
"TankHero",
"CampLord",
"SmurfSlayer",
"SkillThief",
"SniperGod",
"LevelHack",
"GhostAim",
"BossTamer",
"ShotgunJoe",
"AimRider",
"KillCount",
"PixelManiac",
"TrollOver",
"SneakPro",
"ReloadKing",
"SpawnTrap",
"LagLover",
"MetaHater",
"BoomMaker",
"WipeLord",
"CarryPro",
"ProBaiter",
"GameWarden",
"KartoffelKönig",
"SaufenderWolf",
"WurstGriller",
"Flitzekacke",
"BratwurstBub",
"Hoppeldoppels",
"BananenMensch",
"KlopapierGuru",
"SchnitzelKing",
"NerdNomade",
"Dönertänzer",
"GlitzerGurke",
"SchinkenShrek",
"KäseKalle",
"SchokoSchnecke",
"KeksKämpfer",
"QuarkPiraten",
"Müslimonster",
"KnuddelNase",
"FantaFighter",
"SchnapsSaurier",
"Wackelpudding",
"ZitronenZock",
"FettWurst",
"PlüschPanda",
"Zuckerschnur",
"FluffiKopf",
"DonutDöner",
"VollpfostenX",
"Waschlappen",
"Witzepumper",
"ToastTraum",
"FroschFighter",
"KrümelTiger",
"RegenWolke",
"PuddingPower",
"KoffeinKrieger",
"SpeckSchlumpf",
"SuperSuppe",
"BierBärchen",
"FischBär",
"Flauschi",
"Schokomonster",
"ChaosKäse",
"FlitzLappen",
"WurstWombat",
"KrümelMensch",
"PuddingBär",
"ZickZack",
"Schwabel",
"Fluffi",
"RülpsFrosch",
"PommesPapa",
"QuarkBär",
"KnusperKönig",
"ToastBrot",
"Ploppster",
"Schleimschwein",
"Äpfelchen",
"Knallbonbon",
"KaffeeKopf",
"WackelWurst",
"RennKeks",
"BröselBub",
"ZockerBrot",
"BierWurm",
"StinkFlummi",
"SchlumpfKing",
"PurzelBär",
"FlinkFluff",
"PloppPudel",
"Schnorchel",
"FliegenKopf",
"PixelPommes",
"SchwipsWürst",
"WutzBär",
"KnuddelKeks",
"FantaFlumm",
"ZockerKäse",
"LachHäufchen",
"GurkenGuru",
"PonySchnitzel",
"NudelNinja",
"VulkanKeks",
"WasserToast",
"MenschSalat",
"KampfKohl",
"SockenZirkus",
"SchwimmBärchen",
"TanzenderPudel",
"PizzamarktMensch",
"ZahnarztZocker",
"RollerRudi",
"PupsPilot",
"WitzigeZwiebel",
"Pillenschlucker",
"ZwiebelReiter",
"HüpfenderKaktus",
"AsteroidenAlf",
"ChaosKarotte",
"WolkenFurz",
"Krümelmonster",
"WackelBiene",
};
Random random = new Random();

View File

@@ -3,7 +3,6 @@
import com.jme3.math.Vector2f;
import com.jme3.scene.Node;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.button.AbstractButton;
import pp.mdga.client.button.ButtonLeft;
import pp.mdga.client.button.ButtonRight;
import pp.mdga.client.button.MenuButton;
@@ -11,6 +10,11 @@
import java.util.prefs.Preferences;
/**
* The {@code VideoSettingsDialog} class represents a dialog for configuring video settings,
* such as resolution and fullscreen mode. It also provides an option to restart the application
* when certain settings are changed.
*/
public class VideoSettingsDialog extends Dialog {
private static Preferences prefs = Preferences.userNodeForPackage(JoinDialog.class);
@@ -29,6 +33,13 @@ public class VideoSettingsDialog extends Dialog {
private boolean active = false;
/**
* Constructs a {@code VideoSettingsDialog}.
*
* @param app The main application managing the dialog.
* @param node The root node for attaching UI elements.
* @param view The view managing navigation and interaction with the video settings dialog.
*/
public VideoSettingsDialog(MdgaApp app, Node node, MdgaView view) {
super(app, node);
@@ -67,6 +78,9 @@ public VideoSettingsDialog(MdgaApp app, Node node, MdgaView view) {
backButton.setPos(new Vector2f(0, 1.8f));
}
/**
* Called when the dialog is shown. Displays all buttons and marks the dialog as active.
*/
@Override
protected void onShow() {
active = true;
@@ -83,6 +97,9 @@ protected void onShow() {
backButton.show();
}
/**
* Called when the dialog is hidden. Hides all buttons and marks the dialog as inactive.
*/
@Override
protected void onHide() {
active = false;
@@ -100,14 +117,25 @@ protected void onHide() {
restartButton.hide();
}
/**
* Updates the dialog's state. This method can be used for periodic updates while the dialog is active.
*/
public void update() {
if(!active) {
if (!active) {
return;
}
}
/**
* Updates the resolution settings and optionally triggers the restart button if changes are detected.
*
* @param width The width of the resolution.
* @param height The height of the resolution.
* @param imageFactor The scaling factor for the resolution.
* @param isFullscreen {@code true} if fullscreen mode is enabled, {@code false} otherwise.
*/
public void updateResolution(int width, int height, float imageFactor, boolean isFullscreen) {
if(width != prefs.getInt("width", 1280) || height != prefs.getInt("height", 720) || isFullscreen != prefs.getBoolean("fullscreen", false)) {
if (width != prefs.getInt("width", 1280) || height != prefs.getInt("height", 720) || isFullscreen != prefs.getBoolean("fullscreen", false)) {
restartButton.show();
}

View File

@@ -10,13 +10,26 @@
import pp.mdga.client.animation.ZoomControl;
import pp.mdga.game.Color;
class ActionTextHandler {
/**
* The {@code ActionTextHandler} class manages the display of animated and stylized text messages in the game's UI.
* It supports dynamic text creation with spacing, color, and effects, such as dice rolls, player actions, and rankings.
*/
class ActionTextHandler {
private Node root;
private BitmapFont font;
private AppSettings appSettings;
private int ranking;
ActionTextHandler(Node guiNode, AssetManager assetManager, AppSettings appSettings){
float paddingRanked = 100;
/**
* Constructs an {@code ActionTextHandler}.
*
* @param guiNode The GUI node where the text messages will be displayed.
* @param assetManager The asset manager used to load fonts and other assets.
* @param appSettings The application settings for positioning and sizing.
*/
ActionTextHandler(Node guiNode, AssetManager assetManager, AppSettings appSettings) {
root = new Node("actionTextRoot");
guiNode.attachChild(root);
@@ -26,13 +39,23 @@ class ActionTextHandler {
ranking = 0;
}
/**
* Creates a {@code Node} containing text with specified spacing, size, and colors for each segment of the text.
*
* @param textArr An array of strings representing the text to be displayed.
* @param spacing The spacing between individual characters.
* @param size The size of the text.
* @param colorArr An array of {@code ColorRGBA} representing the color for each string in {@code textArr}.
* @return A {@code Node} containing the styled text with spacing and color applied.
* @throws RuntimeException if the lengths of {@code textArr} and {@code colorArr} do not match.
*/
private Node createTextWithSpacing(String[] textArr, float spacing, float size, ColorRGBA[] colorArr) {
if(textArr.length != colorArr.length) throw new RuntimeException("text and color are not the same length");
if (textArr.length != colorArr.length) throw new RuntimeException("text and color are not the same length");
Node textNode = new Node("TextWithSpacing");
Node center = new Node();
float xOffset = 0;
for(int i = 0; i < textArr.length; i++){
for (int i = 0; i < textArr.length; i++) {
String text = textArr[i];
ColorRGBA color = colorArr[i];
for (char c : text.toCharArray()) {
@@ -40,90 +63,199 @@ private Node createTextWithSpacing(String[] textArr, float spacing, float size,
letter.setColor(color);
letter.setSize(size);
letter.setText(Character.toString(c));
letter.setLocalTranslation(xOffset, letter.getHeight()/2, 0);
letter.setLocalTranslation(xOffset, letter.getHeight() / 2, 0);
center.attachChild(letter);
xOffset += letter.getLineWidth() + spacing;
}
}
center.setLocalTranslation(new Vector3f(-xOffset/2,0,0));
center.setLocalTranslation(new Vector3f(-xOffset / 2, 0, 0));
textNode.attachChild(center);
return textNode;
}
/**
* Creates a {@code Node} containing text with specified spacing, size, and a single color.
*
* @param text The text to be displayed.
* @param spacing The spacing between individual characters.
* @param size The size of the text.
* @param color The color of the text.
* @return A {@code Node} containing the styled text.
*/
private Node createTextWithSpacing(String text, float spacing, float size, ColorRGBA color) {
return createTextWithSpacing(new String[]{text}, spacing, size, new ColorRGBA[]{color});
}
private Vector3f center(float width, float height, Vector3f pos){
return new Vector3f(pos.x+width/2, pos.y+height/2,0);
/**
* Calculates the center position of a rectangle given its width, height, and an origin position.
*
* @param width The width of the rectangle.
* @param height The height of the rectangle.
* @param pos The origin position of the rectangle.
* @return A {@code Vector3f} representing the center position.
*/
private Vector3f center(float width, float height, Vector3f pos) {
return new Vector3f(pos.x + width / 2, pos.y + height / 2, 0);
}
private Node createTopText(String name, float spacing, float size, ColorRGBA color, float top){
/**
* Creates and positions a single-line text at the top of the screen with a specified vertical offset.
*
* @param name The text to be displayed.
* @param spacing The spacing between individual characters.
* @param size The size of the text.
* @param color The color of the text.
* @param top The vertical offset from the top of the screen.
* @return A {@code Node} containing the styled text positioned at the top.
*/
private Node createTopText(String name, float spacing, float size, ColorRGBA color, float top) {
return createTopText(new String[]{name}, spacing, size, new ColorRGBA[]{color}, top);
}
private Node createTopText(String[] name, float spacing, float size, ColorRGBA color[], float top){
/**
* Creates and positions multi-line text at the top of the screen with specified vertical offset, spacing, and colors.
*
* @param name An array of strings representing the text to be displayed.
* @param spacing The spacing between individual characters.
* @param size The size of the text.
* @param color An array of {@code ColorRGBA} representing the color for each string in {@code name}.
* @param top The vertical offset from the top of the screen.
* @return A {@code Node} containing the styled text positioned at the top.
*/
private Node createTopText(String[] name, float spacing, float size, ColorRGBA color[], float top) {
Node text = createTextWithSpacing(name, spacing, size, color);
text.setLocalTranslation(0, (appSettings.getHeight()/2f)*0.8f-top,0);
text.setLocalTranslation(0, (appSettings.getHeight() / 2f) * 0.8f - top, 0);
root.attachChild(text);
return text;
}
private Vector3f centerText(float width, float height, Vector3f pos){
/**
* Calculates the center position of a rectangle with negative width offset.
*
* @param width The negative width of the rectangle.
* @param height The height of the rectangle.
* @param pos The origin position of the rectangle.
* @return A {@code Vector3f} representing the center position.
*/
private Vector3f centerText(float width, float height, Vector3f pos) {
return center(-width, height, pos);
}
void activePlayer(String name, Color color){
createTopText(new String[]{name," ist dran"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
/**
* Displays a message indicating the active player.
*
* @param name The name of the active player.
* @param color The color representing the player's team.
*/
void activePlayer(String name, Color color) {
createTopText(new String[]{name, " ist dran"}, 10, 90, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0).addControl(new ZoomControl());
}
void ownActive(Color color){
createTopText(new String[]{"Du"," bist dran"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
/**
* Displays a message indicating that the current player is active.
*
* @param color The color representing the player's team.
*/
void ownActive(Color color) {
createTopText(new String[]{"Du", " bist dran"}, 10, 90, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0).addControl(new ZoomControl());
}
void diceNum(int diceNum, String name, Color color){
createTopText(new String[]{name," würfelt:"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0);
/**
* Displays a dice roll result for a player.
*
* @param diceNum The number rolled on the dice.
* @param name The name of the player.
* @param color The color representing the player's team.
*/
void diceNum(int diceNum, String name, Color color) {
createTopText(new String[]{name, " würfelt:"}, 10, 90, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0);
createTopText(String.valueOf(diceNum), 10, 100, ColorRGBA.White, 100);
}
void diceNumMult(int diceNum,int mult, String name, Color color){
createTopText(new String[]{name," würfelt:"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0);
/**
* Displays a dice roll result with a multiplier for a player.
*
* @param diceNum The number rolled on the dice.
* @param mult The multiplier applied to the dice result.
* @param name The name of the player.
* @param color The color representing the player's team.
*/
void diceNumMult(int diceNum, int mult, String name, Color color) {
createTopText(new String[]{name, " würfelt:"}, 10, 90, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0);
createTopText(new String[]{String.valueOf(diceNum), " x" + mult + " = " + (diceNum*mult)}, 20, 100, new ColorRGBA[]{ColorRGBA.White,ColorRGBA.Red}, 100);
createTopText(new String[]{String.valueOf(diceNum), " x" + mult + " = " + (diceNum * mult)}, 20, 100, new ColorRGBA[]{ColorRGBA.White, ColorRGBA.Red}, 100);
}
void ownDice(int diceNum){
/**
* Displays the dice roll result for the current player.
*
* @param diceNum The number rolled on the dice.
*/
void ownDice(int diceNum) {
createTopText(String.valueOf(diceNum), 10, 100, ColorRGBA.White, 0);
}
void ownDiceMult(int diceNum, int mult){
createTopText(new String[]{String.valueOf(diceNum), " x" + mult + " = " + (diceNum*mult)}, 20, 100, new ColorRGBA[]{ColorRGBA.White,ColorRGBA.Red}, 0);
/**
* Displays the dice roll result with a multiplier for the current player.
*
* @param diceNum The number rolled on the dice.
* @param mult The multiplier applied to the dice result.
*/
void ownDiceMult(int diceNum, int mult) {
createTopText(new String[]{String.valueOf(diceNum), " x" + mult + " = " + (diceNum * mult)}, 20, 100, new ColorRGBA[]{ColorRGBA.White, ColorRGBA.Red}, 0);
}
void drawCard(String name, Color color){
createTopText(new String[]{name," erhält eine Bonuskarte"}, 7,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
/**
* Displays a message indicating that a specified player received a bonus card.
*
* @param name The name of the player who received the bonus card.
* @param color The color representing the player's team.
*/
void drawCard(String name, Color color) {
createTopText(new String[]{name, " erhält eine Bonuskarte"}, 7, 70, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0).addControl(new ZoomControl());
}
void drawCardOwn(Color color){
createTopText(new String[]{"Du"," erhälst eine Bonuskarte"}, 5,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
/**
* Displays a message indicating that the current player received a bonus card.
*
* @param color The color representing the player's team.
*/
void drawCardOwn(Color color) {
createTopText(new String[]{"Du", " erhälst eine Bonuskarte"}, 5, 70, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0).addControl(new ZoomControl());
}
void finishText(String name, Color color){
createTopText(new String[]{name," ist fertig!"}, 7,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
/**
* Displays a message indicating that a specified player has completed their turn or action.
*
* @param name The name of the player who finished.
* @param color The color representing the player's team.
*/
void finishText(String name, Color color) {
createTopText(new String[]{name, " ist fertig!"}, 7, 70, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0).addControl(new ZoomControl());
}
void finishTextOwn(Color color){
createTopText(new String[]{"Du", " bist fertig!"}, 7,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl());
/**
* Displays a message indicating that the current player has completed their turn or action.
*
* @param color The color representing the player's team.
*/
void finishTextOwn(Color color) {
createTopText(new String[]{"Du", " bist fertig!"}, 7, 70, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0).addControl(new ZoomControl());
}
private ColorRGBA playerColorToColorRGBA(Color color){
return switch (color){
/**
* Converts a player's team color to a corresponding {@code ColorRGBA}.
*
* @param color The player's team color.
* @return The corresponding {@code ColorRGBA}.
* @throws RuntimeException if the color is invalid.
*/
private ColorRGBA playerColorToColorRGBA(Color color) {
return switch (color) {
case ARMY -> ColorRGBA.Green;
case NAVY -> ColorRGBA.Blue;
case CYBER -> ColorRGBA.Orange;
@@ -132,25 +264,41 @@ private ColorRGBA playerColorToColorRGBA(Color color){
};
}
void hide(){
ranking = 0;
root.detachAllChildren();
/**
* Hides all text messages displayed by the handler and resets the ranking counter.
*/
void hide() {
ranking = 0;
root.detachAllChildren();
}
float paddingRanked = 100;
void rollRankingResult(String name, Color color, int eye){
createTopText(new String[]{name,": "+eye}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, paddingRanked*ranking);
/**
* Displays a ranked dice roll result for a specified player.
*
* @param name The name of the player.
* @param color The color representing the player's team.
* @param eye The dice roll result.
*/
void rollRankingResult(String name, Color color, int eye) {
createTopText(new String[]{name, ": " + eye}, 10, 90, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, paddingRanked * ranking);
ranking++;
}
void rollRankingResultOwn(Color color, int eye){
createTopText(new String[]{"Du",": "+eye}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, paddingRanked*ranking);
ranking++;
}
void diceNow(){
createTopText("Klicke zum Würfeln", 5, 80, ColorRGBA.White, 0);
}
/**
* Displays a ranked dice roll result for the current player.
*
* @param color The color representing the player's team.
* @param eye The dice roll result.
*/
void rollRankingResultOwn(Color color, int eye) {
createTopText(new String[]{"Du", ": " + eye}, 10, 90, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, paddingRanked * ranking);
ranking++;
}
/**
* Displays a message prompting the player to roll the dice.
*/
void diceNow() {
createTopText("Klicke zum Würfeln", 5, 80, ColorRGBA.White, 0);
}
}

View File

@@ -7,23 +7,18 @@
import com.jme3.math.Vector3f;
import com.jme3.post.FilterPostProcessor;
import com.jme3.renderer.Camera;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.control.AbstractControl;
import com.jme3.scene.shape.Box;
import com.jme3.scene.shape.Cylinder;
import com.jme3.scene.shape.Sphere;
import pp.mdga.client.MdgaApp;
import pp.mdga.client.board.OutlineControl;
import java.awt.*;
import pp.mdga.client.outline.OutlineControl;
/**
* CardControl class extends OutlineControl to manage the visual representation
* and behavior of a card in the game.
*/
public class CardControl extends OutlineControl {
private static final ColorRGBA OUTLINE_COLOR = ColorRGBA.Yellow;
private static final ColorRGBA HIGHLIGHT_COLOR = ColorRGBA.Yellow;
private static final int HIGHLIGHT_WIDTH = 9;
@@ -33,29 +28,40 @@ public class CardControl extends OutlineControl {
private static final ColorRGBA SELECT_COLOR = ColorRGBA.Blue;
private static final int SELECT_WIDTH = 13;
private static final int OUTLINE_THICKNESS = 9;
private boolean hoverable;
private boolean highlight;
private boolean selectable;
private boolean select;
private Node root;
private BitmapText num;
public CardControl(MdgaApp app, FilterPostProcessor fpp, Camera cam, Node root){
super(app, fpp, cam, OUTLINE_THICKNESS);
/**
* Constructor for CardControl.
*
* @param app the application instance
* @param fpp the FilterPostProcessor instance
* @param cam the Camera instance
* @param root the root Node
*/
public CardControl(MdgaApp app, FilterPostProcessor fpp, Camera cam, Node root) {
super(app, fpp, cam,
HIGHLIGHT_COLOR, HIGHLIGHT_WIDTH,
HOVER_COLOR, HOVER_WIDTH,
SELECT_COLOR, SELECT_WIDTH
);
this.root = root;
Node rootNum = createNum();
rootNum.setLocalTranslation(new Vector3f(0.35f,0.8f,0));
rootNum.setLocalTranslation(new Vector3f(0.35f, 0.8f, 0));
root.attachChild(rootNum);
}
private Node createNum(){
/**
* Creates a Node containing a number and a circle geometry.
*
* @return the created Node
*/
private Node createNum() {
Node rootNum = new Node("root Num");
Geometry circle = new Geometry("circle", new Sphere(20,20,1));
circle.setLocalTranslation(new Vector3f(0.03f,0.01f,1));
Geometry circle = new Geometry("circle", new Sphere(20, 20, 1));
circle.setLocalTranslation(new Vector3f(0.03f, 0.01f, 1));
circle.setLocalScale(0.2f);
Material mat = new Material(getApp().getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Black);
@@ -72,79 +78,30 @@ private Node createNum(){
return rootNum;
}
public void setNumCard(int num){
/**
* Sets the number displayed on the card.
*
* @param num the number to display
*/
public void setNumCard(int num) {
this.num.setText(String.valueOf(num));
}
/**
* Gets the root Node of the card.
*
* @return the root Node
*/
public Node getRoot() {
return root;
}
/**
* Initializes the spatial properties of the card.
*/
@Override
public void initSpatial(){
public void initSpatial() {
}
public void outline(){
super.outline(OUTLINE_COLOR);
}
private final static Vector3f HIGHLIGHT_Y = new Vector3f(0,0.4f,0);
public void setHighlight() {
this.highlight = true;
root.setLocalTranslation(root.getLocalTranslation().add(HIGHLIGHT_Y));
highlight();
}
public void highlight() {
super.outline(HIGHLIGHT_COLOR, HIGHLIGHT_WIDTH);
}
public void unHighlight(){
highlight = false;
root.setLocalTranslation(root.getLocalTranslation().subtract(HIGHLIGHT_Y));
deOutline();
}
public void hover(){
if(!hoverable) return;
super.outline(HOVER_COLOR, HOVER_WIDTH);
}
public void hoverOff(){
if(!hoverable) return;
if(select) select();
else if(highlight) highlight();
else deOutline();
}
public void select(){
if(!selectable) return;
select = true;
super.outline(SELECT_COLOR, SELECT_WIDTH);
}
public void unSelect(){
if(!selectable) return;
select = false;
if(highlight) highlight();
else deOutline();
}
public void setSelectable(boolean selectable){
this.selectable = selectable;
}
public boolean isSelected() {
return select;
}
public boolean isSelectable() {
return selectable;
}
public void setHoverable(boolean hoverable) {
this.hoverable = hoverable;
}
private final static Vector3f HIGHLIGHT_Y = new Vector3f(0, 0.4f, 0);
}

View File

@@ -8,6 +8,7 @@
import com.jme3.math.Vector3f;
import com.jme3.post.FilterPostProcessor;
import com.jme3.post.filters.ComposeFilter;
import com.jme3.post.filters.FXAAFilter;
import com.jme3.renderer.Camera;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
@@ -18,8 +19,13 @@
import com.jme3.texture.Image;
import com.jme3.texture.Texture2D;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
/**
* CardLayer is an application state that manages the rendering and updating of card objects
* in a separate viewport with post-processing effects.
*/
public class CardLayer extends AbstractAppState {
public static final int SHADOWMAP_SIZE = 1024 * 8;
@@ -31,35 +37,58 @@ public class CardLayer extends AbstractAppState {
private List<Spatial> cardBuffer;
private final FilterPostProcessor fpp;
private final Camera overlayCam;
Texture2D backTexture;
private Texture2D backTexture;
private FXAAFilter fxaaFilter;
private ViewPort view;
private DirectionalLightShadowFilter dlsf;
DirectionalLight sun;
ComposeFilter compose;
/**
* Constructs a new CardLayer with the specified post-processor, camera, and background texture.
*
* @param fpp the FilterPostProcessor to use for post-processing effects
* @param overlayCam the Camera to use for the overlay
* @param backTexture the Texture2D to use as the background texture
*/
public CardLayer(FilterPostProcessor fpp, Camera overlayCam, Texture2D backTexture) {
this.overlayCam = overlayCam;
this.fpp = fpp;
this.cardBuffer = new ArrayList<>();
init = false;
this.backTexture = backTexture;
cardBuffer = new ArrayList<>();
init = false;
fxaaFilter = new FXAAFilter();
view = null;
dlsf = null;
sun = new DirectionalLight();
sun.setColor(ColorRGBA.White);
sun.setDirection(new Vector3f(.5f, -.5f, -1));
compose = new ComposeFilter(backTexture);
root = new Node("Under gui viewport Root");
}
/**
* Initializes the CardLayer, setting up the viewport, filters, and lighting.
*
* @param stateManager the AppStateManager managing this state
* @param app the Application instance
*/
@Override
public void initialize(AppStateManager stateManager, Application app) {
this.app = app;
root = new Node("Under gui viewport Root");
ViewPort view = app.getRenderManager().createMainView("Under gui ViewPort", overlayCam);
view = app.getRenderManager().createMainView("Under gui ViewPort", overlayCam);
view.setEnabled(true);
view.setClearFlags(true, true, true);
view.attachScene(root);
fpp.setFrameBufferFormat(Image.Format.RGBA8);
fpp.addFilter(new ComposeFilter(backTexture));
fpp.addFilter(compose);
fpp.addFilter(fxaaFilter);
DirectionalLight sun = new DirectionalLight();
sun.setColor(ColorRGBA.White);
sun.setDirection(new Vector3f(.5f, -.5f, -1));
root.addLight(sun);
DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter(app.getAssetManager(), SHADOWMAP_SIZE, 3);
dlsf = new DirectionalLightShadowFilter(app.getAssetManager(), SHADOWMAP_SIZE, 3);
dlsf.setLight(sun);
dlsf.setEnabled(true);
dlsf.setEdgeFilteringMode(EdgeFilteringMode.PCFPOISSON);
@@ -71,17 +100,35 @@ public void initialize(AppStateManager stateManager, Application app) {
if (!init) init = true;
}
/**
* Shuts down the CardLayer, removing filters, lights, and clearing buffers.
*/
public void shutdown() {
fpp.removeFilter(dlsf);
dlsf = null;
root.removeLight(sun);
fpp.removeFilter(fxaaFilter);
view.detachScene(root);
cardBuffer.clear();
root.detachAllChildren();
}
/**
* Renders the CardLayer, updating the geometric state of the root node.
*
* @param rm the RenderManager handling the rendering
*/
@Override
public void render(RenderManager rm) {
root.updateGeometricState();
}
/**
* Updates the CardLayer, attaching buffered cards to the root node and updating its logical state.
*
* @param tpf time per frame
*/
@Override
public void update(float tpf) {
if (init && !cardBuffer.isEmpty()) {
@@ -93,19 +140,39 @@ public void update(float tpf) {
root.updateLogicalState(tpf);
}
/**
* Adds a spatial card to the CardLayer.
*
* @param card the Spatial card to add
*/
public void addSpatial(Spatial card) {
if(root == null) cardBuffer.add(card);
if (root == null) cardBuffer.add(card);
else root.attachChild(card);
}
/**
* Deletes a spatial card from the CardLayer.
*
* @param spatial the Spatial card to delete
*/
public void deleteSpatial(Spatial spatial) {
root.detachChild(spatial);
}
/**
* Gets the overlay camera used by the CardLayer.
*
* @return the overlay camera
*/
public Camera getOverlayCam() {
return overlayCam;
}
/**
* Gets the root node of the CardLayer.
*
* @return the root node
*/
public Node getRootNode() {
return root;
}

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