Refactored remaining headers in components/esm except defs.hpp.

Removed obsolete *.cpp files.
This commit is contained in:
Nikolay Kasyanov 2011-04-08 17:58:21 +04:00 committed by Pieter van der Kloet
parent 7168795ae6
commit fcfe267fc9
60 changed files with 1571 additions and 1325 deletions

View file

@ -3,7 +3,8 @@
#include "esm_reader.hpp"
namespace ESM {
namespace ESM
{
/*
* This file covers lockpicks (LOCK), probes (PROB) and armor repair
@ -12,51 +13,29 @@ namespace ESM {
struct Tool
{
struct Data
{
float weight;
int value;
struct Data
{
float weight;
int value;
float quality; // And when I say nearly identical structure, I
int uses; // mean perfectly identical except that these two
// variables are swaped for repair items. Don't ask
// me why.
}; // Size = 16
float quality; // And when I say nearly identical structure, I
int uses; // mean perfectly identical except that these two
// variables are swaped for repair items. Don't ask
// me why.
}; // Size = 16
Data data;
std::string name, model, icon, script;
Data data;
std::string name, model, icon, script;
void load(ESMReader &esm)
{
model = esm.getHNString("MODL");
name = esm.getHNString("FNAM");
esm.getSubName();
NAME n = esm.retSubName();
// The data name varies, RIDT for repair items, LKDT for lock
// picks, PBDT for probes
esm.getHT(data, 16);
if(n == "RIDT")
{
// Swap t.data.quality and t.data.uses for repair items (sigh)
float tmp = *((float*)&data.uses);
data.uses = *((int*)&data.quality);
data.quality = tmp;
}
script = esm.getHNOString("SCRI");
icon = esm.getHNOString("ITEX");
}
void load(ESMReader &esm);
};
struct Probe : Tool
struct Probe: Tool
{
};
struct Repair : Tool
struct Repair: Tool
{
};