#include "allegro.h"
#include <stdio.h>
#include "UnitCreate.h"
#include "Unit.h"
#include "gameConstants.h"

#include <string>
using namespace std;


UnitCreate :: UnitCreate ()
{
  unitType = NULL;
  affiliation = affiliationNeutral;
  side = 9;
  unitCreateRule = unitCreateRulesAtTime;
  numToCreate = 0;
  timeToCreate = 0;
  enemiesToCreate = 0;
  posX = itofix (0); 
  posY = itofix (0);
  sub = subUnitNone;
  anglSet = false;
  own = NULL;
}

UnitCreate :: UnitCreate (string name, int num, int s, int cr, int t, int e, fixed px, fixed py, fixed ang, int su, Unit * origUnit)
{
  affiliation = affiliationNeutral;
  unitType = new string (name);
  numToCreate = num;
  side = s;
  unitCreateRule = cr;
  timeToCreate = t;
  enemiesToCreate = e;
  
  posX = px;
  posY = py;

  angl = ang;

  sub = su;
  own = origUnit;
}

void UnitCreate :: setAngle (fixed a)
{
  anglSet = true;
  angl = a;
}

fixed UnitCreate :: getAngle ()
{
  return angl;
}

bool UnitCreate :: angleSet ()
{
  return anglSet;
}

UnitCreate :: ~UnitCreate ()
{
}
