Cards and Deck
Breaking my own rule for writing the test cases first, I sat down and wrote these classes tonight. It is obvious that I will need a control class for each and I added the idea of callbacks.
The jumpstart was caused by my own realization that I played a lot of backgammon and solitaire. I would much prefer to play my own versions and be playtesting games. But in order to write the games, I need the library done. I started on cards.
Some testing ideas: tarot, solitaire, ...
Documentation: FlagCard
Public Methods:
Deck GetOwner()
SetOwner( Deck )
bool IsShowing()
SetShowing( bool )
Flip()
GetValue()
SetValue()
GetType()
SetType()
Event Callbacks:
OnShowingChanged()
OnDeckChanged()
OnValueChanged()
OnTypeChanged()
Documentation: FlagDeck
Public Methods:
Player GetOwner()
SetOwner( Player )
Shuffle()
Card ViewCardAt(index)
bool InsertCardAt( Card, index )
Card RemoveCardAt(index)
Card ViewTopCard() - get first card (not removed)
bool Push(Card) - add card to stack (top)
Card Pop() - remove card from stack (top)
Card ViewBottomCard()
bool Unshift( Card ) - add card to stack (bottom)
Card Shift() - get last card (bottom)
IsEmpty()
GetCount()
IsViewAllowed( location )
IsInsertAllowed( location )
IsRemoveAllowed( location )
SetViewAllowed( location )
SetInsertAllowed( location )
SetRemoveAllowed( location )
Event Callbacks:
OnCardsChanged()
OnOwnerChanged()
OnRulesChanged()
Constants
DECKLOCATION_ALL
DECKLOCATION_TOP
DECKLOCATION_BOTTOM
DECKLOCATION_NONE
The jumpstart was caused by my own realization that I played a lot of backgammon and solitaire. I would much prefer to play my own versions and be playtesting games. But in order to write the games, I need the library done. I started on cards.
Some testing ideas: tarot, solitaire, ...
Documentation: FlagCard
Public Methods:
Deck GetOwner()
SetOwner( Deck )
bool IsShowing()
SetShowing( bool )
Flip()
GetValue()
SetValue()
GetType()
SetType()
Event Callbacks:
OnShowingChanged()
OnDeckChanged()
OnValueChanged()
OnTypeChanged()
Documentation: FlagDeck
Public Methods:
Player GetOwner()
SetOwner( Player )
Shuffle()
Card ViewCardAt(index)
bool InsertCardAt( Card, index )
Card RemoveCardAt(index)
Card ViewTopCard() - get first card (not removed)
bool Push(Card) - add card to stack (top)
Card Pop() - remove card from stack (top)
Card ViewBottomCard()
bool Unshift( Card ) - add card to stack (bottom)
Card Shift() - get last card (bottom)
IsEmpty()
GetCount()
IsViewAllowed( location )
IsInsertAllowed( location )
IsRemoveAllowed( location )
SetViewAllowed( location )
SetInsertAllowed( location )
SetRemoveAllowed( location )
Event Callbacks:
OnCardsChanged()
OnOwnerChanged()
OnRulesChanged()
Constants
DECKLOCATION_ALL
DECKLOCATION_TOP
DECKLOCATION_BOTTOM
DECKLOCATION_NONE
0 Comments:
Post a Comment
<< Home