@Override
	public void setEncounters(boolean useTimeOfDay,
			List<EncounterSet> encounters) {
		Iterator<EncounterSet> encsetit = encounters.iterator();

		// grass & water
		List<Integer> usedOffsets = new ArrayList<Integer>();
		int tableOffset = romEntry.getValue("WildPokemonTableOffset");
		int tableBank = bankOf(tableOffset);

		while (readWord(tableOffset) != 0xFFFF) {
			int offset = calculateOffset(tableBank, readWord(tableOffset));
			if (!usedOffsets.contains(offset)) {
				usedOffsets.add(offset);
				// grass and water are exactly the same
				for (int a = 0; a < 2; a++) {
					int rate = rom[offset++] & 0xFF;
					if (rate > 0) {
						// there is data here
						EncounterSet thisSet = encsetit.next();
						for (int slot = 0; slot < 10; slot++) {
							Encounter enc = thisSet.encounters.get(slot);
							rom[offset] = (byte) enc.level;
							rom[offset + 1] = (byte) pokeNumToRBYTable[enc.pokemon.number];
							offset += 2;
						}
					}
				}
			}
			tableOffset += 2;
		}

		// old rod
		int oldRodOffset = romEntry.getValue("OldRodOffset");
		EncounterSet oldRodSet = encsetit.next();
		Encounter oldRodEnc = oldRodSet.encounters.get(0);
		rom[oldRodOffset + 2] = (byte) oldRodEnc.level;
		rom[oldRodOffset + 1] = (byte) pokeNumToRBYTable[oldRodEnc.pokemon.number];

		// good rod
		int goodRodOffset = romEntry.getValue("GoodRodOffset");
		EncounterSet goodRodSet = encsetit.next();
		for (int grSlot = 0; grSlot < 2; grSlot++) {
			Encounter enc = goodRodSet.encounters.get(grSlot);
			rom[goodRodOffset + grSlot * 2] = (byte) enc.level;
			rom[goodRodOffset + grSlot * 2 + 1] = (byte) pokeNumToRBYTable[enc.pokemon.number];
		}

		// super rod
		if (romEntry.isYellow) {
			int superRodOffset = romEntry.getValue("SuperRodTableOffset");
			while ((rom[superRodOffset] & 0xFF) != 0xFF) {
				superRodOffset++;
				EncounterSet thisSet = encsetit.next();
				for (int encN = 0; encN < 4; encN++) {
					Encounter enc = thisSet.encounters.get(encN);
					rom[superRodOffset + 1] = (byte) enc.level;
					rom[superRodOffset] = (byte) pokeNumToRBYTable[enc.pokemon.number];
					superRodOffset += 2;
				}
			}
		} else {
			// red/blue
			int superRodOffset = romEntry.getValue("SuperRodTableOffset");
			int superRodBank = bankOf(superRodOffset);
			List<Integer> usedSROffsets = new ArrayList<Integer>();
			while ((rom[superRodOffset] & 0xFF) != 0xFF) {
				superRodOffset++;
				int setOffset = calculateOffset(superRodBank,
						readWord(superRodOffset));
				superRodOffset += 2;
				if (!usedSROffsets.contains(setOffset)) {
					usedSROffsets.add(setOffset);
					int pokesInSet = rom[setOffset++] & 0xFF;
					EncounterSet thisSet = encsetit.next();
					for (int encN = 0; encN < pokesInSet; encN++) {
						Encounter enc = thisSet.encounters.get(encN);
						rom[setOffset] = (byte) enc.level;
						rom[setOffset + 1] = (byte) pokeNumToRBYTable[enc.pokemon.number];
						setOffset += 2;
					}
				}
			}
		}
	}