#ifndef DARK_OBJECT_H
#define DARK_OBJECT_H
#include "DarkGDK.h"
namespace DarkObject
{
class Object // abstract
{
public:
Object();
virtual void x() = 0;
protected:
int imageID, spriteID;
};
class Rect2D
{
public:
Rect2D(int x, int y, int width, int height): x(x), y(y), width(width), height(height) {};
int GetX() const {return x;}
int GetY() const {return y;}
int GetWidth() const {return width;}
int GetHeight() const {return height;}
protected: // might be needed for inheritance, e.g. to create a square
int x, y, width, height;
};
}
#endif // DARK_OBJECT_H
#include "DarkObject.h"
int DarkObject::Object::imageID = 1;
I get:
error C2761: 'int DarkObject::Object::imageID' : member function redeclaration not allowed