title: C++ Searching for occupied fields in 2d map
body: <p>I have a 2d map in my rts. On the map there are some units. I want to check if there is any unit in range of another. The units range is given in fields. See the image:</p>
  
  <p><img src="https://i.stack.imgur.com/mc2CL.png" alt="Ranges"></p>
  
  <p>On the pic none of units (red, blue, green) can attack each other. I want to, for example check, for example if there is any units in range of blue. The answer is no. I know the blue's range and position, I also know positions of the rest. I also know if the map xy is occupied. How can I check this?</p>