added functions and tests to determine if a player has enough resources to trade