src/Types.hh
author Tero Marttila <terom@fixme.fi>
Tue, 13 Jan 2009 23:15:47 +0200
changeset 393 5dd4d782cf3a
parent 370 39e59dd36b6e
child 410 41fd46cffc52
permissions -rw-r--r--
a basic implementation of game messages, plus some weird GameStateEvent stuff
#ifndef TYPES_HH
#define TYPES_HH

/**
 * Define various types
 */

#include "Vector.hh"

#include <stdint.h>

/* 
 * Standard vector used for Physics stuff
 */
typedef VectorType<float> Vector;

/**
 * A player's health is measured in...
 */
typedef int16_t Health;

/**
 * Terrain/Graphics pixel dimension values are long ints
 */
typedef long int PixelDimension;

/**
 * A Terrain/Pixel coordinate as a PixelDimension Vector
 */
typedef VectorType<PixelDimension> PixelCoordinate;

/**
 * A rectangular area of pixels
 */
struct PixelArea {
    PixelDimension left, top, right, bottom;

    PixelArea (PixelDimension left, PixelDimension top, PixelDimension right, PixelDimension bottom) :
        left(left), top(top), right(right), bottom(bottom)
    { }
};

/**
 * A time interval, measured in real milliseconds
 */
typedef signed long TimeMS;

/**
 * Abstract tick count, defined as a number of Timer::interval's against real time
 */
typedef int32_t TickCount;

#endif