Zachary Reyes / Lab4_gnuarmeclipse_lpc1768

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Sprite.h Source File

Sprite.h

00001 #pragma once
00002 
00003 class Sprite
00004 {
00005 public:
00006     enum enDIRECTIONS {NO_DIR, UP_DIR, DOWN_DIR, LEFT_DIR, RIGHT_DIR};
00007     // Default Constructor
00008     Sprite();
00009     // Constructor
00010     Sprite(enDIRECTIONS inDir, unsigned int inRow, unsigned int inCol);
00011     
00012     virtual ~Sprite(){};
00013     
00014     void SetDesiredDirectionToMove(enDIRECTIONS dir);
00015     
00016     virtual void SetLocation(const int &nRow, const int &nCol) {m_RowPos=nRow;m_ColPos=nCol;};
00017     
00018     virtual void Move() = 0;
00019     virtual bool IsMoveAllowed(const int &nNewRow, const int &nNewCol) = 0;
00020     virtual int GetImageIndex() {return (m_nActiveImage++)%2;}
00021  
00022 protected:
00023     
00024     enDIRECTIONS m_CurrentDirection;
00025     enDIRECTIONS m_DesiredDirection;
00026     
00027     unsigned int m_RowPos;
00028     unsigned int m_ColPos;
00029     int m_nActiveImage;   
00030     
00031     
00032 };