Hands-on Rust: can_place logic is "inside out"

Hi, is stumbled upon the same issue but made some different design decisions: to place the fortress, only two basic conditions must be fulfilled: the area must be reachable (at least one tile has a Dijkstra distance < 2000) and it should be a minimal distance far away (I changed the original 20 to 50, actually the ideal value depends on the type of map).

I don’t try to place the fortress around or at the original amulet position assuming that the second architect is smarter than the first. :wink:

Once the fortress is placed, the amulet is relocated to a position within the fortess that is designated in the fortress template with an ‘A’. Otherwise I leave the amulet where the original architect placed it.

Additionally in case of a fortress placement, I cleared the (original architect’s) monsters and re-spawned them. This is to make sure that there is no monster on a fortress wall. Maybe removing unwanted monsters from the spawn vector one by one is more efficient…

In general I feel that running one architect after the other is somewhat wrong (similar to do this when you build a house). The second architect has to remove things that the first architect has already build. I think that it would be better that the first architect subcontracts the second at the right stage in buidling (e.g. before placing monsters or the amulet).

But I’m going sequentially through the book and soe things might clear up later…

Regards,
TR
P.S.: I also was forced to build a function that dumps the map to the console and also outlines a given Rect on it, debugging the stuff was quite tedious…