@Override
	public void setIngameTrades(List<IngameTrade> trades) {
		// info
		int tableOffset = romEntry.getValue("TradeTableOffset");
		int tableSize = romEntry.getValue("TradeTableSize");
		int nicknameLength = romEntry.getValue("TradeNameLength");
		int otLength = romEntry.getValue("TradeOTLength");
		int[] unused = romEntry.arrayEntries.get("TradesUnused");
		int unusedOffset = 0;
		int entryLength = nicknameLength + otLength + 9;
		if (entryLength % 2 != 0) {
			entryLength++;
		}
		int tradeOffset = 0;

		for (int entry = 0; entry < tableSize; entry++) {
			if (unusedOffset < unused.length && unused[unusedOffset] == entry) {
				unusedOffset++;
				continue;
			}
			IngameTrade trade = trades.get(tradeOffset++);
			int entryOffset = tableOffset + entry * entryLength;
			rom[entryOffset + 1] = (byte) trade.requestedPokemon.number;
			rom[entryOffset + 2] = (byte) trade.givenPokemon.number;
			if (romEntry.getValue("CanChangeTrainerText") > 0) {
				writeFixedLengthString(trade.nickname, entryOffset + 3,
						nicknameLength);
			}
			rom[entryOffset + 3 + nicknameLength] = (byte) (trade.ivs[0] << 4 | trade.ivs[1]);
			rom[entryOffset + 4 + nicknameLength] = (byte) (trade.ivs[2] << 4 | trade.ivs[3]);
			rom[entryOffset + 5 + nicknameLength] = (byte) trade.item;
			writeWord(entryOffset + 6 + nicknameLength, trade.otId);
			if (romEntry.getValue("CanChangeTrainerText") > 0) {
				writeFixedLengthString(trade.otName, entryOffset + 8
						+ nicknameLength, otLength);
			}
			// remove gender req
			rom[entryOffset + 8 + nicknameLength + otLength] = 0;

		}
	}