Skip to content

Commit

Permalink
Revert "initial. board is grid. pieces can move forward."
Browse files Browse the repository at this point in the history
This reverts commit 494d2b8.
  • Loading branch information
nbogie committed Sep 8, 2023
1 parent 494d2b8 commit 6b8c65c
Show file tree
Hide file tree
Showing 12 changed files with 3 additions and 346 deletions.
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
"check-all": "yarn type-check && yarn lint && yarn format && yarn test"
},
"dependencies": {
"clsx": "^2.0.0",
"immer": "^10.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"use-immer": "^0.9.0"
"react-dom": "^18.2.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.4",
Expand Down
81 changes: 0 additions & 81 deletions src/GameState.tsx

This file was deleted.

33 changes: 0 additions & 33 deletions src/Player.ts

This file was deleted.

62 changes: 0 additions & 62 deletions src/components/App.css
Original file line number Diff line number Diff line change
@@ -1,65 +1,3 @@
html {
background: #f8f8f8;
font-size: 30px;
}

.diveRoute {
display: flex;
flex-direction: row;
gap: 0.5rem;
flex-wrap: wrap;
}

.diveRoutePiece {
background: lightblue;
padding: 0.5rem;
aspect-ratio: 1;
display: grid;
place-items: center;
width: 100px;
}

.diveRoutePiece.blank {
border-radius: 50%;
}

.diveRoutePiece.pentagon {
clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}
.diveRoutePiece.hexagon {
clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
}
.diveRoutePiece.triangle {
clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.player {
border-radius: 50%;
aspect-ratio: 1;
width: 1.5rem;
display: grid;
place-items: center;
}

.player.p1 {
background: lime;
}
.player.p2 {
background: tomato;
}
.player.p3 {
background: yellow;
}
.player.p4 {
background: purple;
}
.player.p5 {
background: black;
}
.player.p6 {
background: white;
}

button {
font-size: 2rem;
}
52 changes: 2 additions & 50 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,58 +1,10 @@
import clsx from "clsx";
import { useImmerReducer } from "use-immer";
import { MyComponent } from "./MyComponent";
import "./App.css";
import { DiveRoutePieceView } from "./DiveRoutePieceView";
import { createInitialState } from "../GameState";
import { PlayerSummary } from "./PlayerSummary";
import { reducerFunction } from "../reducer/reducerFunction";
import { Player } from "../Player";

function App() {
const initialState = createInitialState(3);
const [gs, dispatch] = useImmerReducer(reducerFunction, initialState);
return (
<div className="App">
<button onClick={() => dispatch({ tag: "roll-to-swim" })}>
Roll
</button>
Pieces:{" "}
<div className="diveRoute">
{gs.diveRoute.map((p, slotIx) => {
const playersAtSlot: Player[] = gs.players.filter(
(p) => p.position === slotIx
);

return (
<DiveRoutePieceView key={p.id} piece={p}>
{playersAtSlot.map((player) => (
<div
className={clsx("player", "p" + player.num)}
key={player.id}
>
{player.num}
</div>
))}
</DiveRoutePieceView>
);
})}
</div>
Remaining Air: {gs.remainingAir}
<br />
Last Roll:{" "}
{gs.lastRoll ? (
<>
<span>{gs.lastRoll.sum}</span>{" "}
<span>( {gs.lastRoll.faces.join(", ")} ) </span>
</>
) : (
"none"
)}
<br />
Players:{" "}
{gs.players.map((p) => (
<PlayerSummary key={p.id} player={p} />
))}
<button onClick={() => dispatch({ tag: "no-op" })}>One</button>
<MyComponent />
</div>
);
}
Expand Down
24 changes: 0 additions & 24 deletions src/components/DiveRoutePieceView.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions src/components/PlayerSummary.tsx

This file was deleted.

Empty file removed src/gameCore
Empty file.
7 changes: 0 additions & 7 deletions src/reducer/Action.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions src/reducer/doRollToSwim.tsx

This file was deleted.

31 changes: 0 additions & 31 deletions src/reducer/reducerFunction.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2048,11 +2048,6 @@ ci-info@^3.2.0:
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91"
integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==

clsx@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.0.0.tgz#12658f3fd98fafe62075595a5c30e43d18f3d00b"
integrity sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==

color-convert@^1.9.0:
version "1.9.3"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
Expand Down Expand Up @@ -3014,11 +3009,6 @@ ignore@^5.2.0:
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"
integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==

immer@^10.0.2:
version "10.0.2"
resolved "https://registry.yarnpkg.com/immer/-/immer-10.0.2.tgz#11636c5b77acf529e059582d76faf338beb56141"
integrity sha512-Rx3CqeqQ19sxUtYV9CU911Vhy8/721wRFnJv3REVGWUmoAcIwzifTsdmJte/MV+0/XpM35LZdQMBGkRIoLPwQA==

import-fresh@^3.0.0, import-fresh@^3.2.1:
version "3.3.0"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b"
Expand Down Expand Up @@ -4434,11 +4424,6 @@ url-parse@^1.5.3:
querystringify "^2.1.1"
requires-port "^1.0.0"

use-immer@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/use-immer/-/use-immer-0.9.0.tgz#66e4e8f7ab75df45e96dfd5c56337f9fd49db9fd"
integrity sha512-/L+enLi0nvuZ6j4WlyK0US9/ECUtV5v9RUbtxnn5+WbtaXYUaOBoKHDNL9I5AETdurQ4rIFIj/s+Z5X80ATyKw==

vite-node@0.32.0:
version "0.32.0"
resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.32.0.tgz#8ee54539fa75d1271adaa9788c8ba526480f4519"
Expand Down

0 comments on commit 6b8c65c

Please sign in to comment.