1
0

Prefabs support connectors, rotations and merge strategy.

This commit is contained in:
madmaxoft
2014-03-26 22:01:01 +01:00
parent 1b00b62a4b
commit 8c2c4f2463
2 changed files with 72 additions and 3 deletions

View File

@@ -33,13 +33,18 @@ public:
int m_SizeZ;
const char * m_CharMap;
const char * m_Image;
// TODO: Connectors
const char * m_Connectors;
int m_AllowedRotations;
cBlockArea::eMergeStrategy m_MergeStrategy;
};
cPrefab(const sDef & a_Def);
/** Draws the prefab into the specified block area, according to the placement stored in the PlacedPiece. */
void Draw(cBlockArea & a_Dest, const cPlacedPiece * a_Placement);
/** Returns true if the prefab has any connector of the specified type. */
bool HasConnectorType(int a_ConnectorType) const;
protected:
/** Maps letters in the sDef::m_Image onto a number, BlockType * 16 | BlockMeta */
@@ -76,6 +81,9 @@ protected:
/** Parses the Image in the definition into m_BlockArea's block types and metas, using the specified CharMap. */
void ParseBlockImage(const CharMap & a_CharMap, const char * a_BlockImage);
/** Parses the connectors definition text into m_Connectors member. */
void ParseConnectors(const char * a_ConnectorsDef);
};