Skip to content

Commit

Permalink
build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JollyGrin committed Sep 9, 2024
1 parent 1fd6934 commit d51c6a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 62 deletions.
8 changes: 5 additions & 3 deletions src/components/molecules/LoadDeck/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const LoadDeck = (props: GameStateActions) => {
...spell,
quantity: undefined, // Remove the quantity field
})).map(
({ quantity, ...rest }, index) =>
(rest, index) =>
({
id: rest.identifier + index + Date.now(),
img: rest.identifier,
Expand All @@ -40,7 +40,7 @@ export const LoadDeck = (props: GameStateActions) => {
...spell,
quantity: undefined, // Remove the quantity field
})).map(
({ quantity, ...rest }, i) =>
(rest, i) =>
({
id: rest.identifier + i + Date.now(),
img: rest.identifier,
Expand Down Expand Up @@ -93,8 +93,9 @@ export const LoadDeck = (props: GameStateActions) => {
)}
<Flex wrap="wrap" gap="0.25rem" mt="1rem">
{cards?.map((card, index) => (
<div>
<div key={card.identifier + index + "flex"}>
<img
alt="card"
width="165px"
key={card.identifier + index}
src={`https://card.cards.army/cards/50/${card.identifier}.webp`}
Expand All @@ -106,6 +107,7 @@ export const LoadDeck = (props: GameStateActions) => {
);
};

// eslint-disable-next-line
function shuffleArray(array: any) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1)); // Random index from 0 to i
Expand Down
44 changes: 0 additions & 44 deletions src/pages/game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,9 @@ import { GRIDS } from "@/components/organisms/GameBoard/constants";
import { SorceryCard } from "@/types/card";
import { useState } from "react";

const handCards: GameCard[] = [
{
id: "sorcerer-01",
img: "sorcerer.webp",
type: "avatar",
},
];

const deckCards = Array.from({ length: 30 }).map((_, index) => ({
id: "headless-ab-" + index,
img: "headless_haunt.webp",
type: "minion",
}));

const mockDeck: GameCard[] = [
{
id: "jihad",
img: "jihad.webp",
type: "aura",
},
{
id: "death_dealer-01",
img: "death_dealer.webp",
type: "minion",
},
{
id: "infernal_legion-01",
img: "infernal_legion.webp",
type: "minion",
},
{
id: "wayfaring_pilgrim-01",
img: "wayfaring_pilgrim.webp",
type: "minion",
},
];

const atlasCards = Array.from({ length: 10 }).map((_, index) => ({
id: "atlas-02" + index,
img: "arid_desert.webp",
type: "site",
}));

const initCards: GameCard[][] = Array.from({ length: 36 }, () => []);
// initCards[GRIDS.HAND] = handCards as GameCard[];
// initCards[GRIDS.DECK] = [...deckCards, ...mockDeck] as GameCard[];
initCards[GRIDS.ATLAS_DECK] = atlasCards as GameCard[];

type GameProps = {
id: string;
Expand Down
15 changes: 0 additions & 15 deletions src/pages/testapi.tsx

This file was deleted.

0 comments on commit d51c6a5

Please sign in to comment.