Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle all card logic #9

Open
dkniffin opened this issue Feb 3, 2017 · 1 comment
Open

Handle all card logic #9

dkniffin opened this issue Feb 3, 2017 · 1 comment

Comments

@dkniffin
Copy link
Owner

dkniffin commented Feb 3, 2017

For the mvp, the plan is to have the players deal with most of the logic of the cards in the deck. For 1.0, ideally all of the cards in the horde deck would handle themselves, and the players would only need to do things manually if they play something from their decks that affects the horde's board.

The way I foresee this working is having a function defined for each card, that gets triggered at each possible trigger point, and it will dispatch events depending on what it does.

@dkniffin dkniffin added this to the 1.0 milestone Feb 3, 2017
@dkniffin
Copy link
Owner Author

dkniffin commented Feb 6, 2017

I thought about this a bit more over the weekend, and came up with a few ideas for how to do this. Not sure if any of these will pan out, but they're things to think about

  1. Right now, the cards are javascript objects. (ie {name: 'blah'}). I wonder if we could change this so we have a javascript class called Card, and make them be instances of that. Then, we can functions for the various triggers, like enterBattlefield, destroyed, entersGraveyard, etc. I'm not sure if we could store those in the state or not.
  2. One way we can trigger these events is to have something subscribed to the event state, like the view does, and calling the appropriate functions for each card. No idea if this is possible or not.
  3. If 2 is not possible, we can wrap each dispatch event in a function for that dispatch, and it can call the appropriate methods at action time.

@dkniffin dkniffin removed this from the 1.0 milestone Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant