Compare commits
12 Commits
ui-backtra
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e24bd0d6c | ||
| e82d12b10e | |||
| 71fec57a94 | |||
| 6ac83ef008 | |||
| c887e5ad74 | |||
| 5a7830340a | |||
| 7505c3316d | |||
| cd187bf595 | |||
| 8be8933446 | |||
|
|
a9a6b83500 | ||
|
|
25f2bb5837 | ||
| 38dd1519fa |
@@ -1,21 +1,29 @@
|
|||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
import { CardProps } from '../../util/propTypes';
|
import { CardProps } from '../../util/propTypes';
|
||||||
import { ResourceCost } from '../../util/types';
|
import { CardData, PlayerCards, ResourceCost } from '../../util/types';
|
||||||
import { useCurrentPlayer } from '../../hooks/useCurrentPlayer';
|
import { useCurrentPlayer } from '../../hooks/useCurrentPlayer';
|
||||||
import { buyCardActions } from '../Player/ActionMethods';
|
import { buyCardActions } from '../Player/ActionMethods';
|
||||||
import { hasMaxReserved, reserveCard } from '../Player/ActionMethods/reserveCardActions';
|
import { hasMaxReserved, reserveCard } from '../Player/ActionMethods/reserveCardActions';
|
||||||
const { buyCard, tooExpensive } = buyCardActions;
|
const { buyCard, tooExpensive } = buyCardActions;
|
||||||
|
|
||||||
export default function Card({ data, state, setState }: CardProps) {
|
export default function Card({ data, state, setState, reserved = false, collapsed = false }: CardProps) {
|
||||||
const currentPlayer = useCurrentPlayer(state);
|
const currentPlayer = useCurrentPlayer(state);
|
||||||
|
if (!data || !currentPlayer) return <div className="card"></div>;
|
||||||
|
|
||||||
if (!data) return <div className="card"></div>;
|
const purchaseDisabled = (): boolean => {
|
||||||
|
// TO DO: check whether a card belongs to the current player,
|
||||||
|
// if card is tagged as reserved
|
||||||
|
return tooExpensive(data, state);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card" key={v4()}>
|
<div className='card' key={v4()}>
|
||||||
<p>Counts as: {data.gemValue}</p>
|
{ /*
|
||||||
<p>Point value: {data.points || 0}</p>
|
{ collapsed ? <div className={`img-placeholder-${data.gemValue}`}></div> : <img src={data.image} loading="lazy" /> }
|
||||||
<p>Cost:</p>
|
*/ }
|
||||||
|
<div className={reserved ? `foreground-${data.gemValue}` : 'foreground'}>
|
||||||
|
<section className="card-top-section">
|
||||||
|
<p>{data.gemValue.toUpperCase()}</p>
|
||||||
<div className="total-card-cost">
|
<div className="total-card-cost">
|
||||||
{
|
{
|
||||||
Object.keys(data.resourceCost).map((key: keyof ResourceCost | string) => {
|
Object.keys(data.resourceCost).map((key: keyof ResourceCost | string) => {
|
||||||
@@ -28,20 +36,30 @@ export default function Card({ data, state, setState }: CardProps) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
{ (data.points && data.points > 0) ? <p>{data.points} {data.points === 1 ? 'point' : 'points'}</p> : null }
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{
|
||||||
|
(state.actions.buyCard.active || state.actions.reserveCard.active) && (
|
||||||
|
<section className="card-action-section">
|
||||||
{ state.actions.buyCard.active &&
|
{ state.actions.buyCard.active &&
|
||||||
<button
|
<button
|
||||||
onClick={() => buyCard(state, setState, data)}
|
onClick={() => buyCard(state, setState, data)}
|
||||||
disabled={tooExpensive(data, state)}>
|
disabled={purchaseDisabled()}>
|
||||||
Buy This Card
|
Buy This Card
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
{ state.actions.reserveCard.active &&
|
{ !reserved && state.actions.reserveCard.active &&
|
||||||
<button
|
<button
|
||||||
onClick={() => reserveCard(state, setState, data)}
|
onClick={() => reserveCard(state, setState, data)}
|
||||||
disabled={hasMaxReserved(currentPlayer)}>
|
disabled={hasMaxReserved(currentPlayer)}>
|
||||||
Reserve This Card
|
Reserve This Card
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1,33 +1,77 @@
|
|||||||
@import "../../sass/helper/mixins";
|
@import "../../sass/helper/mixins";
|
||||||
@import "../../sass/helper/placeholders";
|
@import "../../sass/helper/variables";
|
||||||
|
|
||||||
.card-row {
|
.card-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
margin: 2rem;
|
margin: 1rem 0;
|
||||||
width: 80vw;
|
width: 75vw;
|
||||||
|
|
||||||
|
.card-row-top-bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
> * {
|
||||||
|
margin: 8px 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.card-row-cards-visible {
|
.card-row-cards-visible {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row nowrap;
|
flex-flow: row wrap;
|
||||||
|
justify-content: right;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
justify-content: space-around;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
width: 25%;
|
width: 18%;
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.foreground {
|
||||||
|
// position: relative;
|
||||||
|
// top: -100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 6;
|
||||||
|
|
||||||
> * {
|
> * {
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
|
padding: 6px;
|
||||||
|
border-radius: 12px;
|
||||||
|
background-color: rgb(39, 36, 36);
|
||||||
}
|
}
|
||||||
|
|
||||||
.total-card-cost {
|
.total-card-cost {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-flow: row wrap;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
@include map-gem-values(".card-cost");
|
@include map-gem-values(".card-cost");
|
||||||
p {
|
}
|
||||||
@extend %chip-design;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-count {
|
||||||
|
background-color: black;
|
||||||
|
color: white;
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cc-tier {
|
||||||
|
&-1 {
|
||||||
|
background-color: rgb(3, 30, 3);
|
||||||
|
}
|
||||||
|
&-2 {
|
||||||
|
background-color: rgb(80, 80, 7);
|
||||||
|
}
|
||||||
|
&-3 {
|
||||||
|
background-color: rgb(9, 9, 77);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -35,12 +79,11 @@
|
|||||||
|
|
||||||
|
|
||||||
.tier-1 {
|
.tier-1 {
|
||||||
background-color: rgb(9, 67, 9);
|
background-color: rgb(23, 73, 23);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tier-2 {
|
.tier-2 {
|
||||||
background-color: rgb(174, 174, 32);
|
background-color: rgb(174, 174, 32);
|
||||||
color: black;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tier-3 {
|
.tier-3 {
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import { v4 } from 'uuid';
|
||||||
|
import cardTierToKey from '../../util/mechanics/cardTierToKey';
|
||||||
import { CardRowProps } from '../../util/propTypes';
|
import { CardRowProps } from '../../util/propTypes';
|
||||||
import { CardData } from "../../util/types"
|
import { CardData } from "../../util/types"
|
||||||
import Card from "../Card/Card"
|
import Card from "../Card/Card"
|
||||||
import { v4 } from 'uuid';
|
|
||||||
import cardTierToKey from '../../util/cardTierToKey';
|
|
||||||
import "./CardRow.scss";
|
import "./CardRow.scss";
|
||||||
|
|
||||||
export default function CardRow({tier, state, setState}: CardRowProps) {
|
export default function CardRow({tier, state, setState, liftCollapsed}: CardRowProps) {
|
||||||
|
const [collapsed, setCollapsed] = useState(true);
|
||||||
const typedTier = cardTierToKey(tier);
|
const typedTier = cardTierToKey(tier);
|
||||||
|
|
||||||
let cards: Array<CardData>
|
let cards: Array<CardData>
|
||||||
@@ -24,15 +26,22 @@ export default function CardRow({tier, state, setState}: CardRowProps) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
liftCollapsed(collapsed, tier);
|
||||||
|
}, [collapsed])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`card-row tier-${tier}`}>
|
<div className={`card-row tier-${tier} ${collapsed && 'collapsed'}`}>
|
||||||
|
<div className="card-row-top-bar">
|
||||||
<p>Tier: {tier}</p>
|
<p>Tier: {tier}</p>
|
||||||
<div className="card-row-cards-visible">
|
<button onClick={() => setCollapsed(!collapsed)}>{collapsed ? "Show" : "Hide"}</button>
|
||||||
<div className="card card-count">
|
</div>
|
||||||
|
<div className={`card-row-cards-visible ${collapsed && 'hidden'}`}>
|
||||||
|
<div className={`card-count cc-tier-${tier}`}>
|
||||||
<p>Remaining: {state.gameboard.deck[typedTier].length}</p>
|
<p>Remaining: {state.gameboard.deck[typedTier].length}</p>
|
||||||
</div>
|
</div>
|
||||||
{ cards && cards.map((cardData: CardData) => {
|
{ cards && cards.map((cardData: CardData) => {
|
||||||
return <Card key={v4()} data={cardData} state={state} setState={setState} />
|
return <Card key={v4()} data={cardData} state={state} setState={setState} collapsed={collapsed} />
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
.gameboard {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column nowrap;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
background-color: rgb(57, 57, 65);
|
||||||
|
width: 90vw;
|
||||||
|
padding: 0 18px 12px;
|
||||||
|
|
||||||
|
#round-marker {
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gameboard-columns {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row nowrap;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
section {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gameboard-left {
|
||||||
|
align-items: flex-start;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gameboard-right {
|
||||||
|
justify-content: flex-end;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gameboard-left-expanded {
|
||||||
|
align-items: flex-start;
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gameboard-right-compact {
|
||||||
|
justify-content: flex-end;
|
||||||
|
width: 10%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,51 +1,59 @@
|
|||||||
// types, data, utils
|
// types, data, utils
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import initializeBoard, { setCardRows } from '../../util/initializeBoard';
|
import initializeBoard, { setCardRows } from '../../util/setup/initializeBoard';
|
||||||
import { AppState, PlayerData, ResourceCost } from '../../util/types';
|
import { AppState, PlayerData, ResourceCost, UIState } from '../../util/types';
|
||||||
import { getChipsActions } from '../Player/ActionMethods';
|
import { defaultUIState } from '../../util/setup/defaultUIState';
|
||||||
import { StateProps } from '../../util/propTypes';
|
import { StateProps } from '../../util/propTypes';
|
||||||
import './Gameboard.scss';
|
import './Gameboard.scss';
|
||||||
|
|
||||||
// components
|
// components
|
||||||
import Nobles from '../Nobles/Nobles';
|
import Nobles from '../Nobles/Nobles';
|
||||||
import AvailableChips from '../Resources/AvailableChips';
|
|
||||||
import AllPlayers from '../Player/AllPlayers';
|
import AllPlayers from '../Player/AllPlayers';
|
||||||
import CardRow from '../Card/CardRow';
|
import CardRow from '../Card/CardRow';
|
||||||
import SelectionView from '../Resources/SelectionView';
|
|
||||||
import { useCurrentPlayer } from '../../hooks/useCurrentPlayer';
|
import { useCurrentPlayer } from '../../hooks/useCurrentPlayer';
|
||||||
import usePreviousPlayer from '../../hooks/usePreviousPlayer';
|
import usePreviousPlayer from '../../hooks/usePreviousPlayer';
|
||||||
const { validateChips } = getChipsActions;
|
import { shouldRightSideCollapse } from '../../util/mechanics/shouldRightSideCollapse';
|
||||||
|
import { setStateUpdateSelection } from '../../hooks/stateSetters';
|
||||||
|
|
||||||
export default function Gameboard({ state, setState }: StateProps) {
|
export default function Gameboard({ state, setState }: StateProps) {
|
||||||
const [view, setView] = useState(<p>Loading...</p>);
|
const [view, setView] = useState(<p>Loading...</p>);
|
||||||
const [endgame, setEndgame] = useState<PlayerData>();
|
const [endgame, setEndgame] = useState<PlayerData>();
|
||||||
|
const [UICollapse, setUICollapse] = useState<UIState>(defaultUIState);
|
||||||
|
|
||||||
// callbacks for lifting state
|
// callbacks for lifting state
|
||||||
const liftSelection = useCallback((value: keyof ResourceCost) => {
|
const liftSelection = useCallback((value: keyof ResourceCost) => {
|
||||||
if (!state.actions.getChips.active) return;
|
if (!state.actions.getChips.active) return;
|
||||||
setState((prev: AppState) => {
|
setState((prev: AppState) => setStateUpdateSelection(prev, value));
|
||||||
let newSelection = prev.actions.getChips.selection;
|
|
||||||
newSelection?.push(value);
|
|
||||||
|
|
||||||
let newState = {
|
|
||||||
...prev,
|
|
||||||
actions: {
|
|
||||||
...state.actions,
|
|
||||||
getChips: {
|
|
||||||
active: true,
|
|
||||||
selection: newSelection,
|
|
||||||
valid: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = validateChips(newState);
|
|
||||||
newState.actions.getChips.valid = result;
|
|
||||||
return newState;
|
|
||||||
})
|
|
||||||
}, [state]);
|
}, [state]);
|
||||||
|
|
||||||
|
const liftCollapsed = useCallback((collapsed: boolean, tier = 5) => {
|
||||||
|
setUICollapse((prev: UIState) => {
|
||||||
|
switch (tier) {
|
||||||
|
case 1:
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
tierOneCollapsed: collapsed
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
tierTwoCollapsed: collapsed
|
||||||
|
}
|
||||||
|
case 3:
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
tierThreeCollapsed: collapsed
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
noblesCollapsed: collapsed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, [UICollapse, setUICollapse])
|
||||||
|
|
||||||
// util functions, setup on mount
|
// util functions, setup on mount
|
||||||
useEffect(() => initializeBoard(state, setState), [])
|
useEffect(() => initializeBoard(state, setState), [])
|
||||||
|
|
||||||
@@ -63,12 +71,12 @@ export default function Gameboard({ state, setState }: StateProps) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (endgame) {
|
if (endgame) {
|
||||||
let winner: PlayerData;
|
let winner: PlayerData;
|
||||||
|
const winnerData = state.players;
|
||||||
const currentPlayer = useCurrentPlayer(state);
|
const currentPlayer = useCurrentPlayer(state);
|
||||||
if (!currentPlayer) return;
|
if (!currentPlayer) return;
|
||||||
|
|
||||||
if (currentPlayer.id <= endgame.id) {
|
if (currentPlayer.id <= endgame.id) {
|
||||||
const winnerData = state.players;
|
winner = winnerData.sort((x,y) => x.points + y.points)[0];
|
||||||
winner = winnerData.sort((x,y) => x.points - y.points)[0];
|
|
||||||
console.log(winner.name + ' wins!');
|
console.log(winner.name + ' wins!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,19 +93,25 @@ export default function Gameboard({ state, setState }: StateProps) {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
setView(
|
setView(
|
||||||
<div className="gameboard-rows">
|
<div className="gameboard">
|
||||||
<strong>Round: {state.round}</strong>
|
<h2 id="round-marker">Round: {state.round}</h2>
|
||||||
<Nobles state={state} setState={setState} />
|
<div className="gameboard-columns">
|
||||||
<CardRow tier={3} state={state} setState={setState} />
|
<section className={shouldRightSideCollapse(UICollapse) ? "gameboard-left-expanded" : "gameboard-left"}>
|
||||||
<CardRow tier={2} state={state} setState={setState} />
|
<Nobles state={state} setState={setState} liftCollapsed={liftCollapsed} />
|
||||||
<CardRow tier={1} state={state} setState={setState} />
|
<CardRow tier={3} state={state} setState={setState} liftCollapsed={liftCollapsed} />
|
||||||
<SelectionView state={state} setState={setState} />
|
<CardRow tier={2} state={state} setState={setState} liftCollapsed={liftCollapsed} />
|
||||||
<AvailableChips state={state} setState={setState} liftSelection={liftSelection} />
|
<CardRow tier={1} state={state} setState={setState} liftCollapsed={liftCollapsed} />
|
||||||
<AllPlayers state={state} setState={setState} />
|
</section>
|
||||||
|
<section className={shouldRightSideCollapse(UICollapse) ? "gameboard-right-compact" : "gameboard-right"}>
|
||||||
|
<AllPlayers
|
||||||
|
state={state} setState={setState} liftSelection={liftSelection}
|
||||||
|
UICollapse={UICollapse} setUICollapse={setUICollapse} liftCollapsed={liftCollapsed} />
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}, [state]);
|
}, [state, UICollapse]);
|
||||||
|
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { expect, it, describe, vi } from 'vitest';
|
import { expect, it, describe, vi } from 'vitest';
|
||||||
import initializeBoard from '../../util/initializeBoard';
|
import initializeBoard from '../../util/setup/initializeBoard';
|
||||||
import { initialState } from '../../hooks/stateSetters';
|
import { initialState } from '../../hooks/stateSetters';
|
||||||
import { AppState, setStateType } from '../../util/types';
|
import { AppState, setStateType } from '../../util/types';
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,44 @@
|
|||||||
|
@import "../../sass/helper/mixins";
|
||||||
|
|
||||||
.nobles-panel {
|
.nobles-panel {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
background-color: rgb(240, 236, 225);
|
background-color: rgb(212, 196, 152);
|
||||||
padding: 1.5rem;
|
|
||||||
color: black;
|
color: black;
|
||||||
}
|
padding: 1rem 0;
|
||||||
|
width: 45vw;
|
||||||
|
|
||||||
.all-nobles {
|
.nobles-topbar {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row nowrap;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: baseline;
|
||||||
|
> * {
|
||||||
|
margin: 0 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.all-nobles {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row nowrap;
|
flex-flow: row nowrap;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
}
|
|
||||||
|
|
||||||
.noble-card {
|
.noble-card {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
min-width: 25%;
|
||||||
|
border-right: 1px solid black;
|
||||||
|
&:last-child {
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mapped-noble-costs {
|
||||||
|
display: flex;
|
||||||
|
@include map-gem-values(".noble-cost");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
import { NobleData, ResourceCost } from "../../util/types";
|
import { NobleData, ResourceCost } from "../../util/types";
|
||||||
import { StateProps } from "../../util/propTypes";
|
import { NobleProps } from "../../util/propTypes";
|
||||||
import "../Nobles/Nobles.scss"
|
import "../Nobles/Nobles.scss"
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
|
export default function Nobles({ state, liftCollapsed }: NobleProps) {
|
||||||
|
const [collapsed, setCollapsed] = useState(true);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
liftCollapsed(collapsed);
|
||||||
|
}, [collapsed]);
|
||||||
|
|
||||||
export default function Nobles({ state }: StateProps) {
|
|
||||||
if (!state.gameboard.nobles.length) {
|
if (!state.gameboard.nobles.length) {
|
||||||
return (
|
return (
|
||||||
<div className="nobles-panel">
|
<div className="nobles-panel">
|
||||||
@@ -14,22 +21,30 @@ export default function Nobles({ state }: StateProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="nobles-panel">
|
<div className={`nobles-panel ${collapsed && 'collapsed'}`}>
|
||||||
<strong>NOBLES</strong>
|
<div className="nobles-topbar">
|
||||||
<div className="all-nobles">
|
<strong className="nobles-header">Nobles</strong>
|
||||||
|
<button onClick={() => setCollapsed(!collapsed)}>{collapsed ? "Show" : "Hide"}</button>
|
||||||
|
</div>
|
||||||
|
<div className={collapsed ? "hidden" : "all-nobles"}>
|
||||||
{
|
{
|
||||||
state && state.gameboard.nobles.map((noble: NobleData) => {
|
state && state.gameboard.nobles.map((noble: NobleData) => {
|
||||||
return (
|
return (
|
||||||
<div className="noble-card" key={v4()}>
|
<div className="noble-card" key={v4()}>
|
||||||
<p>Points: {noble.points}</p>
|
|
||||||
<p>Cost:</p>
|
<p>Cost:</p>
|
||||||
|
<div className="mapped-noble-costs">
|
||||||
{
|
{
|
||||||
Object.keys(noble.resourceCost).map((each) => {
|
Object.keys(noble.resourceCost).map((each) => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return (noble.resourceCost[each as keyof ResourceCost] > 0) && <p key={v4()}>{each}: {noble.resourceCost[each as keyof ResourceCost]}</p>
|
return (noble.resourceCost[each as keyof ResourceCost] > 0) && (
|
||||||
|
<p key={v4()} className={`noble-cost-${each}`}>
|
||||||
|
{noble.resourceCost[each as keyof ResourceCost]}
|
||||||
|
</p>
|
||||||
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import getTotalBuyingPower from "../../util/getTotalBuyingPower";
|
import getTotalBuyingPower from "../../util/mechanics/getTotalBuyingPower";
|
||||||
import { NobleData, PlayerData, ResourceCost } from "../../util/types";
|
import { NobleData, PlayerData, ResourceCost } from "../../util/types";
|
||||||
|
|
||||||
export const canPickUpNoble = (player: PlayerData, noble: NobleData) => {
|
export const canPickUpNoble = (player: PlayerData, noble: NobleData) => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { turnOrderUtil } from "../../../util/turnOrderUtil";
|
import { turnOrderUtil } from "../../../util/mechanics/TurnOrderUtil";
|
||||||
import getTotalBuyingPower from "../../../util/getTotalBuyingPower";
|
import getTotalBuyingPower from "../../../util/mechanics/getTotalBuyingPower";
|
||||||
import { AppState, CardData, PlayerCards, ResourceCost, setStateType } from "../../../util/types";
|
import { AppState, CardData, PlayerCards, ResourceCost, setStateType } from "../../../util/types";
|
||||||
import cardTierToKey from "../../../util/cardTierToKey";
|
import cardTierToKey from "../../../util/mechanics/cardTierToKey";
|
||||||
import { canPickUpNoble } from "../../Nobles/canPickUpNoble";
|
import { canPickUpNoble } from "../../Nobles/canPickUpNoble";
|
||||||
import { initialActions, setStateGetNoble } from "../../../hooks/stateSetters";
|
import { initialActions, setStateGetNoble } from "../../../hooks/stateSetters";
|
||||||
import { useCurrentPlayer } from "../../../hooks/useCurrentPlayer";
|
import { useCurrentPlayer } from "../../../hooks/useCurrentPlayer";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { AppState, PlayerData, setStateType } from '../../../util/types';
|
import { AppState, PlayerData, setStateType } from '../../../util/types';
|
||||||
import { useCurrentPlayer } from '../../../hooks/useCurrentPlayer';
|
import { useCurrentPlayer } from '../../../hooks/useCurrentPlayer';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { turnOrderUtil } from '../../../util/turnOrderUtil';
|
import { turnOrderUtil } from '../../../util/mechanics/TurnOrderUtil';
|
||||||
import { initialActions } from "../../../hooks/stateSetters";
|
import { initialActions } from "../../../hooks/stateSetters";
|
||||||
|
|
||||||
export const hasMaxChips = (player: PlayerData | null): boolean => {
|
export const hasMaxChips = (player: PlayerData | null): boolean => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import cardTierToKey from "../../../util/cardTierToKey";
|
import cardTierToKey from "../../../util/mechanics/cardTierToKey";
|
||||||
import { initialActions } from "../../../hooks/stateSetters";
|
import { initialActions } from "../../../hooks/stateSetters";
|
||||||
import { turnOrderUtil } from "../../../util/turnOrderUtil";
|
import { turnOrderUtil } from "../../../util/mechanics/TurnOrderUtil";
|
||||||
import { AppState, CardData, FullDeck, PlayerData, setStateType } from "../../../util/types";
|
import { AppState, CardData, FullDeck, PlayerData, setStateType } from "../../../util/types";
|
||||||
import { useCurrentPlayer } from "../../../hooks/useCurrentPlayer";
|
import { useCurrentPlayer } from "../../../hooks/useCurrentPlayer";
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,108 @@
|
|||||||
@import '../../sass/helper/mixins';
|
@import '../../sass/helper/mixins';
|
||||||
|
@import '../../sass/helper/variables';
|
||||||
@import '../../sass/helper/placeholders';
|
@import '../../sass/helper/placeholders';
|
||||||
|
|
||||||
.all-players {
|
// local placeholder
|
||||||
|
%all-players-base {
|
||||||
display: flex;
|
display: flex;
|
||||||
background-color: rgb(237, 213, 156);
|
flex-flow: column nowrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
background-color: rgb(188, 176, 146);
|
||||||
color: black;
|
color: black;
|
||||||
|
|
||||||
.player-ui {
|
.player-ui {
|
||||||
p {
|
|
||||||
margin: 1rem;
|
|
||||||
}
|
|
||||||
.subheader {
|
.subheader {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
background-color:rgb(172, 149, 94);
|
||||||
|
margin: 1rem 0;
|
||||||
|
padding: 0 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
img {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@each $gem in $gemlist {
|
||||||
|
@include map-gem-values('.foreground');
|
||||||
|
.foreground-#{$gem} {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding: 8px;
|
||||||
|
|
||||||
|
p {
|
||||||
|
display: inline;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-card-cost {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row wrap;
|
||||||
|
justify-content: center;
|
||||||
|
@include map-gem-values(".card-cost");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.all-players {
|
||||||
|
@extend %all-players-base;
|
||||||
|
.selection-view {
|
||||||
|
.current-selections {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
@include map-gem-values(".selection-value");
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.player-ui {
|
||||||
|
.subheader {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
background-color:rgb(172, 149, 94);
|
||||||
|
margin: 1rem 0;
|
||||||
|
padding: 0 2rem;
|
||||||
|
|
||||||
|
.turn-and-action-based {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.resources {
|
.resources {
|
||||||
.player-chips-enum {
|
.player-chips-enum {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@include map-gem-values(".player-chip");
|
@include map-gem-values(".player-chip");
|
||||||
p {
|
|
||||||
@extend %chip-design;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.reserved-card-view {
|
||||||
|
background-color: rgb(232, 224, 200);
|
||||||
|
.reserved-card-cost {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row wrap;
|
||||||
|
justify-content: center;
|
||||||
|
@include map-gem-values(".reserve-cost");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.all-players-mini {
|
||||||
|
@extend %all-players-base;
|
||||||
|
}
|
||||||
@@ -1,15 +1,76 @@
|
|||||||
|
// framework
|
||||||
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
|
|
||||||
|
// util
|
||||||
|
import { shouldRightSideCollapse } from "../../util/mechanics/shouldRightSideCollapse";
|
||||||
|
import { AllPlayersProps } from "../../util/propTypes";
|
||||||
|
import { useCurrentPlayer } from "../../hooks/useCurrentPlayer";
|
||||||
|
import { defaultUIState } from "../../util/setup/defaultUIState";
|
||||||
|
import { UIState } from "../../util/types";
|
||||||
|
|
||||||
|
// components
|
||||||
|
import AvailableChips from "../Resources/AvailableChips";
|
||||||
|
import SelectionView from "../Resources/SelectionView";
|
||||||
import Player from "./Player";
|
import Player from "./Player";
|
||||||
import { PlayerData } from "../../util/types";
|
|
||||||
import { StateProps } from "../../util/propTypes";
|
|
||||||
import "./AllPlayers.scss"
|
import "./AllPlayers.scss"
|
||||||
|
|
||||||
export default function AllPlayers({ state, setState }: StateProps) {
|
export default function AllPlayers({ state, setState, liftSelection, UICollapse, setUICollapse, liftCollapsed }: AllPlayersProps) {
|
||||||
const playerPool = state.players?.map((player: PlayerData) => <Player key={v4()} player={player} state={state} setState={setState} />);
|
const [playerView, setPlayerView] = useState<JSX.Element>();
|
||||||
|
const [collapseClass, setCollapseClass] = useState("all-players");
|
||||||
|
|
||||||
|
const collapseAll = () => {
|
||||||
|
liftCollapsed(true);
|
||||||
|
liftCollapsed(true, 3);
|
||||||
|
liftCollapsed(true, 2);
|
||||||
|
liftCollapsed(true, 1);
|
||||||
|
// let value = UICollapse[each as keyof UIState];
|
||||||
|
// if (each === "playerUICollapsed") {
|
||||||
|
// continue;
|
||||||
|
// } else if (each === "noblesCollapsed") {
|
||||||
|
// console.log(each);
|
||||||
|
// liftCollapsed(value);
|
||||||
|
// } else {
|
||||||
|
// console.log(each, value);
|
||||||
|
// switch (each) {
|
||||||
|
// case "tierThreeCollapsed":
|
||||||
|
// liftCollapsed(value, 3);
|
||||||
|
// break;
|
||||||
|
// case "tierTwoCollapsed":
|
||||||
|
// liftCollapsed(value, 2);
|
||||||
|
// break;
|
||||||
|
// case "tierOneCollapsed":
|
||||||
|
// liftCollapsed(value, 1);
|
||||||
|
// break;
|
||||||
|
// default: break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
const allowCollapseAll = useMemo(() => {
|
||||||
|
for (let each of Object.keys(UICollapse)) {
|
||||||
|
if (each === "playerUICollapsed") continue;
|
||||||
|
if (!UICollapse[each as keyof UIState]) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}, [UICollapse]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const currentPlayer = useCurrentPlayer(state);
|
||||||
|
if (!currentPlayer) return;
|
||||||
|
setPlayerView(<Player key={v4()} player={currentPlayer} state={state} setState={setState} />);
|
||||||
|
}, [state]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setCollapseClass( shouldRightSideCollapse(UICollapse) ? "all-players-mini" : "all-players" );
|
||||||
|
}, [UICollapse]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="all-players">
|
<div className={collapseClass}>
|
||||||
{ playerPool }
|
{ allowCollapseAll && <button onClick={collapseAll}>Collapse All</button> }
|
||||||
|
<SelectionView state={state} setState={setState} UICollapse={UICollapse} />
|
||||||
|
<AvailableChips state={state} setState={setState} liftSelection={liftSelection} />
|
||||||
|
{ playerView }
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import { setStateAwaitAction, setStateBuyCard, setStateGetChips, setStateReserveCard } from "../../hooks/stateSetters";
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { PlayerProps } from "../../util/propTypes";
|
import { v4 } from "uuid";
|
||||||
import { CardData, PlayerData } from "../../util/types"
|
import { setStateAwaitAction, setStateBuyCard, setStateGetChips, setStateReserveCard } from "../../hooks/stateSetters";
|
||||||
import { hasMaxReserved } from "./ActionMethods/reserveCardActions";
|
import { hasMaxReserved } from "./ActionMethods/reserveCardActions";
|
||||||
import { hasMaxChips } from "./ActionMethods/getChipsActions";
|
import { hasMaxChips } from "./ActionMethods/getChipsActions";
|
||||||
import { v4 } from "uuid";
|
import { CardData, PlayerData } from "../../util/types"
|
||||||
|
import { PlayerProps } from "../../util/propTypes";
|
||||||
import Card from "../Card/Card";
|
import Card from "../Card/Card";
|
||||||
|
|
||||||
export default function Player({ player, state, setState }: PlayerProps) {
|
export default function Player({ player, state, setState }: PlayerProps) {
|
||||||
@@ -27,14 +27,10 @@ export default function Player({ player, state, setState }: PlayerProps) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
dynamic && setReservedView(
|
dynamic && setReservedView(
|
||||||
<>
|
<div className="reserved-card-view">
|
||||||
<p>Reserved cards:</p>
|
<p>Reserved cards:</p>
|
||||||
{
|
{ dynamic.reservedCards?.map((data: CardData) => <Card key={v4()} data={data} state={state} setState={setState} reserved={true} />) }
|
||||||
dynamic.reservedCards?.map((data: CardData) => {
|
</div>
|
||||||
return <Card key={v4()} data={data} state={state} setState={setState} />
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}, [dynamic, setState])
|
}, [dynamic, setState])
|
||||||
|
|
||||||
@@ -58,13 +54,9 @@ export default function Player({ player, state, setState }: PlayerProps) {
|
|||||||
return (
|
return (
|
||||||
<div className="player-ui" key={v4()}>
|
<div className="player-ui" key={v4()}>
|
||||||
<p className="subheader">Name: {player.name} {player.starter && "(round starter)"}</p>
|
<p className="subheader">Name: {player.name} {player.starter && "(round starter)"}</p>
|
||||||
|
|
||||||
{/* Dynamic data from state */}
|
|
||||||
<section className="turn-and-action-based">
|
|
||||||
<p>Score: {dynamic && dynamic.points}</p>
|
<p>Score: {dynamic && dynamic.points}</p>
|
||||||
<p>{dynamic?.turnActive ? "It's your turn!" : "..."}</p>
|
|
||||||
|
|
||||||
{/* Player actions */}
|
<section className="turn-and-action-based">
|
||||||
<button
|
<button
|
||||||
disabled={(dynamic && hasMaxChips(dynamic)) || (!dynamic?.turnActive)}
|
disabled={(dynamic && hasMaxChips(dynamic)) || (!dynamic?.turnActive)}
|
||||||
onClick={() => handleClick(0)}>
|
onClick={() => handleClick(0)}>
|
||||||
@@ -82,12 +74,9 @@ export default function Player({ player, state, setState }: PlayerProps) {
|
|||||||
onClick={() => handleClick(2)}>
|
onClick={() => handleClick(2)}>
|
||||||
Reserve Card
|
Reserve Card
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section className="resources">
|
<section className="resources">
|
||||||
<p className="subheader">{dynamic?.name}'s Resources</p>
|
|
||||||
|
|
||||||
<div className="player-chips">
|
<div className="player-chips">
|
||||||
<p>Chips:</p>
|
<p>Chips:</p>
|
||||||
<div className="player-chips-enum">
|
<div className="player-chips-enum">
|
||||||
|
|||||||
@@ -1,14 +1,22 @@
|
|||||||
@import "../../sass/helper/mixins";
|
@import "../../sass/helper/mixins";
|
||||||
|
@import "../../sass/helper/variables";
|
||||||
|
|
||||||
.available-chips {
|
.available-chips {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row nowrap;
|
flex-flow: row wrap;
|
||||||
background-color: rgb(236, 238, 186);
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
color: black;
|
color: black;
|
||||||
|
margin: 1rem;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include map-gem-values(".chips");
|
@include map-gem-values(".chips");
|
||||||
|
@each $gem in $gemlist {
|
||||||
|
.chips-#{$gem} {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ export default function AvailableChips({ state, liftSelection }: ResourceProps)
|
|||||||
disabled={state.gameboard.tradingResources[typedKey] <= 0}
|
disabled={state.gameboard.tradingResources[typedKey] <= 0}
|
||||||
onClick={() => liftSelection(typedKey)}
|
onClick={() => liftSelection(typedKey)}
|
||||||
>
|
>
|
||||||
{key}: {state.gameboard.tradingResources[typedKey]}
|
{state.gameboard.tradingResources[typedKey]}
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
@import "../../sass/helper/mixins";
|
|
||||||
|
|
||||||
.selection-view {
|
|
||||||
.current-selections {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
@include map-gem-values(".selection-value");
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin: 1rem;
|
|
||||||
padding: 0.5rem;
|
|
||||||
border-radius: 25%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { StateProps } from "../../util/propTypes";
|
import { SelectionProps } from "../../util/propTypes";
|
||||||
import { useCurrentPlayer } from "../../hooks/useCurrentPlayer";
|
import { useCurrentPlayer } from "../../hooks/useCurrentPlayer";
|
||||||
import { GetChipsHTML, ReserveCardHTML } from "./ViewHTML";
|
import { GetChipsHTML, ReserveCardHTML } from "./ViewHTML";
|
||||||
import './SelectionView.scss';
|
import { shouldRightSideCollapse } from "../../util/mechanics/shouldRightSideCollapse";
|
||||||
|
|
||||||
export default function SelectionView({ state, setState }: StateProps) {
|
export default function SelectionView({ state, setState, UICollapse }: SelectionProps) {
|
||||||
const [currentPlayer, setCurrentPlayer] = useState(useCurrentPlayer(state));
|
const [currentPlayer, setCurrentPlayer] = useState(useCurrentPlayer(state));
|
||||||
const actionTypes = [
|
const actionTypes = [
|
||||||
state.actions.getChips,
|
state.actions.getChips,
|
||||||
@@ -15,19 +15,20 @@ export default function SelectionView({ state, setState }: StateProps) {
|
|||||||
const [view, setView] = useState(<></>);
|
const [view, setView] = useState(<></>);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setCurrentPlayer(useCurrentPlayer(state));
|
||||||
setView(() => {
|
setView(() => {
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case (actionTypes[0].active):
|
case (actionTypes[0].active):
|
||||||
return <GetChipsHTML state={state} setState={setState} />
|
return <GetChipsHTML state={state} setState={setState} UICollapse={UICollapse} />
|
||||||
case (actionTypes[1].active):
|
case (actionTypes[1].active):
|
||||||
return (
|
return (
|
||||||
<div className="selection-view">
|
<div className={shouldRightSideCollapse(UICollapse) ? "selection-view-mini" : "selection-view"}>
|
||||||
<h2>{currentPlayer?.name} has elected to purchase a card!</h2>
|
<h2>{currentPlayer?.name} has elected to purchase a card!</h2>
|
||||||
<strong>Choose a card above to purchase.</strong>
|
<strong>Choose a card above to purchase.</strong>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
case (actionTypes[2].active):
|
case (actionTypes[2].active):
|
||||||
return <ReserveCardHTML state={state} setState={setState} />;
|
return <ReserveCardHTML state={state} setState={setState} UICollapse={UICollapse} />;
|
||||||
default:
|
default:
|
||||||
return (
|
return (
|
||||||
<div className="selection-view">
|
<div className="selection-view">
|
||||||
@@ -36,9 +37,7 @@ export default function SelectionView({ state, setState }: StateProps) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}, [state, setState])
|
||||||
setCurrentPlayer(useCurrentPlayer(state));
|
|
||||||
}, [state, state.actions, setState])
|
|
||||||
|
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
@@ -2,16 +2,22 @@ import { useEffect, useState } from "react";
|
|||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
import { setStateGetChips, setStateReserveCard, setStateReservePlusGold } from "../../hooks/stateSetters";
|
import { setStateGetChips, setStateReserveCard, setStateReservePlusGold } from "../../hooks/stateSetters";
|
||||||
import { useCurrentPlayer } from "../../hooks/useCurrentPlayer";
|
import { useCurrentPlayer } from "../../hooks/useCurrentPlayer";
|
||||||
import { StateProps } from "../../util/propTypes";
|
import { shouldRightSideCollapse } from "../../util/mechanics/shouldRightSideCollapse";
|
||||||
|
import { SelectionProps } from "../../util/propTypes";
|
||||||
import { ResourceCost } from "../../util/types";
|
import { ResourceCost } from "../../util/types";
|
||||||
import { getChipsActions } from "../Player/ActionMethods";
|
import { getChipsActions } from "../Player/ActionMethods";
|
||||||
import { hasMaxChips } from "../Player/ActionMethods/getChipsActions";
|
import { hasMaxChips } from "../Player/ActionMethods/getChipsActions";
|
||||||
const { getChips } = getChipsActions;
|
const { getChips } = getChipsActions;
|
||||||
|
|
||||||
export const GetChipsHTML = ({ state, setState }: StateProps) => {
|
export const GetChipsHTML = ({ state, setState, UICollapse }: SelectionProps) => {
|
||||||
const [prompt, setPrompt] = useState("");
|
const [prompt, setPrompt] = useState("");
|
||||||
|
const [style, setStyle] = useState("");
|
||||||
const currentPlayer = useCurrentPlayer(state);
|
const currentPlayer = useCurrentPlayer(state);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setStyle(shouldRightSideCollapse(UICollapse) ? "selection-view-mini" : "selection-view");
|
||||||
|
}, [UICollapse]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!state.actions.getChips.active) setPrompt("");
|
if (!state.actions.getChips.active) setPrompt("");
|
||||||
if (state.actions.getChips.selection?.length === 0) {
|
if (state.actions.getChips.selection?.length === 0) {
|
||||||
@@ -22,13 +28,13 @@ export const GetChipsHTML = ({ state, setState }: StateProps) => {
|
|||||||
}, [state])
|
}, [state])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="selection-view">
|
<div className={style}>
|
||||||
<h2>{currentPlayer?.name} has elected to collect resources!</h2>
|
<h2>{currentPlayer?.name} has elected to collect resources!</h2>
|
||||||
<strong>{prompt}</strong>
|
<strong>{prompt}</strong>
|
||||||
<div className="current-selections">
|
<div className="current-selections">
|
||||||
{
|
{
|
||||||
state.actions.getChips.active &&
|
state.actions.getChips.active &&
|
||||||
state.actions.getChips.selection?.map((each: keyof ResourceCost) => <p className={`selection-value-${each}`} key={v4()}>{each}</p>)
|
state.actions.getChips.selection?.map((each: keyof ResourceCost) => <p className={`selection-value-${each}`} key={v4()}>{each[0].toUpperCase()}</p>)
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
@@ -41,10 +47,15 @@ export const GetChipsHTML = ({ state, setState }: StateProps) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ReserveCardHTML = ({ state, setState }: StateProps) => {
|
export const ReserveCardHTML = ({ state, setState, UICollapse }: SelectionProps) => {
|
||||||
const [takeGold, setTakeGold] = useState(false);
|
const [takeGold, setTakeGold] = useState(false);
|
||||||
|
const [style, setStyle] = useState("");
|
||||||
const currentPlayer = useCurrentPlayer(state);
|
const currentPlayer = useCurrentPlayer(state);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setStyle(shouldRightSideCollapse(UICollapse) ? "selection-view-mini" : "selection-view");
|
||||||
|
}, [UICollapse]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
switch (takeGold) {
|
switch (takeGold) {
|
||||||
case true:
|
case true:
|
||||||
@@ -59,7 +70,7 @@ export const ReserveCardHTML = ({ state, setState }: StateProps) => {
|
|||||||
}, [takeGold]);
|
}, [takeGold]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="selection-view">
|
<div className={style}>
|
||||||
<h2>{currentPlayer?.name} has elected to reserve a card!</h2>
|
<h2>{currentPlayer?.name} has elected to reserve a card!</h2>
|
||||||
<strong>Please make your selection above.</strong>
|
<strong>Please make your selection above.</strong>
|
||||||
{ !hasMaxChips(currentPlayer) && (
|
{ !hasMaxChips(currentPlayer) && (
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/LILY-serafima-lazarenko-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -22,7 +23,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/SUCCULENT-jacalyn-beales-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -34,7 +36,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/VIOLET-tobias-mockenhaupt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -46,7 +49,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/FORGET-yoksel-zok-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -58,7 +62,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/ROSE-alexey-savchenko-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -70,7 +75,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/VIOLET-artiom-vallat-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -82,7 +88,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/VIOLET-yoksel-zok-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -94,7 +101,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/SUCCULENT-annie-spratt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -106,7 +114,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/FORGET-anna-rozwadowska-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -118,7 +127,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/FORGET-gemma-evans-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -130,7 +140,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/LILY-evie-s-unsplash-2.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -142,7 +153,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/ROSE-arkadiy-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -154,7 +166,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/ROSE-engin-akyurt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -166,7 +179,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/FORGET-krzysztof-kowalik-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -178,7 +192,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/LILY-evie-s-unsplash-2.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -190,7 +205,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/VIOLET-adrian-swancar-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -202,7 +218,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/ROSE-engin-akyurt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -214,7 +231,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/ROSE-arkadiy-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -226,7 +244,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/LILY-meghna-r-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -238,7 +257,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/LILY-yi-duo-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -250,7 +270,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/SUCCULENT-annie-spratt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -262,7 +283,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/SUCCULENT-annie-spratt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -274,7 +296,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/SUCCULENT-annie-spratt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -286,7 +309,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/VIOLET-nick-nice-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -298,7 +322,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/FORGET-anna-rozwadowska-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -310,7 +335,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/VIOLET-yoksel-zok-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -322,7 +348,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/LILY-yi-duo-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -334,7 +361,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/SUCCULENT-jacalyn-beales-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -346,7 +374,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/ROSE-ekrem-osmanoglu-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -358,7 +387,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/FORGET-krzysztof-kowalik-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -370,7 +400,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/FORGET-anna-rozwadowska-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -382,7 +413,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/ROSE-engin-akyurt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -394,7 +426,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/VIOLET-rita-ox-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -406,7 +439,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/SUCCULENT-tim-mossholder-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -418,7 +452,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 0,
|
"points": 0,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/LILY-evie-s-unsplash-2.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -430,7 +465,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/FORGET-gemma-evans-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -442,7 +478,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/ROSE-edward-howell-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -454,7 +491,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/VIOLET-rita-ox-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -466,7 +504,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/LILY-evie-s-unsplash-2.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -478,7 +517,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 1
|
"tier": 1,
|
||||||
|
"image": "src/assets/img/SUCCULENT-annie-spratt-unsplash.jpg"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tierTwo": [
|
"tierTwo": [
|
||||||
@@ -492,7 +532,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/ROSE-aleza-van-der-werff-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -504,7 +545,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/VIOLET-adrian-swancar-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -516,7 +558,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/SUCCULENT-tim-mossholder-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -528,7 +571,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/VIOLET-nick-nice-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -540,7 +584,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/SUCCULENT-angele-kamp-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -552,7 +597,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/ROSE-engin-akyurt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -564,7 +610,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/LILY-meghna-r-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -576,7 +623,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/SUCCULENT-tim-mossholder-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -588,7 +636,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/LILY-serafima-lazarenko-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -600,7 +649,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/FORGET-olga-budko-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -612,7 +662,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/LILY-yi-duo-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -624,7 +675,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/VIOLET-rita-ox-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -636,7 +688,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/FORGET-gemma-evans-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -648,7 +701,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 3,
|
"points": 3,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/SUCCULENT-annie-spratt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -660,7 +714,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/SUCCULENT-edgar-castrejon-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -672,7 +727,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 3,
|
"points": 3,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/LILY-deleece-cook-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -684,7 +740,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/ROSE-alexey-savchenko-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -696,7 +753,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/VIOLET-artiom-vallat-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -708,7 +766,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/VIOLET-tobias-mockenhaupt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -720,7 +779,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 3,
|
"points": 3,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/VIOLET-yoksel-zok-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -732,7 +792,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/ROSE-engin-akyurt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -744,7 +805,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/LILY-evie-s-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -756,7 +818,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/SUCCULENT-jacalyn-beales-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -768,7 +831,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/LILY-deleece-cook-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -780,7 +844,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/ROSE-alexey-savchenko-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -792,7 +857,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/FORGET-yoksel-zok-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -804,7 +870,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 3,
|
"points": 3,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/ROSE-ekrem-osmanoglu-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -816,7 +883,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 3,
|
"points": 3,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/FORGET-yoksel-zok-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -828,7 +896,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 2,
|
"points": 2,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/FORGET-yoksel-zok-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -840,7 +909,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 1,
|
"points": 1,
|
||||||
"tier": 2
|
"tier": 2,
|
||||||
|
"image": "src/assets/img/FORGET-gemma-evans-unsplash.jpg"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tierThree": [
|
"tierThree": [
|
||||||
@@ -854,7 +924,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 4,
|
"points": 4,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/ROSE-engin-akyurt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -866,7 +937,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 4,
|
"points": 4,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/LILY-evie-s-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -878,7 +950,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 4,
|
"points": 4,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/LILY-meghna-r-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -890,7 +963,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 4,
|
"points": 4,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/SUCCULENT-annie-spratt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -902,7 +976,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 4,
|
"points": 4,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/VIOLET-tobias-mockenhaupt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -914,7 +989,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 4,
|
"points": 4,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/FORGET-krzysztof-kowalik-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -926,7 +1002,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 4,
|
"points": 4,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/VIOLET-tobias-mockenhaupt-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -938,7 +1015,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 4,
|
"points": 4,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/FORGET-olga-budko-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -950,7 +1028,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 4,
|
"points": 4,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/SUCCULENT-edgar-castrejon-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -962,7 +1041,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 4,
|
"points": 4,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/SUCCULENT-tim-mossholder-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -974,7 +1054,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 3,
|
"points": 3,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/ROSE-arkadiy-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -986,7 +1067,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 3,
|
"points": 3,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/SUCCULENT-jacalyn-beales-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -998,7 +1080,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 3,
|
"points": 3,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/LILY-deleece-cook-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -1010,7 +1093,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 3,
|
"points": 3,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/VIOLET-rita-ox-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -1022,7 +1106,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 3,
|
"points": 3,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/FORGET-anna-rozwadowska-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -1034,7 +1119,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "sapphire",
|
"gemValue": "sapphire",
|
||||||
"points": 5,
|
"points": 5,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/FORGET-gemma-evans-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -1046,7 +1132,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "diamond",
|
"gemValue": "diamond",
|
||||||
"points": 5,
|
"points": 5,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/LILY-evie-s-unsplash-2.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -1058,7 +1145,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "ruby",
|
"gemValue": "ruby",
|
||||||
"points": 5,
|
"points": 5,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/ROSE-aleza-van-der-werff-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -1070,7 +1158,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "emerald",
|
"gemValue": "emerald",
|
||||||
"points": 5,
|
"points": 5,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/SUCCULENT-angele-kamp-unsplash.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resourceCost": {
|
"resourceCost": {
|
||||||
@@ -1082,8 +1171,8 @@
|
|||||||
},
|
},
|
||||||
"gemValue": "onyx",
|
"gemValue": "onyx",
|
||||||
"points": 5,
|
"points": 5,
|
||||||
"tier": 3
|
"tier": 3,
|
||||||
|
"image": "src/assets/img/VIOLET-nick-nice-unsplash.jpg"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { AppState, CardData, NobleData, PlayerData, ResourceCost } from "../util/types";
|
import { AppState, CardData, NobleData, PlayerData, ResourceCost, UIState } from "../util/types";
|
||||||
import CardDeck from '../data/cards.json';
|
import CardDeck from '../data/cards.json';
|
||||||
|
import { validateChips } from "../components/Player/ActionMethods/getChipsActions";
|
||||||
|
|
||||||
export const initialActions = {
|
export const initialActions = {
|
||||||
buyCard: { active: false },
|
buyCard: { active: false },
|
||||||
@@ -51,6 +52,27 @@ export const setStateGetChips = (prev: AppState) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const setStateUpdateSelection = (prev: AppState, value: keyof ResourceCost) => {
|
||||||
|
let newSelection = prev.actions.getChips.selection;
|
||||||
|
newSelection?.push(value);
|
||||||
|
|
||||||
|
let newState = {
|
||||||
|
...prev,
|
||||||
|
actions: {
|
||||||
|
...prev.actions,
|
||||||
|
getChips: {
|
||||||
|
active: true,
|
||||||
|
selection: newSelection,
|
||||||
|
valid: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = validateChips(newState);
|
||||||
|
newState.actions.getChips.valid = result;
|
||||||
|
return newState;
|
||||||
|
}
|
||||||
|
|
||||||
export const setStateBuyCard = (prev: AppState) => {
|
export const setStateBuyCard = (prev: AppState) => {
|
||||||
return {
|
return {
|
||||||
...prev,
|
...prev,
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
@import './helper/placeholders';
|
|
||||||
|
|
||||||
#root {
|
#root {
|
||||||
.hidden {
|
.hidden {
|
||||||
@extend %hidden;
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsed {
|
||||||
|
width: 20vw;
|
||||||
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
max-width: 1280px;
|
width: 99vw;
|
||||||
margin: 0 auto;
|
margin: 0 0.5vw;
|
||||||
padding: 2rem;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
@import "./placeholders";
|
||||||
|
|
||||||
@mixin map-gem-values($parentClass) {
|
@mixin map-gem-values($parentClass) {
|
||||||
#{$parentClass} {
|
#{$parentClass} {
|
||||||
&-emerald {
|
&-emerald {
|
||||||
@@ -24,6 +26,16 @@
|
|||||||
background-color: gold;
|
background-color: gold;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
@extend %chip-design;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin get-random-image($targetList) {
|
||||||
|
$idx: random(6);
|
||||||
|
$nth: nth($targetList, $idx);
|
||||||
|
|
||||||
|
background-image: url($nth);
|
||||||
|
}
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
%hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
// designed to extend a "p" element
|
// designed to extend a "p" element
|
||||||
%chip-design {
|
%chip-design {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
$gemlist: 'ruby', 'sapphire', 'onyx', 'emerald', 'diamond', 'gold';
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AppState, PlayerData } from "./types";
|
import { AppState, PlayerData } from "../types";
|
||||||
|
|
||||||
export const turnOrderUtil = (prev: AppState, dynamic: PlayerData) => {
|
export const turnOrderUtil = (prev: AppState, dynamic: PlayerData) => {
|
||||||
let roundIncrement = false;
|
let roundIncrement = false;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { FullDeck } from "./types"
|
import { FullDeck } from "../types"
|
||||||
|
|
||||||
export default function cardTierToKey(tier: number): keyof FullDeck {
|
export default function cardTierToKey(tier: number): keyof FullDeck {
|
||||||
switch (tier) {
|
switch (tier) {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { PlayerData, ResourceCost } from "./types";
|
import { PlayerData, ResourceCost } from "../types";
|
||||||
|
|
||||||
export default function getTotalBuyingPower(currentPlayer: PlayerData) {
|
export default function getTotalBuyingPower(currentPlayer: PlayerData) {
|
||||||
let totalBuyingPower = {
|
let totalBuyingPower = {
|
||||||
12
src/util/mechanics/shouldRightSideCollapse.ts
Normal file
12
src/util/mechanics/shouldRightSideCollapse.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { UIState } from "../types";
|
||||||
|
|
||||||
|
export const shouldRightSideCollapse = (UICollapse: UIState) => {
|
||||||
|
for (let slice of Object.keys(UICollapse)) {
|
||||||
|
if (slice === "playerUICollapsed") continue;
|
||||||
|
if (!UICollapse[slice as keyof UIState]) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import { AppState, CardData, PlayerData, ResourceCost, SetActionType, setStateType } from "./types";
|
import { Dispatch, SetStateAction } from "react";
|
||||||
|
import { AppState, CardData, PlayerData, ResourceCost, setStateType, UIState } from "./types";
|
||||||
|
|
||||||
export interface StateProps {
|
export interface StateProps {
|
||||||
state: AppState,
|
state: AppState,
|
||||||
@@ -7,14 +8,17 @@ export interface StateProps {
|
|||||||
|
|
||||||
export interface CardProps extends StateProps {
|
export interface CardProps extends StateProps {
|
||||||
data: CardData
|
data: CardData
|
||||||
|
reserved?: boolean
|
||||||
|
collapsed?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CardRowProps extends StateProps {
|
export interface CardRowProps extends StateProps {
|
||||||
tier: number
|
tier: number
|
||||||
|
liftCollapsed: (collapsed: boolean, tier: number) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AllPlayersProps extends StateProps {
|
export interface NobleProps extends StateProps {
|
||||||
setActionState: (value: SetActionType, player?: PlayerData) => void
|
liftCollapsed: (collapsed: boolean) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PlayerProps extends StateProps {
|
export interface PlayerProps extends StateProps {
|
||||||
@@ -25,3 +29,12 @@ export interface ResourceProps extends StateProps {
|
|||||||
liftSelection: (value: keyof ResourceCost) => void
|
liftSelection: (value: keyof ResourceCost) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface AllPlayersProps extends ResourceProps {
|
||||||
|
UICollapse: UIState,
|
||||||
|
setUICollapse: Dispatch<SetStateAction<UIState>>
|
||||||
|
liftCollapsed: (collapsed: boolean, tier?: number) => void
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SelectionProps extends StateProps {
|
||||||
|
UICollapse: UIState
|
||||||
|
}
|
||||||
9
src/util/setup/defaultUIState.ts
Normal file
9
src/util/setup/defaultUIState.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { UIState } from "../types";
|
||||||
|
|
||||||
|
export const defaultUIState: UIState = {
|
||||||
|
noblesCollapsed: true,
|
||||||
|
tierThreeCollapsed: true,
|
||||||
|
tierTwoCollapsed: true,
|
||||||
|
tierOneCollapsed: true,
|
||||||
|
playerUICollapsed: false
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { AppState, FullDeck, NobleData, ResourceCost, setStateType } from "./types";
|
import { AppState, FullDeck, NobleData, ResourceCost, setStateType } from "../types";
|
||||||
import NobleStore from '../data/nobles.json';
|
import NobleStore from '../../data/nobles.json';
|
||||||
|
|
||||||
const shuffleDeck = (state: AppState, setState: setStateType) => {
|
const shuffleDeck = (state: AppState, setState: setStateType) => {
|
||||||
if (!state.gameboard.deck) return;
|
if (!state.gameboard.deck) return;
|
||||||
@@ -88,6 +88,7 @@ export interface CardData {
|
|||||||
tier: number
|
tier: number
|
||||||
points?: number
|
points?: number
|
||||||
resourceCost: ResourceCost
|
resourceCost: ResourceCost
|
||||||
|
image: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ResourceCost {
|
export interface ResourceCost {
|
||||||
@@ -104,3 +105,11 @@ export interface NobleData {
|
|||||||
points: number,
|
points: number,
|
||||||
resourceCost: ResourceCost
|
resourceCost: ResourceCost
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UIState {
|
||||||
|
noblesCollapsed: boolean
|
||||||
|
tierThreeCollapsed: boolean
|
||||||
|
tierTwoCollapsed: boolean
|
||||||
|
tierOneCollapsed: boolean
|
||||||
|
playerUICollapsed: boolean
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { describe, expect, test } from "vitest"
|
import { describe, expect, test } from "vitest"
|
||||||
import cardTierToKey from "./cardTierToKey";
|
import cardTierToKey from "./mechanics/cardTierToKey";
|
||||||
import { mockPlayerOne, mockState } from "./testUtils";
|
import { mockPlayerOne, mockState } from "./testUtils";
|
||||||
import { turnOrderUtil } from "./turnOrderUtil";
|
import { turnOrderUtil } from "./mechanics/TurnOrderUtil";
|
||||||
import { useCurrentPlayer } from "../hooks/useCurrentPlayer";
|
import { useCurrentPlayer } from "../hooks/useCurrentPlayer";
|
||||||
import getTotalBuyingPower from "./getTotalBuyingPower";
|
import getTotalBuyingPower from "./mechanics/getTotalBuyingPower";
|
||||||
|
|
||||||
describe('app utilities', () => {
|
describe('app utilities', () => {
|
||||||
test('useCurrentPlayer', () => {
|
test('useCurrentPlayer', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user