12345678910111213141516171819202122232425262728293031323334 |
- #ifndef _CARD_
- #define _CARD_
- #include <stdio.h>
- #include "anim.h"
- /* Card
- * To use this class, there must be a pointer that points to Card.
- * Give pointer's address to static card double pointer (below).
- * Initialize pointer to point to a Card's subclass.
- * Use the pointer for input, update and drawing, the subclasses will
- * take care of changing which card it points to.
- */
- class Card
- {
- public:
- //Pointer to current card pointer
- static Card *card;
- //Card lifecycle
- Card();
- virtual ~Card() {}
- virtual void input(unsigned char key, bool pressed) = 0;
- virtual void update() = 0;
- virtual void draw();
- protected:
- //Card animation (from one card to another)
- Animation anim;
- };
- #endif
|