00001
00002
00003
00004
00005
00006
00007 #pragma once
00008
00009 namespace Flatland
00010 {
00011 static const char *ShapeTable[] =
00012 {
00013 "Quad",
00014 "Line",
00015 "Circle",
00016 "Terrain",
00017 "Composite",
00018 };
00019
00020 struct Shape
00021 {
00022 enum EShape
00023 {
00024 Quad = 0,
00025 Line = 1,
00026 Circle = 2,
00027 Terrain = 3,
00028 Composite = 4,
00029 Count = 5,
00030 Invalid = 5,
00031 };
00032
00033 union
00034 {
00035 EShape name;
00036 unsigned int value;
00037 };
00038
00039 Shape(EShape name) : name(name) {}
00040 Shape(unsigned int value) : value(value) {}
00041 Shape() : value(Invalid) {}
00042 operator EShape() const { return name; }
00043 unsigned int operator++() { return ++value; }
00044 unsigned int operator++(int) { return value++; }
00045 unsigned int operator--() { return --value; }
00046 unsigned int operator--(int) { return value--; }
00047 const char *GetString() const { return ShapeTable[value]; }
00048 };
00049 }