From 36a48392a02befe6f82dafdbb60dd5151e5b417c Mon Sep 17 00:00:00 2001 From: zergetaev Date: Fri, 10 Jan 2020 14:50:38 +0300 Subject: [PATCH] Update Entity def. --- README.md | 20 ++++++++++++-------- src/models/Card.ts | 1 - src/models/Entity.ts | 3 ++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7ef1c54..9dc1b4e 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ Built for educational purposes only. Your contributions are welcome 😉 * [ ] Secret * [ ] Quest * [ ] Sidequest + * [ ] Enchantment + * [ ] Aura * [x] Zones * [x] Play * [x] Hand @@ -43,31 +45,33 @@ Built for educational purposes only. Your contributions are welcome 😉 * [ ] Stealth (needs targeting improvements) * [ ] Poisonous * [ ] Divine shield +* [ ] Choosing a deck * [ ] Card targeting requirements ### Visual -* [x] Card rendering (basic) +* [x] Card rendering + * [x] Basic * [ ] Use [Sunwell](https://github.com/HearthSim/Sunwell)? -* [x] Drag & Drop cards(react-dnd) - * [x] Touch screens support +* [x] Drag & Drop cards (`react-dnd`) + * [x] Touch screen support * [ ] Fix minion death animation bug (#10) ### Technical * [ ] Merge all game entities into `game.entities` (?) * [ ] Tests * [ ] [Sequences](https://hearthstone.gamepedia.com/Advanced_rulebook#Advanced_mechanics_101_.28READ_THIS_FIRST.29) (will require major refactoring) -* [ ] Load cards from https://hearthstonejson.com/ +* [ ] Load cards from https://hearthstonejson.com * [ ] Save/Load * [ ] LocalStorage * [ ] File system -* [ ] ~~Multiplayer~~ * [ ] Triggers +* [ ] ~~Multiplayer~~ ## Project structure * `src/models` contains game models' type declarations and some helper functions. -* `src/redux` contains contains actual game logic, using Redux and decoupled from UI rendering. - It is highly recommended to use [redux-devtools](https://github.com/reduxjs/redux-devtools) for debugging. -* `src/UI` is a React implementation of Game UI. +* `src/redux` contains the actual game logic, using **Redux** and decoupled from UI rendering. + It is highly recommended to use [redux-devtools](https://github.com/reduxjs/redux-devtools) Chrome extension for debugging. +* `src/UI` is a **React**-based implementation of Game's UI. ## Development $ yarn && yarn start diff --git a/src/models/Card.ts b/src/models/Card.ts index c84bbd1..03f3c10 100644 --- a/src/models/Card.ts +++ b/src/models/Card.ts @@ -7,7 +7,6 @@ import { CardContainer } from "./Container"; import { Game } from "./Game"; import { canSpendMana, Player } from "./Player"; -// TODO: deprecate in favor of Entity? export type Card = Character | Weapon | HeroPower; // FIXME diff --git a/src/models/Entity.ts b/src/models/Entity.ts index fd05354..e06af0e 100644 --- a/src/models/Entity.ts +++ b/src/models/Entity.ts @@ -7,8 +7,9 @@ import { HeroPower } from "./HeroPower"; import { Hero } from "./Hero"; import { CardType } from "./enums"; import { Minion } from "./Minion"; +import { Card } from "./Card"; -export type Entity = Player | Character | Weapon | HeroPower; +export type Entity = Player | Card; export type EntityContainer = Container; export type EntityPayload = {}> = T & { id: number;