diff --git a/src/App.tsx b/src/App.tsx index f92eba4..18d8146 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -18,16 +18,15 @@ import { G, an } from "vitest/dist/reporters-MmQN-57K.js"; * v0 by Vercel. * @see https://v0.dev/t/WuNN16G0fnd * Documentation: https://v0.dev/docs#integrating-generated-code-into-your-nextjs-app - * - * + * @author Tanner Brown + * This has changed a lot since I've made it so let me redo the documentation. Renders a card with onclick/onhover functionality. "state" is poorly named. * @returns Returns a card component - * @param cardName: the actual name of the card, cardText: the description of the text on the card, - * actionCost: the cost of the card, landscapeType: the type of landscape that the card needs, - * imagePath: the location of the image for the card. this is made for spell/building cards + * @param card: the card to render. state: sets the summoning buttons state to a number that makes it true or something. setHover: changes state on the hover useState. + * essentially, it just makes the magnified card the hovered card. currentplayer: the current player (needed for making events turn exclusive). ownerPlayer: the + * player the cards are assigned to. phase: current turn phase. needed for making events phase exclusive */ function CardComponent({ card, - children, state, setHover, currentPlayer, @@ -43,14 +42,16 @@ function CardComponent({ phase: number }) { function handleClick(){ + //in future, if we add spells/buildings again there should be an if statement for activating those if(card instanceof Creature){ + // if the card being clicked belongs to the current turn player if(currentPlayer.id==ownerPlayer.id){ + // if the current phase is the main phase if(phase==0){ + //why did i make this a number instead of a boolean? am i stupid or something? state(0); } - } - // mark pos of hand } // else if (card instanceof Building){ @@ -85,10 +86,14 @@ function CardComponent({ ); } - +/** + * @author Tanner Brown + * I spoke about this in my documentation on the CreatureComponentOnBoard component. Check there for why this is a thing + * @param param0 + * @returns + */ function CardComponentOnBoard({ card, - children, setHover }: { card: Card | Creature; @@ -115,14 +120,6 @@ function CardComponentOnBoard({
{card.flavorText}
-