From d4d20533556928f63c8759437f67e76336bab55e Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Mon, 6 Apr 2020 18:55:25 +0200 Subject: Delete old React/TypeScript UI --- sw-ui/src/@types/reflexbox.d.ts | 37 - sw-ui/src/api/model.ts | 187 - sw-ui/src/api/sevenWondersApi.ts | 104 - sw-ui/src/api/websocket.ts | 60 - sw-ui/src/components/Application.tsx | 16 - sw-ui/src/components/game-browser/GameBrowser.tsx | 56 - sw-ui/src/components/game-browser/GameList.css | 3 - sw-ui/src/components/game-browser/GameList.tsx | 85 - sw-ui/src/components/game-browser/GameStatus.tsx | 17 - sw-ui/src/components/game-browser/PlayerCount.css | 3 - sw-ui/src/components/game-browser/PlayerCount.tsx | 12 - sw-ui/src/components/game-browser/PlayerInfo.tsx | 27 - sw-ui/src/components/game/Board.css | 38 - sw-ui/src/components/game/Board.tsx | 67 - sw-ui/src/components/game/CardImage.css | 4 - sw-ui/src/components/game/CardImage.tsx | 26 - sw-ui/src/components/game/GameScene.css | 13 - sw-ui/src/components/game/GameScene.tsx | 77 - sw-ui/src/components/game/Hand.css | 50 - sw-ui/src/components/game/Hand.tsx | 44 - sw-ui/src/components/game/ProductionBar.css | 50 - sw-ui/src/components/game/ProductionBar.tsx | 87 - sw-ui/src/components/game/background-papyrus.jpg | Bin 100272 -> 0 bytes sw-ui/src/components/home/ChooseNameForm.tsx | 42 - sw-ui/src/components/home/Home.css | 13 - sw-ui/src/components/home/Home.tsx | 12 - .../src/components/home/background-zeus-temple.jpg | Bin 571089 -> 0 bytes sw-ui/src/components/home/logo-7-wonders.png | Bin 301442 -> 0 bytes sw-ui/src/components/lobby/Lobby.tsx | 56 - sw-ui/src/components/lobby/PlayerList.tsx | 41 - sw-ui/src/components/lobby/RadialPlayerList.tsx | 69 - .../components/lobby/radial-list/RadialList.css | 23 - .../components/lobby/radial-list/RadialList.tsx | 64 - .../lobby/radial-list/RadialListItem.css | 11 - .../lobby/radial-list/RadialListItem.tsx | 18 - .../components/lobby/radial-list/radial-math.ts | 48 - sw-ui/src/components/lobby/round-table.png | Bin 18527 -> 0 bytes sw-ui/src/global-styles.css | 0 sw-ui/src/index.tsx | 21 - sw-ui/src/main/kotlin/blueprintjs.kt | 525 ++ sw-ui/src/main/kotlin/blueprintjsHelpers.kt | 137 + .../org/luxons/sevenwonders/ui/SevenWondersUi.kt | 49 + .../sevenwonders/ui/components/Application.kt | 22 + .../sevenwonders/ui/components/GlobalStyles.kt | 36 + .../sevenwonders/ui/components/game/Board.kt | 124 + .../sevenwonders/ui/components/game/CardImage.kt | 43 + .../sevenwonders/ui/components/game/GameScene.kt | 178 + .../luxons/sevenwonders/ui/components/game/Hand.kt | 174 + .../ui/components/game/ProductionBar.kt | 164 + .../ui/components/gameBrowser/CreateGameForm.kt | 76 + .../ui/components/gameBrowser/GameBrowser.kt | 10 + .../ui/components/gameBrowser/GameList.kt | 133 + .../ui/components/gameBrowser/PlayerInfo.kt | 36 + .../ui/components/home/ChooseNameForm.kt | 64 + .../luxons/sevenwonders/ui/components/home/Home.kt | 21 + .../sevenwonders/ui/components/home/HomeStyles.kt | 19 + .../sevenwonders/ui/components/lobby/Lobby.kt | 66 + .../sevenwonders/ui/components/lobby/RadialList.kt | 121 + .../sevenwonders/ui/components/lobby/RadialMath.kt | 57 + .../ui/components/lobby/RadialPlayerList.kt | 106 + .../org/luxons/sevenwonders/ui/redux/Actions.kt | 26 + .../org/luxons/sevenwonders/ui/redux/ApiActions.kt | 23 + .../org/luxons/sevenwonders/ui/redux/Reducers.kt | 84 + .../org/luxons/sevenwonders/ui/redux/Store.kt | 29 + .../org/luxons/sevenwonders/ui/redux/Utils.kt | 39 + .../ui/redux/sagas/GameBrowserSagas.kt | 50 + .../sevenwonders/ui/redux/sagas/GameSagas.kt | 36 + .../sevenwonders/ui/redux/sagas/LobbySagas.kt | 42 + .../luxons/sevenwonders/ui/redux/sagas/Sagas.kt | 54 + .../sevenwonders/ui/redux/sagas/SagasFramework.kt | 137 + .../org/luxons/sevenwonders/ui/router/Router.kt | 32 + .../sevenwonders/ui/utils/CoroutinesUtils.kt | 15 + .../org/luxons/sevenwonders/ui/utils/ReactUtils.kt | 16 + sw-ui/src/main/resources/css/blueprint-icons.css | 18 + sw-ui/src/main/resources/css/blueprint.css | 8040 ++++++++++++++++++++ sw-ui/src/main/resources/favicon.ico | Bin 0 -> 24838 bytes .../main/resources/images/background-papyrus1.jpg | Bin 0 -> 100272 bytes .../main/resources/images/background-papyrus2.jpg | Bin 0 -> 885805 bytes .../main/resources/images/background-papyrus3.jpg | Bin 0 -> 480677 bytes .../resources/images/background-zeus-temple.jpg | Bin 0 -> 571089 bytes sw-ui/src/main/resources/images/cards/academy.png | Bin 0 -> 87620 bytes sw-ui/src/main/resources/images/cards/altar.png | Bin 0 -> 80843 bytes .../src/main/resources/images/cards/apothecary.png | Bin 0 -> 88905 bytes sw-ui/src/main/resources/images/cards/aqueduct.png | Bin 0 -> 90765 bytes .../main/resources/images/cards/archeryrange.png | Bin 0 -> 86327 bytes sw-ui/src/main/resources/images/cards/arena.png | Bin 0 -> 84837 bytes sw-ui/src/main/resources/images/cards/arsenal.png | Bin 0 -> 88257 bytes .../src/main/resources/images/cards/back/age1.png | Bin 0 -> 67850 bytes .../src/main/resources/images/cards/back/age2.png | Bin 0 -> 68501 bytes .../src/main/resources/images/cards/back/age3.png | Bin 0 -> 63391 bytes sw-ui/src/main/resources/images/cards/barracks.png | Bin 0 -> 83840 bytes sw-ui/src/main/resources/images/cards/baths.png | Bin 0 -> 84236 bytes sw-ui/src/main/resources/images/cards/bazar.png | Bin 0 -> 80862 bytes .../src/main/resources/images/cards/brickyard.png | Bin 0 -> 79194 bytes .../main/resources/images/cards/buildersguild.png | Bin 0 -> 86054 bytes .../main/resources/images/cards/caravansery.png | Bin 0 -> 85841 bytes .../resources/images/cards/chamberofcommerce.png | Bin 0 -> 89136 bytes sw-ui/src/main/resources/images/cards/circus.png | Bin 0 -> 95879 bytes sw-ui/src/main/resources/images/cards/claypit.png | Bin 0 -> 78992 bytes sw-ui/src/main/resources/images/cards/claypool.png | Bin 0 -> 76294 bytes .../src/main/resources/images/cards/courthouse.png | Bin 0 -> 82399 bytes .../resources/images/cards/craftsmensguild.png | Bin 0 -> 90528 bytes .../src/main/resources/images/cards/dispensary.png | Bin 0 -> 86175 bytes .../resources/images/cards/easttradingpost.png | Bin 0 -> 88611 bytes .../src/main/resources/images/cards/excavation.png | Bin 0 -> 82667 bytes .../src/main/resources/images/cards/forestcave.png | Bin 0 -> 75845 bytes .../main/resources/images/cards/fortifications.png | Bin 0 -> 85633 bytes sw-ui/src/main/resources/images/cards/forum.png | Bin 0 -> 85713 bytes sw-ui/src/main/resources/images/cards/foundry.png | Bin 0 -> 78894 bytes sw-ui/src/main/resources/images/cards/gardens.png | Bin 0 -> 85889 bytes .../src/main/resources/images/cards/glassworks.png | Bin 0 -> 81916 bytes .../src/main/resources/images/cards/guardtower.png | Bin 0 -> 77432 bytes sw-ui/src/main/resources/images/cards/haven.png | Bin 0 -> 93143 bytes .../src/main/resources/images/cards/laboratory.png | Bin 0 -> 87869 bytes sw-ui/src/main/resources/images/cards/library.png | Bin 0 -> 80338 bytes .../src/main/resources/images/cards/lighthouse.png | Bin 0 -> 79746 bytes sw-ui/src/main/resources/images/cards/lodge.png | Bin 0 -> 76021 bytes sw-ui/src/main/resources/images/cards/loom.png | Bin 0 -> 85480 bytes .../src/main/resources/images/cards/lumberyard.png | Bin 0 -> 83067 bytes .../resources/images/cards/magistratesguild.png | Bin 0 -> 88073 bytes .../main/resources/images/cards/marketplace.png | Bin 0 -> 89816 bytes sw-ui/src/main/resources/images/cards/mine.png | Bin 0 -> 83500 bytes .../main/resources/images/cards/observatory.png | Bin 0 -> 81745 bytes sw-ui/src/main/resources/images/cards/orevein.png | Bin 0 -> 82176 bytes sw-ui/src/main/resources/images/cards/palace.png | Bin 0 -> 85097 bytes sw-ui/src/main/resources/images/cards/pantheon.png | Bin 0 -> 83290 bytes sw-ui/src/main/resources/images/cards/pawnshop.png | Bin 0 -> 83440 bytes .../resources/images/cards/philosophersguild.png | Bin 0 -> 89645 bytes sw-ui/src/main/resources/images/cards/press.png | Bin 0 -> 88277 bytes sw-ui/src/main/resources/images/cards/quarry.png | Bin 0 -> 77177 bytes sw-ui/src/main/resources/images/cards/sawmill.png | Bin 0 -> 80987 bytes sw-ui/src/main/resources/images/cards/school.png | Bin 0 -> 80260 bytes .../resources/images/cards/scientistsguild.png | Bin 0 -> 86768 bytes .../main/resources/images/cards/scriptorium.png | Bin 0 -> 84987 bytes sw-ui/src/main/resources/images/cards/senate.png | Bin 0 -> 91055 bytes .../resources/images/cards/shipownersguild.png | Bin 0 -> 86836 bytes .../main/resources/images/cards/siegeworkshop.png | Bin 0 -> 89072 bytes .../src/main/resources/images/cards/spiesguild.png | Bin 0 -> 83823 bytes sw-ui/src/main/resources/images/cards/stables.png | Bin 0 -> 85649 bytes sw-ui/src/main/resources/images/cards/statue.png | Bin 0 -> 83639 bytes sw-ui/src/main/resources/images/cards/stockade.png | Bin 0 -> 70706 bytes sw-ui/src/main/resources/images/cards/stonepit.png | Bin 0 -> 84418 bytes .../resources/images/cards/strategistsguild.png | Bin 0 -> 86575 bytes sw-ui/src/main/resources/images/cards/study.png | Bin 0 -> 84016 bytes sw-ui/src/main/resources/images/cards/tavern.png | Bin 0 -> 81229 bytes sw-ui/src/main/resources/images/cards/temple.png | Bin 0 -> 78057 bytes sw-ui/src/main/resources/images/cards/theater.png | Bin 0 -> 89703 bytes .../src/main/resources/images/cards/timberyard.png | Bin 0 -> 82874 bytes sw-ui/src/main/resources/images/cards/townhall.png | Bin 0 -> 84439 bytes .../main/resources/images/cards/tradersguild.png | Bin 0 -> 88057 bytes .../main/resources/images/cards/trainingground.png | Bin 0 -> 84102 bytes sw-ui/src/main/resources/images/cards/treefarm.png | Bin 0 -> 88252 bytes .../src/main/resources/images/cards/university.png | Bin 0 -> 74203 bytes sw-ui/src/main/resources/images/cards/vineyard.png | Bin 0 -> 81329 bytes sw-ui/src/main/resources/images/cards/walls.png | Bin 0 -> 83027 bytes .../resources/images/cards/westtradingpost.png | Bin 0 -> 90680 bytes .../main/resources/images/cards/workersguild.png | Bin 0 -> 84595 bytes sw-ui/src/main/resources/images/cards/workshop.png | Bin 0 -> 82116 bytes sw-ui/src/main/resources/images/logo-7-wonders.png | Bin 0 -> 301442 bytes sw-ui/src/main/resources/images/round-table.png | Bin 0 -> 18527 bytes sw-ui/src/main/resources/images/tokens/coin.png | Bin 0 -> 4515 bytes .../resources/images/tokens/resources/clay.png | Bin 0 -> 19566 bytes .../resources/images/tokens/resources/glass.png | Bin 0 -> 20961 bytes .../resources/images/tokens/resources/loom.png | Bin 0 -> 21053 bytes .../main/resources/images/tokens/resources/ore.png | Bin 0 -> 21524 bytes .../resources/images/tokens/resources/papyrus.png | Bin 0 -> 22695 bytes .../resources/images/tokens/resources/stone.png | Bin 0 -> 21516 bytes .../resources/images/tokens/resources/wood.png | Bin 0 -> 21642 bytes .../main/resources/images/wonders/alexandriaA.png | Bin 0 -> 500078 bytes .../main/resources/images/wonders/alexandriaB.png | Bin 0 -> 503329 bytes .../src/main/resources/images/wonders/babylonA.png | Bin 0 -> 560943 bytes .../src/main/resources/images/wonders/babylonB.png | Bin 0 -> 560104 bytes .../src/main/resources/images/wonders/ephesosA.png | Bin 0 -> 547227 bytes .../src/main/resources/images/wonders/ephesosB.png | Bin 0 -> 550456 bytes .../resources/images/wonders/extra/agrigentoA.jpg | Bin 0 -> 705403 bytes .../resources/images/wonders/extra/angkorwatA.jpg | Bin 0 -> 930685 bytes .../resources/images/wonders/extra/angkorwatB.jpg | Bin 0 -> 987688 bytes .../resources/images/wonders/extra/avalonA.jpg | Bin 0 -> 658280 bytes .../resources/images/wonders/extra/ctesiphonB.jpg | Bin 0 -> 692738 bytes .../main/resources/images/wonders/extra/iramA.jpg | Bin 0 -> 734054 bytes .../resources/images/wonders/extra/persepolisA.jpg | Bin 0 -> 1057711 bytes .../main/resources/images/wonders/extra/romaA.jpg | Bin 0 -> 200076 bytes .../resources/images/wonders/extra/sangri-laA.jpg | Bin 0 -> 682795 bytes .../resources/images/wonders/extra/spahanA.jpg | Bin 0 -> 774749 bytes .../images/wonders/extra/the-great-wallA.jpg | Bin 0 -> 72721 bytes .../resources/images/wonders/extra/veniseA.jpg | Bin 0 -> 945317 bytes .../resources/images/wonders/extra/veniseB.jpg | Bin 0 -> 941879 bytes sw-ui/src/main/resources/images/wonders/gizahA.png | Bin 0 -> 490115 bytes sw-ui/src/main/resources/images/wonders/gizahB.png | Bin 0 -> 500706 bytes .../resources/images/wonders/halikarnassusA.png | Bin 0 -> 470957 bytes .../resources/images/wonders/halikarnassusB.png | Bin 0 -> 487620 bytes .../src/main/resources/images/wonders/olympiaA.png | Bin 0 -> 557107 bytes .../src/main/resources/images/wonders/olympiaB.png | Bin 0 -> 558174 bytes .../src/main/resources/images/wonders/rhodosA.png | Bin 0 -> 578363 bytes .../src/main/resources/images/wonders/rhodosB.png | Bin 0 -> 575123 bytes sw-ui/src/main/resources/index.html | 15 + sw-ui/src/react-app-env.d.ts | 1 - sw-ui/src/reducers.ts | 31 - sw-ui/src/redux/actions/all.ts | 5 - sw-ui/src/redux/actions/game.ts | 32 - sw-ui/src/redux/actions/lobby.ts | 32 - sw-ui/src/redux/actions/user.ts | 17 - sw-ui/src/redux/currentGame.ts | 46 - sw-ui/src/redux/games.ts | 56 - sw-ui/src/redux/user.ts | 43 - sw-ui/src/sagas.ts | 23 - sw-ui/src/sagas/errors.ts | 36 - sw-ui/src/sagas/game.ts | 81 - sw-ui/src/sagas/gameBrowser.ts | 55 - sw-ui/src/sagas/home.ts | 28 - sw-ui/src/sagas/lobby.ts | 44 - sw-ui/src/setupProxy.js | 8 - sw-ui/src/store.ts | 27 - .../ui/redux/sagas/SagasFrameworkTest.kt | 91 + .../sevenwonders/ui/utils/CoroutineUtilsTest.kt | 24 + 215 files changed, 10932 insertions(+), 2046 deletions(-) delete mode 100644 sw-ui/src/@types/reflexbox.d.ts delete mode 100644 sw-ui/src/api/model.ts delete mode 100644 sw-ui/src/api/sevenWondersApi.ts delete mode 100644 sw-ui/src/api/websocket.ts delete mode 100644 sw-ui/src/components/Application.tsx delete mode 100644 sw-ui/src/components/game-browser/GameBrowser.tsx delete mode 100644 sw-ui/src/components/game-browser/GameList.css delete mode 100644 sw-ui/src/components/game-browser/GameList.tsx delete mode 100644 sw-ui/src/components/game-browser/GameStatus.tsx delete mode 100644 sw-ui/src/components/game-browser/PlayerCount.css delete mode 100644 sw-ui/src/components/game-browser/PlayerCount.tsx delete mode 100644 sw-ui/src/components/game-browser/PlayerInfo.tsx delete mode 100644 sw-ui/src/components/game/Board.css delete mode 100644 sw-ui/src/components/game/Board.tsx delete mode 100644 sw-ui/src/components/game/CardImage.css delete mode 100644 sw-ui/src/components/game/CardImage.tsx delete mode 100644 sw-ui/src/components/game/GameScene.css delete mode 100644 sw-ui/src/components/game/GameScene.tsx delete mode 100644 sw-ui/src/components/game/Hand.css delete mode 100644 sw-ui/src/components/game/Hand.tsx delete mode 100644 sw-ui/src/components/game/ProductionBar.css delete mode 100644 sw-ui/src/components/game/ProductionBar.tsx delete mode 100644 sw-ui/src/components/game/background-papyrus.jpg delete mode 100644 sw-ui/src/components/home/ChooseNameForm.tsx delete mode 100644 sw-ui/src/components/home/Home.css delete mode 100644 sw-ui/src/components/home/Home.tsx delete mode 100644 sw-ui/src/components/home/background-zeus-temple.jpg delete mode 100644 sw-ui/src/components/home/logo-7-wonders.png delete mode 100644 sw-ui/src/components/lobby/Lobby.tsx delete mode 100644 sw-ui/src/components/lobby/PlayerList.tsx delete mode 100644 sw-ui/src/components/lobby/RadialPlayerList.tsx delete mode 100644 sw-ui/src/components/lobby/radial-list/RadialList.css delete mode 100644 sw-ui/src/components/lobby/radial-list/RadialList.tsx delete mode 100644 sw-ui/src/components/lobby/radial-list/RadialListItem.css delete mode 100644 sw-ui/src/components/lobby/radial-list/RadialListItem.tsx delete mode 100644 sw-ui/src/components/lobby/radial-list/radial-math.ts delete mode 100644 sw-ui/src/components/lobby/round-table.png delete mode 100644 sw-ui/src/global-styles.css delete mode 100644 sw-ui/src/index.tsx create mode 100644 sw-ui/src/main/kotlin/blueprintjs.kt create mode 100644 sw-ui/src/main/kotlin/blueprintjsHelpers.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/Application.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/GlobalStyles.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Board.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/CardImage.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameScene.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Hand.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/ProductionBar.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/CreateGameForm.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameBrowser.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/GameList.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/gameBrowser/PlayerInfo.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/Home.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/HomeStyles.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/Lobby.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/RadialList.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/RadialMath.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/RadialPlayerList.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Actions.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/ApiActions.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Store.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Utils.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/GameBrowserSagas.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/GameSagas.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/LobbySagas.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/SagasFramework.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/router/Router.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/utils/CoroutinesUtils.kt create mode 100644 sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/utils/ReactUtils.kt create mode 100644 sw-ui/src/main/resources/css/blueprint-icons.css create mode 100644 sw-ui/src/main/resources/css/blueprint.css create mode 100644 sw-ui/src/main/resources/favicon.ico create mode 100644 sw-ui/src/main/resources/images/background-papyrus1.jpg create mode 100644 sw-ui/src/main/resources/images/background-papyrus2.jpg create mode 100644 sw-ui/src/main/resources/images/background-papyrus3.jpg create mode 100644 sw-ui/src/main/resources/images/background-zeus-temple.jpg create mode 100644 sw-ui/src/main/resources/images/cards/academy.png create mode 100644 sw-ui/src/main/resources/images/cards/altar.png create mode 100644 sw-ui/src/main/resources/images/cards/apothecary.png create mode 100644 sw-ui/src/main/resources/images/cards/aqueduct.png create mode 100644 sw-ui/src/main/resources/images/cards/archeryrange.png create mode 100644 sw-ui/src/main/resources/images/cards/arena.png create mode 100644 sw-ui/src/main/resources/images/cards/arsenal.png create mode 100644 sw-ui/src/main/resources/images/cards/back/age1.png create mode 100644 sw-ui/src/main/resources/images/cards/back/age2.png create mode 100644 sw-ui/src/main/resources/images/cards/back/age3.png create mode 100644 sw-ui/src/main/resources/images/cards/barracks.png create mode 100644 sw-ui/src/main/resources/images/cards/baths.png create mode 100644 sw-ui/src/main/resources/images/cards/bazar.png create mode 100644 sw-ui/src/main/resources/images/cards/brickyard.png create mode 100644 sw-ui/src/main/resources/images/cards/buildersguild.png create mode 100644 sw-ui/src/main/resources/images/cards/caravansery.png create mode 100644 sw-ui/src/main/resources/images/cards/chamberofcommerce.png create mode 100644 sw-ui/src/main/resources/images/cards/circus.png create mode 100644 sw-ui/src/main/resources/images/cards/claypit.png create mode 100644 sw-ui/src/main/resources/images/cards/claypool.png create mode 100644 sw-ui/src/main/resources/images/cards/courthouse.png create mode 100644 sw-ui/src/main/resources/images/cards/craftsmensguild.png create mode 100644 sw-ui/src/main/resources/images/cards/dispensary.png create mode 100644 sw-ui/src/main/resources/images/cards/easttradingpost.png create mode 100644 sw-ui/src/main/resources/images/cards/excavation.png create mode 100644 sw-ui/src/main/resources/images/cards/forestcave.png create mode 100644 sw-ui/src/main/resources/images/cards/fortifications.png create mode 100644 sw-ui/src/main/resources/images/cards/forum.png create mode 100644 sw-ui/src/main/resources/images/cards/foundry.png create mode 100644 sw-ui/src/main/resources/images/cards/gardens.png create mode 100644 sw-ui/src/main/resources/images/cards/glassworks.png create mode 100644 sw-ui/src/main/resources/images/cards/guardtower.png create mode 100644 sw-ui/src/main/resources/images/cards/haven.png create mode 100644 sw-ui/src/main/resources/images/cards/laboratory.png create mode 100644 sw-ui/src/main/resources/images/cards/library.png create mode 100644 sw-ui/src/main/resources/images/cards/lighthouse.png create mode 100644 sw-ui/src/main/resources/images/cards/lodge.png create mode 100644 sw-ui/src/main/resources/images/cards/loom.png create mode 100644 sw-ui/src/main/resources/images/cards/lumberyard.png create mode 100644 sw-ui/src/main/resources/images/cards/magistratesguild.png create mode 100644 sw-ui/src/main/resources/images/cards/marketplace.png create mode 100644 sw-ui/src/main/resources/images/cards/mine.png create mode 100644 sw-ui/src/main/resources/images/cards/observatory.png create mode 100644 sw-ui/src/main/resources/images/cards/orevein.png create mode 100644 sw-ui/src/main/resources/images/cards/palace.png create mode 100644 sw-ui/src/main/resources/images/cards/pantheon.png create mode 100644 sw-ui/src/main/resources/images/cards/pawnshop.png create mode 100644 sw-ui/src/main/resources/images/cards/philosophersguild.png create mode 100644 sw-ui/src/main/resources/images/cards/press.png create mode 100644 sw-ui/src/main/resources/images/cards/quarry.png create mode 100644 sw-ui/src/main/resources/images/cards/sawmill.png create mode 100644 sw-ui/src/main/resources/images/cards/school.png create mode 100644 sw-ui/src/main/resources/images/cards/scientistsguild.png create mode 100644 sw-ui/src/main/resources/images/cards/scriptorium.png create mode 100644 sw-ui/src/main/resources/images/cards/senate.png create mode 100644 sw-ui/src/main/resources/images/cards/shipownersguild.png create mode 100644 sw-ui/src/main/resources/images/cards/siegeworkshop.png create mode 100644 sw-ui/src/main/resources/images/cards/spiesguild.png create mode 100644 sw-ui/src/main/resources/images/cards/stables.png create mode 100644 sw-ui/src/main/resources/images/cards/statue.png create mode 100644 sw-ui/src/main/resources/images/cards/stockade.png create mode 100644 sw-ui/src/main/resources/images/cards/stonepit.png create mode 100644 sw-ui/src/main/resources/images/cards/strategistsguild.png create mode 100644 sw-ui/src/main/resources/images/cards/study.png create mode 100644 sw-ui/src/main/resources/images/cards/tavern.png create mode 100644 sw-ui/src/main/resources/images/cards/temple.png create mode 100644 sw-ui/src/main/resources/images/cards/theater.png create mode 100644 sw-ui/src/main/resources/images/cards/timberyard.png create mode 100644 sw-ui/src/main/resources/images/cards/townhall.png create mode 100644 sw-ui/src/main/resources/images/cards/tradersguild.png create mode 100644 sw-ui/src/main/resources/images/cards/trainingground.png create mode 100644 sw-ui/src/main/resources/images/cards/treefarm.png create mode 100644 sw-ui/src/main/resources/images/cards/university.png create mode 100644 sw-ui/src/main/resources/images/cards/vineyard.png create mode 100644 sw-ui/src/main/resources/images/cards/walls.png create mode 100644 sw-ui/src/main/resources/images/cards/westtradingpost.png create mode 100644 sw-ui/src/main/resources/images/cards/workersguild.png create mode 100644 sw-ui/src/main/resources/images/cards/workshop.png create mode 100644 sw-ui/src/main/resources/images/logo-7-wonders.png create mode 100644 sw-ui/src/main/resources/images/round-table.png create mode 100644 sw-ui/src/main/resources/images/tokens/coin.png create mode 100644 sw-ui/src/main/resources/images/tokens/resources/clay.png create mode 100644 sw-ui/src/main/resources/images/tokens/resources/glass.png create mode 100644 sw-ui/src/main/resources/images/tokens/resources/loom.png create mode 100644 sw-ui/src/main/resources/images/tokens/resources/ore.png create mode 100644 sw-ui/src/main/resources/images/tokens/resources/papyrus.png create mode 100644 sw-ui/src/main/resources/images/tokens/resources/stone.png create mode 100644 sw-ui/src/main/resources/images/tokens/resources/wood.png create mode 100644 sw-ui/src/main/resources/images/wonders/alexandriaA.png create mode 100644 sw-ui/src/main/resources/images/wonders/alexandriaB.png create mode 100644 sw-ui/src/main/resources/images/wonders/babylonA.png create mode 100644 sw-ui/src/main/resources/images/wonders/babylonB.png create mode 100644 sw-ui/src/main/resources/images/wonders/ephesosA.png create mode 100644 sw-ui/src/main/resources/images/wonders/ephesosB.png create mode 100644 sw-ui/src/main/resources/images/wonders/extra/agrigentoA.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/extra/angkorwatA.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/extra/angkorwatB.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/extra/avalonA.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/extra/ctesiphonB.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/extra/iramA.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/extra/persepolisA.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/extra/romaA.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/extra/sangri-laA.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/extra/spahanA.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/extra/the-great-wallA.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/extra/veniseA.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/extra/veniseB.jpg create mode 100644 sw-ui/src/main/resources/images/wonders/gizahA.png create mode 100644 sw-ui/src/main/resources/images/wonders/gizahB.png create mode 100644 sw-ui/src/main/resources/images/wonders/halikarnassusA.png create mode 100644 sw-ui/src/main/resources/images/wonders/halikarnassusB.png create mode 100644 sw-ui/src/main/resources/images/wonders/olympiaA.png create mode 100644 sw-ui/src/main/resources/images/wonders/olympiaB.png create mode 100644 sw-ui/src/main/resources/images/wonders/rhodosA.png create mode 100644 sw-ui/src/main/resources/images/wonders/rhodosB.png create mode 100644 sw-ui/src/main/resources/index.html delete mode 100644 sw-ui/src/react-app-env.d.ts delete mode 100644 sw-ui/src/reducers.ts delete mode 100644 sw-ui/src/redux/actions/all.ts delete mode 100644 sw-ui/src/redux/actions/game.ts delete mode 100644 sw-ui/src/redux/actions/lobby.ts delete mode 100644 sw-ui/src/redux/actions/user.ts delete mode 100644 sw-ui/src/redux/currentGame.ts delete mode 100644 sw-ui/src/redux/games.ts delete mode 100644 sw-ui/src/redux/user.ts delete mode 100644 sw-ui/src/sagas.ts delete mode 100644 sw-ui/src/sagas/errors.ts delete mode 100644 sw-ui/src/sagas/game.ts delete mode 100644 sw-ui/src/sagas/gameBrowser.ts delete mode 100644 sw-ui/src/sagas/home.ts delete mode 100644 sw-ui/src/sagas/lobby.ts delete mode 100644 sw-ui/src/setupProxy.js delete mode 100644 sw-ui/src/store.ts create mode 100644 sw-ui/src/test/kotlin/org/luxons/sevenwonders/ui/redux/sagas/SagasFrameworkTest.kt create mode 100644 sw-ui/src/test/kotlin/org/luxons/sevenwonders/ui/utils/CoroutineUtilsTest.kt (limited to 'sw-ui/src') diff --git a/sw-ui/src/@types/reflexbox.d.ts b/sw-ui/src/@types/reflexbox.d.ts deleted file mode 100644 index 802bc5f3..00000000 --- a/sw-ui/src/@types/reflexbox.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -declare module 'reflexbox' { - - import { HTMLAttributes } from 'react'; - import * as React from 'react' - - export interface BoxProps { - w?: number | string, - h?: number | string, - - flex?: boolean, - wrap?: boolean, - column?: boolean, - auto?: boolean, - order?: number, - align?: "flex-start" | "flex-end" | "center" | "stretch" | "baseline", - justify?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly", - - m?: number | string, - mx?: number | string, - my?: number | string, - mt?: number | string, - mb?: number | string, - ml?: number | string, - mr?: number | string, - - p?: number | string, - px?: number | string, - py?: number | string, - pt?: number | string, - pb?: number | string, - pl?: number | string, - pr?: number | string, - } - - export class Flex extends React.Component { } - export class Box extends React.Component { } -} diff --git a/sw-ui/src/api/model.ts b/sw-ui/src/api/model.ts deleted file mode 100644 index 2796a6d3..00000000 --- a/sw-ui/src/api/model.ts +++ /dev/null @@ -1,187 +0,0 @@ -export type ApiErrorDetail = { - message: string -}; - -export type ApiError = { - message: string, - details: ApiErrorDetail[] -}; - -export type ApiPlayer = { - username: string, - displayName: string, - index: number, - gameOwner: boolean, - user: boolean, -}; - -export type ApiWonderSidePickMethod = "EACH_RANDOM" | "ALL_A" | "ALL_B" | "SAME_RANDOM_FOR_ALL"; - -export type ApiSettings = { - randomSeedForTests: number, - timeLimitInSeconds: number, - wonderSidePickMethod: ApiWonderSidePickMethod, - initialGold: number, - discardedCardGold: number, - defaultTradingCost: number, - pointsPer3Gold: number, - lostPointsPerDefeat: number, - wonPointsPerVictoryPerAge: Map -}; - -export type ApiGameState = "LOBBY" | "PLAYING"; - -export type ApiLobby = { - id: number, - name: string, - owner: string, - players: ApiPlayer[], - settings: ApiSettings, - state: ApiGameState -}; - -export type ApiScience = { - jokers: number, - nbWheels: number, - nbCompasses: number, - nbTablets: number, -} - -export type ApiMilitary = { - nbShields: number, - totalPoints: number, - nbDefeatTokens: number, -} - -export type ApiResourceType = "WOOD" | "STONE" | "ORE" | "CLAY" | "GLASS" | "PAPYRUS" | "LOOM"; - -export type ApiResources = { - quantities: Map, -}; - -export type ApiRequirements = { - gold: number, - resources: ApiResources -} - -export type ApiCardBack = { - image: string, -}; - -export type ApiWonderStage = { - cardBack: ApiCardBack | null, - isBuilt: boolean, - requirements: ApiRequirements, - builtDuringLastMove: boolean, -} - -export type ApiWonderBuildability = { - buildable: boolean -} - -export type ApiWonder = { - name: string, - initialResource: ApiResourceType, - stages: ApiWonderStage[], - image: string, - nbBuiltStages: number, - buildability: ApiWonderBuildability, -} - -export type Color = 'BLUE' | 'GREEN' | 'RED' | 'BROWN' | 'GREY' | 'PURPLE' | 'YELLOW'; - -export type ApiProvider = "LEFT_NEIGHBOUR" | "RIGHT_NEIGHBOUR"; - -export type ApiCountedResource = { - type: ApiResourceType, - count: number, -} - -export type ApiProduction = { - fixedResources: ApiCountedResource[], - alternativeResources: ApiResourceType[][], -} - -export type ApiBoughtResources = { - provider: ApiProvider, - resources: ApiResources, -}; - -export type ApiCard = { - name: string, - color: Color, - requirements: ApiRequirements, - chainParent: String | null, - chainChildren: String[], - image: string, - back: ApiCardBack -}; - -export type ApiTableCard = ApiCard & { - playedDuringLastMove: boolean, -}; - -export type ApiBoard = { - playerIndex: number, - wonder: ApiWonder, - production: ApiProduction, - publicProduction: ApiProduction, - science: ApiScience, - military: ApiMilitary, - playedCards: ApiTableCard[][], - gold: number, -}; - -export type HandRotationDirection = 'LEFT' | 'RIGHT'; - -export type ApiMoveType = "PLAY" | "PLAY_FREE" | "UPGRADE_WONDER" | "DISCARD" | "COPY_GUILD"; - -export type ApiPlayedMove = { - playerIndex: number, - type: ApiMoveType, - card: ApiTableCard, - boughtResources: ApiBoughtResources[], -}; - -export type ApiTable = { - boards: ApiBoard[], - currentAge: number, - handRotationDirection: HandRotationDirection, - lastPlayedMoves: ApiPlayedMove[], - nbPlayers: number, -}; - -export type ApiAction = 'PLAY' | 'PLAY_2' | 'PLAY_LAST' | 'PICK_NEIGHBOR_GUILD' | 'WAIT'; - -export type ApiPlayability = { - playable: boolean, - chainable: boolean, - minPrice: number, -}; - -export type ApiHandCard = ApiCard & { - playability: ApiPlayability, -}; - -export type ApiPreparedCard = { - player: ApiPlayer, - cardBack: ApiCardBack, -}; - -export type ApiPlayerTurnInfo = { - playerIndex: number, - table: ApiTable, - currentAge: number, - action: ApiAction, - hand: ApiHandCard[], - playedMove: ApiPlayedMove | null, - neighbourGuildCards: ApiTableCard[], - message: string, - wonderBuildability: ApiWonderBuildability, -}; - -export type ApiPlayerMove = { - type: ApiMoveType, - cardName: string, - boughtResources: ApiBoughtResources[], -}; diff --git a/sw-ui/src/api/sevenWondersApi.ts b/sw-ui/src/api/sevenWondersApi.ts deleted file mode 100644 index 4f76a677..00000000 --- a/sw-ui/src/api/sevenWondersApi.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { - ApiError, - ApiLobby, - ApiPlayer, - ApiPlayerMove, - ApiPlayerTurnInfo, - ApiPreparedCard, - ApiSettings, - ApiTable, -} from './model'; -import { JsonStompClient, SubscribeFn } from './websocket'; -import { createJsonStompClient } from './websocket'; - -const WS_URL = '/seven-wonders-websocket'; - -export class SevenWondersSession { - client: JsonStompClient; - - constructor(client: JsonStompClient) { - this.client = client; - } - - watchErrors(): SubscribeFn { - return this.client.subscriber('/user/queue/errors'); - } - - watchNameChoice(): SubscribeFn { - return this.client.subscriber('/user/queue/nameChoice'); - } - - chooseName(displayName: string): void { - this.client.send('/app/chooseName', { playerName: displayName }); - } - - watchGames(): SubscribeFn { - return this.client.subscriber('/topic/games'); - } - - watchLobbyJoined(): SubscribeFn { - return this.client.subscriber('/user/queue/lobby/joined'); - } - - createGame(gameName: string): void { - this.client.send('/app/lobby/create', { gameName }); - } - - joinGame(gameId: number): void { - this.client.send('/app/lobby/join', { gameId }); - } - - watchLobbyUpdated(currentGameId: number): SubscribeFn { - return this.client.subscriber(`/topic/lobby/${currentGameId}/updated`); - } - - watchGameStarted(currentGameId: number): SubscribeFn { - return this.client.subscriber(`/topic/lobby/${currentGameId}/started`); - } - - leave(): void { - this.client.send('/app/lobby/leave'); - } - - reorderPlayers(orderedPlayers: Array): void { - this.client.send('/app/lobby/reorderPlayers', { orderedPlayers }); - } - - updateSettings(settings: ApiSettings): void { - this.client.send('/app/lobby/updateSettings', { settings }); - } - - startGame(): void { - this.client.send('/app/lobby/startGame'); - } - - watchPlayerReady(currentGameId: number): SubscribeFn { - return this.client.subscriber(`/topic/game/${currentGameId}/playerReady`); - } - - watchTableUpdates(currentGameId: number): SubscribeFn { - return this.client.subscriber(`/topic/game/${currentGameId}/tableUpdates`); - } - - watchPreparedCards(currentGameId: number): SubscribeFn { - return this.client.subscriber(`/topic/game/${currentGameId}/prepared`); - } - - watchTurnInfo(): SubscribeFn { - return this.client.subscriber('/user/queue/game/turn'); - } - - sayReady(): void { - this.client.send('/app/game/sayReady'); - } - - prepareMove(move: ApiPlayerMove): void { - this.client.send('/app/game/prepareMove', { move }); - } -} - -export async function connectToGame(): Promise { - const jsonStompClient: JsonStompClient = createJsonStompClient(WS_URL); - await jsonStompClient.connect(); - return new SevenWondersSession(jsonStompClient); -} diff --git a/sw-ui/src/api/websocket.ts b/sw-ui/src/api/websocket.ts deleted file mode 100644 index e9393836..00000000 --- a/sw-ui/src/api/websocket.ts +++ /dev/null @@ -1,60 +0,0 @@ -import SockJS from 'sockjs-client'; -import { Client, Frame, Message, Options, Subscription } from 'webstomp-client'; -import * as Stomp from 'webstomp-client'; - -const DEFAULT_DEBUG_OPTIONS = { - debug: process.env.NODE_ENV !== 'production', -}; - -export type Callback = (value: T) => void; -export type UnsubscribeFn = () => void; -export type SubscribeFn = (callback: Callback) => UnsubscribeFn; - -export class JsonStompClient { - client: Client; - - constructor(client: Client) { - this.client = client; - } - - connect(headers: Stomp.ConnectionHeaders = {}): Promise { - return new Promise((resolve, reject) => { - this.client.connect(headers, resolve, reject); - }); - } - - subscribe(path: string, callback: Callback): UnsubscribeFn { - const socketSubscription: Subscription = this.client.subscribe(path, (message: Message) => { - // not all frames have a JSON body - const value: T | void = message && JsonStompClient.parseBody(message); - callback(value || {} as T); - }); - return () => socketSubscription.unsubscribe(); - } - - static parseBody(message: Message): T | void { - try { - return message.body ? JSON.parse(message.body) : undefined; - } catch (jsonParseError) { - throw new Error('Cannot parse websocket message as JSON: ' + jsonParseError.message); - } - } - - subscriber(path: string): SubscribeFn { - return (callback: Callback) => this.subscribe(path, callback); - } - - send(url: string, body?: Object) { - const strBody = body ? JSON.stringify(body) : ''; - this.client.send(url, strBody); - } -} - -function createStompClient(url: string, options: Options = {}): Client { - const optionsWithDebug = Object.assign({}, DEFAULT_DEBUG_OPTIONS, options); - return Stomp.over(new SockJS(url), optionsWithDebug); -} - -export function createJsonStompClient(url: string, options: Options = {}): JsonStompClient { - return new JsonStompClient(createStompClient(url, options)); -} diff --git a/sw-ui/src/components/Application.tsx b/sw-ui/src/components/Application.tsx deleted file mode 100644 index e0ec604d..00000000 --- a/sw-ui/src/components/Application.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import { Redirect, Route, Switch } from 'react-router-dom'; -import { GameBrowser } from './game-browser/GameBrowser'; -import { GameScene } from './game/GameScene'; -import { Lobby } from './lobby/Lobby'; -import { Home } from './home/Home'; - -export const Application = () => ( - - - - - - - -); diff --git a/sw-ui/src/components/game-browser/GameBrowser.tsx b/sw-ui/src/components/game-browser/GameBrowser.tsx deleted file mode 100644 index a6367d5e..00000000 --- a/sw-ui/src/components/game-browser/GameBrowser.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { Button, Classes, InputGroup, Intent } from '@blueprintjs/core'; -import React, { ChangeEvent, Component, SyntheticEvent } from 'react'; -import { connect } from 'react-redux'; -import { Flex } from 'reflexbox'; -import { actions } from '../../redux/actions/lobby'; -import { GameList } from './GameList'; -import { PlayerInfo } from './PlayerInfo'; - -type GameBrowserProps = { - createGame: (gameName: string) => void, -} - -class GameBrowserPresenter extends Component { - - _gameName: string | void = undefined; - - createGame = (e: SyntheticEvent): void => { - e.preventDefault(); - if (this._gameName !== undefined) { - this.props.createGame(this._gameName); - } - }; - - render() { - return ( - - - - ) => (this._gameName = e.target.value)} - rightElement={} - /> - - - - - - ); - } -} - -type CreateGameButtonProps = { - createGame: (e: SyntheticEvent) => void -} - -const CreateGameButton = ({createGame}: CreateGameButtonProps) => ( - -); - -const mapDispatchToProps = { - createGame: actions.requestCreateGame, -}; - -export const GameBrowser = connect(null, mapDispatchToProps)(GameBrowserPresenter); diff --git a/sw-ui/src/components/game-browser/GameList.css b/sw-ui/src/components/game-browser/GameList.css deleted file mode 100644 index a04e126c..00000000 --- a/sw-ui/src/components/game-browser/GameList.css +++ /dev/null @@ -1,3 +0,0 @@ -tr.gameListRow td { - vertical-align: middle; -} diff --git a/sw-ui/src/components/game-browser/GameList.tsx b/sw-ui/src/components/game-browser/GameList.tsx deleted file mode 100644 index 1b136940..00000000 --- a/sw-ui/src/components/game-browser/GameList.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { Button, Classes } from '@blueprintjs/core' -import { List } from 'immutable'; -import React from 'react'; -import { connect } from 'react-redux'; -import { ApiLobby } from '../../api/model'; -import { GlobalState } from '../../reducers'; -import { actions } from '../../redux/actions/lobby'; -import { getAllGames } from '../../redux/games'; -import './GameList.css'; -import { GameStatus } from './GameStatus'; -import { PlayerCount } from './PlayerCount'; - -type GameListStateProps = { - games: List, -}; - -type GameListDispatchProps = { - joinGame: (gameId: number) => void, -}; - -type GameListProps = GameListStateProps & GameListDispatchProps - -const GameListPresenter = ({ games, joinGame }: GameListProps) => ( - - - - - - {games.map((game: ApiLobby) => )} - - -); - -const GameListHeaderRow = () => ( - - Name - Status - Nb Players - Join - -); - -type GameListItemRowProps = { - game: ApiLobby, - joinGame: (gameId: number) => void, -}; - -const GameListItemRow = ({game, joinGame}: GameListItemRowProps) => ( - - {game.name} - - - - - - - - - - -); - -type JoinButtonProps = { - game: ApiLobby, - joinGame: (gameId: number) => void, -}; - -const JoinButton = ({game, joinGame}: JoinButtonProps) => { - const disabled = game.state !== 'LOBBY'; - const onClick = () => joinGame(game.id); - return ; -}; - -function mapStateToProps(state: GlobalState): GameListStateProps { - return { - games: getAllGames(state), - }; -} - -const mapDispatchToProps: GameListDispatchProps = { - joinGame: actions.requestJoinGame, -}; - -export const GameList = connect(mapStateToProps, mapDispatchToProps)(GameListPresenter); - diff --git a/sw-ui/src/components/game-browser/GameStatus.tsx b/sw-ui/src/components/game-browser/GameStatus.tsx deleted file mode 100644 index 5f237258..00000000 --- a/sw-ui/src/components/game-browser/GameStatus.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { Tag } from '@blueprintjs/core'; -import { Intent } from '@blueprintjs/core'; -import * as React from 'react'; -import { ApiGameState } from '../../api/model'; - -type GameStatusProps = { - state: ApiGameState, -} - -export const GameStatus = ({state}: GameStatusProps) => ( - {state} -); - -const statusIntents = { - 'LOBBY': Intent.SUCCESS, - 'PLAYING': Intent.WARNING, -}; diff --git a/sw-ui/src/components/game-browser/PlayerCount.css b/sw-ui/src/components/game-browser/PlayerCount.css deleted file mode 100644 index d2f18e50..00000000 --- a/sw-ui/src/components/game-browser/PlayerCount.css +++ /dev/null @@ -1,3 +0,0 @@ -.playerCountIcon, .playerCount { - vertical-align: middle; -} diff --git a/sw-ui/src/components/game-browser/PlayerCount.tsx b/sw-ui/src/components/game-browser/PlayerCount.tsx deleted file mode 100644 index 64028f68..00000000 --- a/sw-ui/src/components/game-browser/PlayerCount.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { Icon } from '@blueprintjs/core'; -import * as React from 'react'; -import './PlayerCount.css'; - -type PlayerCountProps = { - nbPlayers: number, -} - -export const PlayerCount = ({nbPlayers}: PlayerCountProps) => - - {nbPlayers} -; diff --git a/sw-ui/src/components/game-browser/PlayerInfo.tsx b/sw-ui/src/components/game-browser/PlayerInfo.tsx deleted file mode 100644 index 4afed671..00000000 --- a/sw-ui/src/components/game-browser/PlayerInfo.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { Text } from '@blueprintjs/core'; -import React from 'react'; -import { connect } from 'react-redux'; -import { GlobalState } from '../../reducers'; -import { User } from '../../redux/user'; -import { getCurrentUser } from '../../redux/user'; - -type PlayerInfoProps = { - user: User | null, -} - -const PlayerInfoPresenter = ({user}: PlayerInfoProps) => ( - - Username: - {' '} - {user && user.displayName} - -); - -const mapStateToProps = (state: GlobalState): PlayerInfoProps => ({ - user: getCurrentUser(state), -}); - -const mapDispatchToProps = { -}; - -export const PlayerInfo = connect(mapStateToProps, mapDispatchToProps)(PlayerInfoPresenter); diff --git a/sw-ui/src/components/game/Board.css b/sw-ui/src/components/game/Board.css deleted file mode 100644 index 0600bd14..00000000 --- a/sw-ui/src/components/game/Board.css +++ /dev/null @@ -1,38 +0,0 @@ -.board { - width: 100vw -} - -.cards { - display: flex; - height: 40vh; - width: 100vw; -} - -.card-column { - height: 40vh; - margin: auto; - position: relative; - width: 15vw; -} - -.card { - position: absolute; - /* dynamic positioning in JS */ -} - -.table-card-img { - max-width: 10vw; - max-height: 25vh; -} - -.wonder { - width: 100vw; - text-align: center; -} - -.wonder-img { - border-radius: 0.5%/1.5%; - box-shadow: 0.2rem 0.2rem 0.5rem black; - max-height: 30vh; - max-width: 95vw; -} diff --git a/sw-ui/src/components/game/Board.tsx b/sw-ui/src/components/game/Board.tsx deleted file mode 100644 index 98298a1f..00000000 --- a/sw-ui/src/components/game/Board.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import React from 'react'; -import { ApiBoard, ApiTableCard, ApiWonder } from '../../api/model'; -import './Board.css' -import { CardImage } from './CardImage'; - -// card offsets in % of their size when displayed in columns -const xOffset = 20; -const yOffset = 21; - -type BoardProps = { - board: ApiBoard, -} - -export const Board = ({board}: BoardProps) => { - return - - - ; -}; - -type TableCardsProps = { - cardColumns: ApiTableCard[][], -} - -const TableCards = ({cardColumns}: TableCardsProps) => { - return - {cardColumns.map(column => )} - -}; - -type TableCardColumnProps = { - cards: ApiTableCard[] -} - -const TableCardColumn = ({cards}: TableCardColumnProps) => { - return - {cards.map((c, i) => )} - -}; - -type TableCardProps = { - card: ApiTableCard, - indexInColumn: number, -} - -const TableCard = ({card, indexInColumn}: TableCardProps) => { - let style = { - transform: `translate(${indexInColumn * xOffset}%, ${indexInColumn * yOffset}%)`, - zIndex: indexInColumn, - }; - return - - -}; - -type WonderProps = { - wonder: ApiWonder, -} - -const Wonder = ({wonder}: WonderProps) => { - return - - -}; diff --git a/sw-ui/src/components/game/CardImage.css b/sw-ui/src/components/game/CardImage.css deleted file mode 100644 index 795c1503..00000000 --- a/sw-ui/src/components/game/CardImage.css +++ /dev/null @@ -1,4 +0,0 @@ -.card-img { - border-radius: 5%; - box-shadow: 2px 2px 5px black; -} diff --git a/sw-ui/src/components/game/CardImage.tsx b/sw-ui/src/components/game/CardImage.tsx deleted file mode 100644 index a37595ad..00000000 --- a/sw-ui/src/components/game/CardImage.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import { ApiCard } from '../../api/model'; -import './CardImage.css' - -type CardImageProps = { - card: ApiCard, - otherClasses: string, - highlightColor?: string -} - -export const CardImage = ({card, otherClasses, highlightColor}: CardImageProps) => { - const style = highlightStyle(highlightColor); - return -}; - -function highlightStyle(highlightColor?: string) { - if (highlightColor) { - return { boxShadow: `0 0 1rem 0.1rem ${highlightColor}` }; - } else { - return {}; - } -} diff --git a/sw-ui/src/components/game/GameScene.css b/sw-ui/src/components/game/GameScene.css deleted file mode 100644 index 3417459b..00000000 --- a/sw-ui/src/components/game/GameScene.css +++ /dev/null @@ -1,13 +0,0 @@ -.gameSceneRoot { - background: url('background-papyrus.jpg') center no-repeat; - background-size: cover; -} - -.fullscreen { - position: fixed; - top: 0; - left: 0; - bottom: 0; - right: 0; - overflow: hidden; -} diff --git a/sw-ui/src/components/game/GameScene.tsx b/sw-ui/src/components/game/GameScene.tsx deleted file mode 100644 index 465d0840..00000000 --- a/sw-ui/src/components/game/GameScene.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { Button, Classes, Intent, NonIdealState } from '@blueprintjs/core'; -import { List } from 'immutable'; -import React, { Component } from 'react'; -import { connect } from 'react-redux'; -import { ApiPlayer, ApiPlayerMove, ApiPlayerTurnInfo } from '../../api/model'; -import { GlobalState } from '../../reducers'; -import { actions } from '../../redux/actions/game'; -import { getCurrentTurnInfo } from '../../redux/currentGame'; -import { getCurrentGame } from '../../redux/games'; -import { Board } from './Board'; -import './GameScene.css' -import { Hand } from './Hand'; -import { ProductionBar } from './ProductionBar'; - -type GameSceneStateProps = { - players: List, - turnInfo: ApiPlayerTurnInfo | null, -} - -type GameSceneDispatchProps = { - sayReady: () => void, - prepareMove: (move: ApiPlayerMove) => void, -} - -type GameSceneProps = GameSceneStateProps & GameSceneDispatchProps - -class GameScenePresenter extends Component { - - render() { - return ( - - {!this.props.turnInfo && } - {this.props.turnInfo && this.turnInfoScene(this.props.turnInfo)} - - ); - } - - turnInfoScene(turnInfo: ApiPlayerTurnInfo) { - let board = turnInfo.table.boards[turnInfo.playerIndex]; - return - {turnInfo.message} - - - - - } -} - -type GamePreStartProps = { - onReadyClicked: () => void -} -const GamePreStart = ({onReadyClicked}: GamePreStartProps) => Click "ready" when you are
{turnInfo.message}