Example #1
0
void GFFLocation::read(const GFFStruct &strct) {
	_area = strct.getUint("Area");

	_position[0] = strct.getDouble("PositionX");
	_position[1] = strct.getDouble("PositionY");
	_position[2] = strct.getDouble("PositionZ");

	_orientation[0] = strct.getDouble("OrientationX");
	_orientation[1] = strct.getDouble("OrientationY");
	_orientation[2] = strct.getDouble("OrientationZ");
}
Example #2
0
void GFFVariable::read(const GFFStruct &strct, Common::UString &name) {
	clear();

	name = strct.getString("Name");

	Type type = (Type) strct.getUint("Type", kTypeNone);
	if ((type <= kTypeNone) || (type > kTypeLocation))
		throw Common::Exception("GFFVariable::read(): Unknown variable type %d", _type);

	if        (type == kTypeInt     ) {
		setInt(strct.getSint("Value"));
	} else if (type == kTypeFloat   ) {
		setFloat(strct.getDouble("Value"));
	} else if (type == kTypeString  ) {
		setString(strct.getString("Value"));
	} else if (type == kTypeObjectID) {
		setObjectID(strct.getUint("Value"));
	} else if (type == kTypeLocation) {
		_type = kTypeLocation;
		_value.typeLocation = new GFFLocation();
		_value.typeLocation->read(strct.getStruct("Value"));
	}

}