1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

ToolDefinition serialization

This commit is contained in:
Perttu Ahola 2011-11-14 23:39:32 +02:00
parent e9620d9c8c
commit 8d2d28f1dc
2 changed files with 67 additions and 14 deletions

View file

@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define TOOLDEF_HEADER
#include <string>
#include <iostream>
/*
TODO: Rename to tooldef.h
@ -40,19 +41,9 @@ struct ToolDiggingProperties
float dd_crumbliness;
float dd_cuttability;
ToolDiggingProperties(float a=0.75, float b=0, float c=0, float d=0, float e=0,
float f=50, float g=0, float h=0, float i=0, float j=0):
basetime(a),
dt_weight(b),
dt_crackiness(c),
dt_crumbliness(d),
dt_cuttability(e),
basedurability(f),
dd_weight(g),
dd_crackiness(h),
dd_crumbliness(i),
dd_cuttability(j)
{}
ToolDiggingProperties(
float a=0.75, float b=0, float c=0, float d=0, float e=0,
float f=50, float g=0, float h=0, float i=0, float j=0);
};
struct ToolDefinition
@ -66,6 +57,10 @@ struct ToolDefinition
imagename(imagename_),
properties(properties_)
{}
std::string dump();
void serialize(std::ostream &os);
void deSerialize(std::istream &is);
};
class IToolDefManager