FaronBracy / RogueSharp

A .NET Standard class library providing map generation, path-finding, and field-of-view utilities frequently used in roguelikes or 2D tile based games. Inspired by libtcod
https://roguesharp.wordpress.com/
MIT License
574 stars 58 forks source link

Get border cell methods on map class include the center point when near the edge of the map. #7

Closed FaronBracy closed 6 years ago

FaronBracy commented 6 years ago

Steps to reproduce: 1) Create a new map of any size 2) Call the map.GetBorderCellsInSquare(x: 0, y: 0, distance: 1) method with the given parameters

Expected results: Since we are in the corner of the map and choose a distance of 1, the border cells returned in the list should be only the following three cells: {1,0},{1,1},{0,1}

Actual results: Besides the three cells stated above, the center cell from which the border selection began is also in the list. {0,0}

FaronBracy commented 6 years ago

Fixed in https://github.com/FaronBracy/RogueSharp/pull/6