-
Notifications
You must be signed in to change notification settings - Fork 35
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
first draft of generic deck move system #462
base: main
Are you sure you want to change the base?
Conversation
Re: |
For the GameSystemLibrary question - not sure what the specific issue is, but it should be fine to create one function for the parent class and one for the child class. This is what we did for |
|
||
export interface ILookMoveDeckCardsProperties extends IPlayerTargetSystemProperties { | ||
amount: number; | ||
destinations: MoveZoneDestination[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to make this a little more complex - unfortunately we can't just pass in 'discard' as the move destination, we need to actually trigger the DiscardSpecificCard system. Two reasons:
- There might be special rules around discarding that are explicitly handled by that system (or will be in the future)
- If there are triggered abilities that react to discard, then we need to correctly emit an OnCardDiscarded event instead of a generic OnCardMoved event
In addition, we want to make it possible to provide a string name for the button so we don't have to maintain a list of all the options in this class, that's overall difficult to maintain. Much better to let the caller declare it themselves, except potentially to handle some really common defaults (which is what the subclass idea is about).
What we have used in similar situations such as e.g. the SelectInterface use the IChoicesInterface
which pairs a string name for the button with the associated action - see Ezra impl for an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately we can't just pass in 'discard' as the move destination, we need to actually trigger the DiscardSpecificCard system
This is what I am doing line 106, where I use DiscardFromDeckSystem
. Does it answer your point about using the dedicated system for Discard?
const destinations = [DeckZoneDestination.DeckTop, DeckZoneDestination.DeckBottom]; | ||
const promptTitle = 'Select card to move to the top or bottom of the deck'; | ||
super({ amount: propertiesOrPropertyFactory.amount, destinations: destinations, promptTitle: promptTitle }); | ||
} | ||
|
||
public override queueGenerateEventGameSteps(events: GameEvent[], context: TContext): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we should remove this method completely and move it entirely to the parent class. afaik the subclass has no reason to change the behavior of this
The way the ordering for top / bottom happens is that when the player clicks a button, we generate a move event for that card and push it onto a list. Then we resolve the move events in that order. So the cards are always moved in the order the player clicked the buttons. |
I am clearly no there yet but at least unit test of Inferno Four and R2D2 are working.
I am not convinced by the value of the generic method to move card from deck vs having a couple of classes dedicated to the different scenarios we may encounter (top/bottom, top/discard, ...) . But this is very softly opinionated. I'll follow your advice on this @AMMayberry1 .
For example, I am wondering if we can't handle the discard destination in MoveCardSystem and then It should be easier to create a specific class for the Top/Discard case.
I have a problem with
In gameSystemLibrary. It's not clear how to fix that between the base class and the children class
I have some difficulties creating a generic
getEffectMessage
for all the situations so I decided to not overwrite it in the base class. But maybe I should like inMoveCardSystem
and implement a complex logic. I was a bit lazzy.Finally, I am sure to understand how MoveCardSystem ensure we can choose the order of the cards we put on the top or bottom.