From 37a86b1a80e38f1e3bab0dc8058c4477113bc7e5 Mon Sep 17 00:00:00 2001 From: Dluter Date: Thu, 21 Sep 2023 19:11:28 +0800 Subject: [PATCH 1/2] :label: add card base type --- packages/domain_layer/src/card/index.ts | 1 + packages/domain_layer/src/card/type.ts | 21 +++++++++++++++++++++ packages/domain_layer/src/index.ts | 1 + 3 files changed, 23 insertions(+) create mode 100644 packages/domain_layer/src/card/index.ts create mode 100644 packages/domain_layer/src/card/type.ts diff --git a/packages/domain_layer/src/card/index.ts b/packages/domain_layer/src/card/index.ts new file mode 100644 index 0000000..b38ebc9 --- /dev/null +++ b/packages/domain_layer/src/card/index.ts @@ -0,0 +1 @@ +export * from './type'; diff --git a/packages/domain_layer/src/card/type.ts b/packages/domain_layer/src/card/type.ts new file mode 100644 index 0000000..f28ed01 --- /dev/null +++ b/packages/domain_layer/src/card/type.ts @@ -0,0 +1,21 @@ +export enum CardCreatures { + Bat = 'BAT', + Cockroach = 'COCKROACH', + Fly = 'FLY', + Toad = 'TOAD', + Rat = 'RAT', + Scorpion = 'SCORPION', + Spider = 'SPIDER', + StickBug = 'STICK_BUG', +} + +export enum CardStatus { + Unrevealed = 'UNREVEALED', + Revealed = 'REVEALED', +} + +export type Card = { + id: string; + status: CardStatus; + value: number; +}; diff --git a/packages/domain_layer/src/index.ts b/packages/domain_layer/src/index.ts index fa843d9..cb14d9f 100644 --- a/packages/domain_layer/src/index.ts +++ b/packages/domain_layer/src/index.ts @@ -1,3 +1,4 @@ export * as game from './game'; export * as round from './round'; export * as player from './player'; +export * as card from './card'; From 629b041de05f59ceeb6683acc7edf169c4f84ba6 Mon Sep 17 00:00:00 2001 From: Dluter Date: Thu, 21 Sep 2023 19:16:09 +0800 Subject: [PATCH 2/2] :label: add creatures --- packages/domain_layer/src/card/type.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/domain_layer/src/card/type.ts b/packages/domain_layer/src/card/type.ts index f28ed01..d699941 100644 --- a/packages/domain_layer/src/card/type.ts +++ b/packages/domain_layer/src/card/type.ts @@ -1,4 +1,4 @@ -export enum CardCreatures { +export enum Creatures { Bat = 'BAT', Cockroach = 'COCKROACH', Fly = 'FLY', @@ -9,13 +9,13 @@ export enum CardCreatures { StickBug = 'STICK_BUG', } -export enum CardStatus { +export enum Status { Unrevealed = 'UNREVEALED', Revealed = 'REVEALED', } export type Card = { id: string; - status: CardStatus; - value: number; + status: Status; + creature: Creatures; };