terom@296: #ifndef TYPES_HH terom@296: #define TYPES_HH terom@296: terom@296: /** terom@296: * Define various types terom@296: */ terom@296: terom@300: #include "Vector.hh" terom@300: terom@296: #include terom@296: terom@300: /* terom@300: * Standard vector used for Physics stuff terom@300: */ terom@370: typedef VectorType Vector; terom@300: terom@296: /** terom@418: * Message severity, WARN and above should go to stderr, INFO and DEBUG to stdout terom@418: * terom@418: * @see Engine::log terom@418: * @see EngineConfig::log_level terom@418: * @see Logger terom@418: */ terom@418: enum LogLevel { terom@418: FATAL, terom@418: ERROR, terom@418: WARN, terom@418: INFO, terom@418: DEBUG, terom@418: }; terom@418: terom@418: /** terom@296: * A player's health is measured in... terom@296: */ terom@296: typedef int16_t Health; terom@296: terom@296: /** terom@296: * Terrain/Graphics pixel dimension values are long ints terom@296: */ terom@296: typedef long int PixelDimension; terom@296: terom@296: /** terom@296: * A Terrain/Pixel coordinate as a PixelDimension Vector terom@296: */ terom@370: typedef VectorType PixelCoordinate; terom@296: terom@300: /** terom@410: * Dimensions of something in pixels terom@410: */ terom@410: struct PixelDimensions { terom@410: /** Item width/height */ terom@410: PixelDimension width, height; terom@410: terom@410: /** Simple constructor */ terom@410: PixelDimensions (PixelDimension width, PixelDimension height) : terom@410: width(width), height(height) terom@411: { } terom@410: }; terom@410: terom@410: /** terom@393: * A rectangular area of pixels terom@393: */ terom@393: struct PixelArea { terom@393: PixelDimension left, top, right, bottom; terom@393: terom@393: PixelArea (PixelDimension left, PixelDimension top, PixelDimension right, PixelDimension bottom) : terom@393: left(left), top(top), right(right), bottom(bottom) terom@393: { } terom@393: }; terom@393: terom@393: /** terom@300: * A time interval, measured in real milliseconds terom@300: */ terom@311: typedef signed long TimeMS; terom@300: terom@300: /** terom@300: * Abstract tick count, defined as a number of Timer::interval's against real time terom@300: */ terom@311: typedef int32_t TickCount; terom@296: terom@417: /** terom@417: * Terrain "pixel" type terom@417: * terom@417: * @see TerrainType terom@417: */ terom@417: typedef uint8_t TerrainPixel; terom@417: terom@296: #endif