Beispiel #1
0
	bool ObjectManager::load_base(ROBJECT_TYPE::ENUM type, SlkTable& table)
	{
		switch (type)
		{
		case ROBJECT_TYPE::UNIT:
			load_unit(table);
			break;
		case ROBJECT_TYPE::ITEM:
			load_item(table);
			break;
		case ROBJECT_TYPE::DESTRUCTABLE:
			load_destructable(table);
			break;
		case ROBJECT_TYPE::BUFF:
			load_buff(table);
			break;
		case ROBJECT_TYPE::DOODAD:
			load_doodad(table);
			break;
		case ROBJECT_TYPE::ABILITY:
			load_ability(table);
			break;
		case ROBJECT_TYPE::UPGRADE:
			load_upgrde(table);
			break;
		default:
			assert(false);
			return false;
		}

		return true;
	}
Beispiel #2
0
void load(openage::GameMain *game, std::string fname) {
	std::ifstream file(fname, std::ifstream::in);

	unsigned int num_chunks;
	file >> num_chunks;
	for (unsigned int c = 0; c < num_chunks; ++c) {
		coord::chunk_t ne, se;
		size_t tile_count;
		file >> ne;
		file >> se;
		file >> tile_count;
		openage::TerrainChunk *chunk = game->terrain->get_create_chunk(coord::chunk{ne, se});
		for (size_t p = 0; p < tile_count; ++p) {
			*chunk->get_data(p) = load_tile_content( file );
		}
	}

	game->placed_units.reset();
	unsigned int num_units;
	file >> num_units;
	for (unsigned int u = 0; u < num_units; ++u) {
		load_unit( file, game );
	}
}
Beispiel #3
0
void Building::load_cubeEX(FILE * file){
	fscanf(file,"%d %f\n",&rotate,&size);
	load_unit(file);
	load_building(file);
}