@Override
	public ServerModel acceptTrade(AcceptTradeRequest request, CookieParams cookie) throws InvalidMovesRequest {
		if(request == null) {
			throw new InvalidMovesRequest("Error: invalid accept trade request");
		} 
		
		ServerModel serverGameModel = serverModels.get(cookie.getGameID());
		
		if (request.isWillAccept()) {

			//execute
			int sender = serverGameModel.getTradeOffer().getSender();
			int receiver = serverGameModel.getTradeOffer().getReceiver();
			int brick = serverGameModel.getTradeOffer().getOffer().getBrick();
			int ore = serverGameModel.getTradeOffer().getOffer().getOre();
			int sheep = serverGameModel.getTradeOffer().getOffer().getSheep();
			int wheat = serverGameModel.getTradeOffer().getOffer().getWheat();
			int wood = serverGameModel.getTradeOffer().getOffer().getWood();
			
			int senderBrick = serverGameModel.getPlayers().get(sender).getBrick() - brick;
			int senderOre = serverGameModel.getPlayers().get(sender).getOre() - ore;
			int senderSheep = serverGameModel.getPlayers().get(sender).getSheep() - sheep;
			int senderWheat = serverGameModel.getPlayers().get(sender).getWheat() - wheat;
			int senderWood = serverGameModel.getPlayers().get(sender).getWood() - wood;
			
			serverGameModel.getPlayers().get(sender).setBrick(senderBrick);
			serverGameModel.getPlayers().get(sender).setOre(senderOre);
			serverGameModel.getPlayers().get(sender).setSheep(senderSheep);
			serverGameModel.getPlayers().get(sender).setWheat(senderWheat);
			serverGameModel.getPlayers().get(sender).setWood(senderWood);
			
			int receiverBrick = serverGameModel.getPlayers().get(receiver).getBrick() + brick;
			int receiverOre = serverGameModel.getPlayers().get(receiver).getOre() + ore;
			int receiverSheep = serverGameModel.getPlayers().get(receiver).getSheep() + sheep;
			int receiverWheat = serverGameModel.getPlayers().get(receiver).getWheat() + wheat;
			int receiverWood = serverGameModel.getPlayers().get(receiver).getWood() + wood;
			
			serverGameModel.getPlayers().get(receiver).setBrick(receiverBrick);	
			serverGameModel.getPlayers().get(receiver).setOre(receiverOre);
			serverGameModel.getPlayers().get(receiver).setSheep(receiverSheep);
			serverGameModel.getPlayers().get(receiver).setWheat(receiverWheat);
			serverGameModel.getPlayers().get(receiver).setWood(receiverWood);
		
		}
		serverGameModel.incrementVersion();
		serverGameModel.setTradeOffer(null);
		return serverGameModel;
	}