Drawing isometric world, where objects are not rotated is quite straightforward and is discussed here:
Simple method, is to take ground collision rectangle of every object, and sort it by it's center (vertical coordinate on screen primary)
But in situation, with diagonal object on the screen for example - locomotive or fence in the game, and it can rotate! Objects ground collision shapes of objects A B and C
Without the object C, it is quite simple, first we draw object B (as it is higher) and A after that.
With C in mind, we need to draw object A first, then object B and lastly C (exactly opposite order in this case here).
But how to define the correct sorting operator (or other way of sorting), that would order images/objects to be drawn correctly?