Flatland

Documentation

SourceForge.net Logo

enums.hpp

Go to the documentation of this file.
00001 // Summary: Defines all major enumerations used in Flatland.
00002 // Copyright: 2007  Philip Rideout.  All rights reserved.
00003 // License: see source/bsd-license.txt
00004 
00005 // this file has been generated by enums.pl
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 }

Generated on Sat Jan 13 17:20:21 2007 for Flatland by doxygen 1.5.1