Some games allow you to view top X cards, or put a card back at any place, and so on.
Currently, Card Zones produce their cards randomly. They know what the total list of cards is, and when asked to draw a card, it picks one completely randomly.
This means that currently, if you look at the top 3 cards of a deck, you will have to save that away somewhere and handle that very specially (i.e. draw from those cards first before you draw from the deck).
If the Card Zone is "shuffled", all saved positions should be forgotten.
Create a class, similar to CardZone, that can remember some cards in the deck, such as "top 3 cards is X", "5th card from the bottom is Y", and so on. Then when you ask the CardZone for card Z, it checks if it knows anything about that card and may either pick it randomly, or take that card away from the zone while maintaining the knowledge of all the rest of the cards.
This class can be created individually and can be posted for review.
Some games allow you to view top X cards, or put a card back at any place, and so on.
Currently, Card Zones produce their cards randomly. They know what the total list of cards is, and when asked to draw a card, it picks one completely randomly.
This means that currently, if you look at the top 3 cards of a deck, you will have to save that away somewhere and handle that very specially (i.e. draw from those cards first before you draw from the deck).
If the Card Zone is "shuffled", all saved positions should be forgotten.
Create a class, similar to
CardZone
, that can remember some cards in the deck, such as "top 3 cards is X", "5th card from the bottom is Y", and so on. Then when you ask the CardZone for card Z, it checks if it knows anything about that card and may either pick it randomly, or take that card away from the zone while maintaining the knowledge of all the rest of the cards.This class can be created individually and can be posted for review.