Skip to content

Commit

Permalink
#CustomDecks
Browse files Browse the repository at this point in the history
- renamed Types to include I
  • Loading branch information
CheBato committed Dec 11, 2024
1 parent 181cf72 commit 8064acb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/app/_components/Gameboard/GameboardTypes.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ICardData } from "@/app/_components/_sharedcomponents/Cards/CardTypes";

export type ParticipantType = "player" | "opponent";
export type IParticipantType = "player" | "opponent";

export interface IParticipant {
id: string;
name: string;
type: ParticipantType;
type: IParticipantType;
initiative: boolean | null;
deckSize: number;
cards: ICardData[];
Expand Down
4 changes: 2 additions & 2 deletions src/app/_components/HomePage/HomePageTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface IPublicGamesProps {
format: string;
}

export type Article = {
export type IArticle = {
title: string;
content: string;
date: string;
Expand All @@ -26,5 +26,5 @@ export type Article = {
};

export interface INewsItemProps {
article: Article;
article: IArticle;
}
4 changes: 2 additions & 2 deletions src/app/_constants/mockData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Article } from "@/app/_components/HomePage/HomePageTypes";
import { IArticle } from "@/app/_components/HomePage/HomePageTypes";

export const playerMatches = [
{
Expand Down Expand Up @@ -83,7 +83,7 @@ export const playerMatches = [
},
];

export const articles: Article[] = [
export const articles: IArticle[] = [
{
title: "Welcome to the Karabast Beta!",
content: `
Expand Down
8 changes: 4 additions & 4 deletions src/app/_utils/s3Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ interface IServerDeckData {
}

// types of mapping
type Mapping = {
type IMapping = {
[id:string]: string;
}
type idToInternalNameMapping = {
type IIdToInternalNameMapping = {
"id": string,
"internalName": string,
"title": string,
Expand All @@ -80,7 +80,7 @@ export const s3CardImageURL = (card: ICardData) => {


// Helper function to update a card's id
export const updateIdsWithMapping = (data: IDeckData, mapping: Mapping): IDeckData => {
export const updateIdsWithMapping = (data: IDeckData, mapping: IMapping): IDeckData => {

const updateCard = (card: IDeckCard): IDeckCard => {
const updatedId = mapping[card.id] || card.id; // Use mapping if available, else keep the original id
Expand All @@ -99,7 +99,7 @@ export const updateIdsWithMapping = (data: IDeckData, mapping: Mapping): IDeckDa

// Helper function to update a cards id to its internal name
export function mapIdToInternalName(
mapper: idToInternalNameMapping[],
mapper: IIdToInternalNameMapping[],
deckData: IDeckData
): IDeckData {
// Convert the mapper array to a lookup map for faster access
Expand Down

0 comments on commit 8064acb

Please sign in to comment.