예제 #1
0
파일: area.cpp 프로젝트: Siltala/xoreos
void Area::loadPlaceables(const Aurora::GFF3List &list) {
	for (Aurora::GFF3List::const_iterator p = list.begin(); p != list.end(); ++p) {
		Placeable *placeable = new Placeable(**p);

		loadObject(*placeable);
	}
}
예제 #2
0
파일: area.cpp 프로젝트: Siltala/xoreos
void Area::loadCreatures(const Aurora::GFF3List &list) {
	for (Aurora::GFF3List::const_iterator c = list.begin(); c != list.end(); ++c) {
		Creature *creature = new Creature(**c);

		loadObject(*creature);
	}
}
예제 #3
0
파일: area.cpp 프로젝트: clone2727/xoreos
void Area::loadTriggers(const Aurora::GFF3List &list) {
	for (Aurora::GFF3List::const_iterator c = list.begin(); c != list.end(); ++c) {
		Trigger *trigger = new Trigger(**c);

		loadObject(*trigger);
	}
}
예제 #4
0
파일: area.cpp 프로젝트: Siltala/xoreos
void Area::loadWaypoints(const Aurora::GFF3List &list) {
	for (Aurora::GFF3List::const_iterator w = list.begin(); w != list.end(); ++w) {
		Waypoint *waypoint = new Waypoint(**w);

		loadObject(*waypoint);
	}
}
예제 #5
0
파일: area.cpp 프로젝트: clone2727/xoreos
void Area::loadDoors(const Aurora::GFF3List &list) {
	for (Aurora::GFF3List::const_iterator d = list.begin(); d != list.end(); ++d) {
		Door *door = new Door(*_module, **d);

		loadObject(*door);
	}
}
예제 #6
0
void GFF3Dumper::dumpList(const Aurora::GFF3List &list) {
	if (!list.empty())
		_xml->breakLine();

	for (Aurora::GFF3List::const_iterator e = list.begin(); e != list.end(); ++e)
		dumpStruct(**e);
}
예제 #7
0
파일: area.cpp 프로젝트: clone2727/xoreos
void Area::loadTiles(const Aurora::GFF3List &tiles) {
	size_t n = 0;
	for (Aurora::GFF3List::const_iterator t = tiles.begin(); t != tiles.end(); ++t, ++n) {
		assert(n < (_width * _height));

		loadTile(**t, _tiles[n]);
	}

	assert(n == _tiles.size());
}
예제 #8
0
파일: object.cpp 프로젝트: clone2727/xoreos
void Object::readVarTable(const Aurora::GFF3List &varTable) {
	for (Aurora::GFF3List::const_iterator v = varTable.begin(); v != varTable.end(); ++v) {
		const Common::UString name  = (*v)->getString ("Name");
		const int32           type  = (*v)->getSint   ("Type");

		if (name.empty())
			continue;

		switch (type) {
			case -1:
				setVariable(name, Aurora::NWScript::Variable());
				break;

			case  1:
				setVariable(name, (int32) (*v)->getSint("Value"));
				break;

			case  2:
				setVariable(name, (float) (*v)->getDouble("Value"));
				break;

			case  3:
				setVariable(name, (*v)->getString("Value"));
				break;

			case  4:
				setVariable(name, (int32)((uint32) (*v)->getUint("Value")));
				break;

			case  5:
				warning("TODO: Object::readVarTable(), \"%s\" has location type", name.c_str());
				setVariable(name, Aurora::NWScript::Variable());
				break;

			default:
				throw Common::Exception("Unknown variable type %u (\"%s\")", type, name.c_str());
		}
	}
}
예제 #9
0
void Placeable::loadObject(const Aurora::GFF3Struct &gff) {
	// State

	_state = (State) gff.getUint("AnimationState", (uint) _state);

	// Inventory

	_hasInventory = gff.getBool("HasInventory", _hasInventory);

	if (_hasInventory && gff.hasField("ItemList")) {
		Aurora::GFF3List classList = gff.getList("ItemList");
		for (Aurora::GFF3List::const_iterator iter = classList.begin(); iter != classList.end(); ++iter) {
			const Aurora::GFF3Struct &item = **iter;
			_inventory.addItem(item.getString("InventoryRes"));
		}
	}

	// Hit Points

	_currentHitPoints = gff.getSint("CurrentHP");
	_maxHitPoints = gff.getSint("HP");

	_minOneHitPoint = gff.getBool("Min1HP");
}