1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

ObjDefManager, Mapgen SAPI: Huge refactoring

- General code cleanup
 - Unified object creation and loading
 - Specifying objects in APIs is now orthogonal (i.e. anything can take an ID,
   name string, or the raw table definition (and automatically registers if present
This commit is contained in:
kwolekr 2015-03-31 23:27:19 -04:00
parent d1d5618bb8
commit 337e79c656
8 changed files with 319 additions and 171 deletions

View file

@ -39,10 +39,10 @@ class MMVManip;
enum OreType {
ORE_TYPE_SCATTER,
ORE_TYPE_SHEET,
ORE_TYPE_BLOB,
ORE_TYPE_VEIN,
ORE_SCATTER,
ORE_SHEET,
ORE_BLOB,
ORE_VEIN,
};
extern FlagDesc flagdesc_ore[];
@ -122,16 +122,16 @@ public:
return "ore";
}
Ore *create(int type)
static Ore *create(OreType type)
{
switch (type) {
case ORE_TYPE_SCATTER:
case ORE_SCATTER:
return new OreScatter;
case ORE_TYPE_SHEET:
case ORE_SHEET:
return new OreSheet;
case ORE_TYPE_BLOB:
case ORE_BLOB:
return new OreBlob;
case ORE_TYPE_VEIN:
case ORE_VEIN:
return new OreVein;
default:
return NULL;