1
0
forked from 0ad/0ad
0ad/source/tools/rmgen/objparse.h
Matei bd53b14f58 More work on RMS:
- Created binaries/data/mods/official/maps/random folder to store maps
and also moved rmlibrary.js to maps (though perhaps it should be
somewhere in system?).
- RM generator now uses "logical terrains" that can have units attached
to them in addition to textures, for things like forests.
- Added basic clump placer, avoid constraints, layered painter, and
random terrains (each tile is chosen between several options).
- Misc. infrastructure changes.

This was SVN commit r2378.
2005-06-06 07:46:28 +00:00

40 lines
1.1 KiB
C++

#ifndef __OBJPARSE_H__
#define __OBJPARSE_H__
#include "map.h"
#include "entity.h"
#include "constraint.h"
#include "areapainter.h"
#include "areaplacer.h"
#include "centeredplacer.h"
#include "terrain.h"
// Object type constants
const int
TYPE_RECTPLACER = 1,
TYPE_TERRAINPAINTER = 2,
TYPE_NULLCONSTRAINT = 3,
TYPE_RANDOMTERRAIN = 4,
TYPE_LAYEREDPAINTER = 5,
TYPE_AVOIDAREACONSTRAINT = 6,
TYPE_CLUMPPLACER = 7,
TYPE_EXACTPLACER = 8,
TYPE_AVOIDTERRAINCONSTRAINT = 9,
TYPE_ANDCONSTRAINT = 10,
TYPE_MULTIPLACER = 11;
// Helper functions to parse objects from array versions
JSObject* GetRaw(JSContext* cx, jsval val);
bool ParseFields(JSContext* cx, JSObject* array, const char* format, ...);
bool ParseArray(JSContext* cx, jsval val, std::vector<jsval>& ret);
AreaPainter* ParsePainter(JSContext* cx, jsval val);
AreaPlacer* ParsePlacer(JSContext* cx, jsval val);
Constraint* ParseConstraint(JSContext* cx, jsval val);
Terrain* ParseTerrain(JSContext* cx, jsval val);
CenteredPlacer* ParseCenteredPlacer(JSContext* cx, jsval val);
#endif