Last active
December 15, 2015 20:29
-
-
Save i8degrees/5318675 to your computer and use it in GitHub Desktop.
Final Draft of TTcards Card Objects Design
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Card | |
{ | |
unsigned int id; | |
unsigned int level; // 1..10 | |
unsigned int type; | |
unsigned int element; | |
unsigned int power[4]; // clockwise; top, right, down, left | |
std::string name; | |
// Card ( id, level, type, element, power[], name ); | |
// getID(); | |
// getLevel(); | |
// getType(); | |
// getElement(); | |
// getRank(); | |
// getName(); | |
}; | |
class CardFace | |
{ | |
public: | |
// CardFace ( Card *card ); | |
// draw ( int x, int y, SDL_Surface *video_buffer ); | |
// bool flipCard (); | |
private: | |
int id; | |
int x; | |
int y; | |
int w = CARD_WIDTH; | |
int h = CARD_HEIGHT; | |
Card *card; | |
//Sprite card; | |
}; | |
class Pile: public Card | |
{ | |
public: | |
// ... | |
bool load_data ( std::string filename ); | |
add(Card *card); | |
create(); // initialize stack | |
shuffle(); // randomize pile | |
getNext(); | |
list(); | |
std::vector<Card> stack; | |
private: | |
// ... | |
}; | |
class Deck: public Pile | |
{ | |
public: | |
// virtual Add (Card *card ); | |
// virtual create(); | |
// virtual shuffle(); | |
// virtual getNext(); | |
// virtual list(); | |
}; | |
Author
i8degrees
commented
Apr 5, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment