/////////////////////////////////////////////////////////////////////
// File: Mech.h                                                    //
// Date: 19/6/08                                                   //
// Desc: Defines a Mech object. Mech's are the machines that a     //
//       player uses. This class contains images & data for Mechs. //
//       A Mech is a robot a bit bigger than a human, roughly 3    //
//       meters in height.                                         //
//                                                                 //
/////////////////////////////////////////////////////////////////////

#ifndef MECH_H
#define MECH_H

#include "ballistic/include.h"
#include "graphics/GLImage.h"
#include "graphics/GLAnimation.h"

#define MAX_HEALTH  200   // Maximum health a Mech can have
#define MIN_SPEED   2.0f  // Units: meters per second
#define MAX_SPEED   6.0f

class Mech {
public:
    static QList<Mech*> mechs;  // List of all Mechs
    static void loadMechs();    // Load Mechs from file
    static Mech* createMech(String name);
    static Mech* createMech(int num);

    // Mech images/animations - there is an anim for each
    // action and a mask for putting the team colour on
    GLImage *armImg, *armMask;
    GLAnimation *walkAnim, *walkMask;
    GLAnimation *jumpAnim, *jumpMask;
    QPoint armPos;       // Position of arm on mech
    QPoint armPivot;     // Position of pivot point on arm
    QPoint hand;         // Position for weapon
    QRect bounds;        // Bounding box

    // Stats - common to all instances but can be changed
    //(i.e. if the player picks up a health "power-up")
    String name, description;
    GLImage* preview;
    int maxHealth;           // Maximum health (strength): [1-200]
    float maxSpeed;          // Maximum speed (m/s)
    int mass;                // Mass of the mech (kg)

    Mech() : maxHealth(100), maxSpeed(5), mass(1000) {}
    Mech(const Mech& copy);
    ~Mech();
    void load(String filename);
};

#endif  // MECH_H