I'm doing a basic card game to try to teach myself OOP in BlitzMax. To begin with I just want very basic functionality, such as the abillity to deal cards to players and shuffel the deck. I just need some pointers to see if I'm going about this the right way.
The way I'm thinking of doing it is have a type called TCard, for every card and initalize it with all 52 cards of the deck at the start of the game. Then have a type called TCardHolder, with a field that can contain TCard objects. TCardHolder would then have several derived types such as TPlayer, TOpponent, TDeck, TDiscardPile and so on.
The idea is that the TCard objects can get passed around between the different TCardHolder objects (players,deck etc.). So that I can tell a deck object to deal five cards to a player. It will then take the top five card objects in it's TList field and give them to that player (i.e. add the to the TList of that player and remove them from it's own).
Would this be a logical way to do it?
Ragnar
The way I'm thinking of doing it is have a type called TCard, for every card and initalize it with all 52 cards of the deck at the start of the game. Then have a type called TCardHolder, with a field that can contain TCard objects. TCardHolder would then have several derived types such as TPlayer, TOpponent, TDeck, TDiscardPile and so on.
The idea is that the TCard objects can get passed around between the different TCardHolder objects (players,deck etc.). So that I can tell a deck object to deal five cards to a player. It will then take the top five card objects in it's TList field and give them to that player (i.e. add the to the TList of that player and remove them from it's own).
Would this be a logical way to do it?
Ragnar