Class<? extends InfoType> typeClass = type.getTypeClass();
for(TypeFile typeFile : TypeFile.files.get(type))
{
try
{
InfoType infoType = (typeClass.getConstructor(TypeFile.class).newInstance(typeFile));
infoType.read(typeFile);
switch(type)
{
case bullet : bulletItems.add((ItemBullet)new ItemBullet((BulletType)infoType).setUnlocalizedName(infoType.shortName)); break;
case attachment : attachmentItems.add((ItemAttachment)new ItemAttachment((AttachmentType)infoType).setUnlocalizedName(infoType.shortName)); break;
case gun : gunItems.add((ItemGun)new ItemGun((GunType)infoType).setUnlocalizedName(infoType.shortName)); break;