#include "ui_vehicles.h"
#include "ui_local.h"

//////////////////////////////
// vehicle template helpers //
//////////////////////////////

int VehicleTemplateArray_InitVehicleTemplateArray() {
   int i;
   for(i = 0; i < MAX_GENTITIES; i++) {
      Vehicle_InitVehicle(&(ui_vehicleTemplates[i]));
   }

   return 1;
}

int VehicleTemplateArray_OutputTemplates(int clientNum) {
   int i, j, k;
   char buffer[64];

   parser_clear_string(buffer, 64);

   //trap_SendServerCommand( clientNum, "print \"Vehicle Templates:\n\n\"" );
   //trap_SendServerCommand( clientNum, "print \"  Vehicle:\n\"" );

   for(i = 0; i < MAX_GENTITIES; i++) {
      if(ui_vehicleTemplates[i].templateNum != -1) {
         //trap_SendServerCommand( clientNum, va("print \"    Name:    %s\n\\n\"", ui_vehicleTemplates[i].vehicleInfo.vehicleName) );
         
         //trap_SendServerCommand( clientNum, va("print \"    Type:    %s\n\"", VehicleInfo_GetNameForVehicleType(g_vehicleTemplates[i].vehicleInfo.vehicleType) ) );
         //trap_SendServerCommand( clientNum, va("print \"    Weapons: \n\""));
         //trap_SendServerCommand( clientNum, va("print \"             %s\n\"", ) );
         
      }
   }
}

int VehicleTemplateArray_GetTemplateIndexForName(char *name) {
   int i;
   for(i = 0; i < MAX_GENTITIES; i++) {
      if(Q_stricmp(ui_vehicleTemplates[i].vehicleInfo.vehicleName, name) == 0)
         return i;
   }

   return -1;
}