//Copyright (C) 2007 SiegeLord
//See ReadMe.txt and License.txt for copying information

#include "shipregistry.h"
#include "ship.h"

vector<SShip*> g_vecRegistry;

void RegisterShip(SShip* ship)
{
	ship->ID = g_vecRegistry.size();
	g_vecRegistry.push_back(ship);
}

void UnRegisterShip(SShip* ship)
{
	g_vecRegistry[ship->ID] = 0;
}

SShip* GetShipByID(int ID)
{
	if((unsigned int)ID >= g_vecRegistry.size())
		return 0;
	return g_vecRegistry[ID];
}
