RogueSharp 4.0 Pre-Release
Version 4.0.0-pre of RogueSharp was just released
In order to obtain pre-release versions via Nuget make sure to choose “Include prerelease” packages from the Nuget Package Manager.
Thank you to numerous contributors for this release including James Neal, flend, Glenn Hoeppner, and Courtney Strachan. Any feedback regarding this pre-release version is appreciated!
New features:
- Optimized cave map generator (Thanks to James Neal)
- DijkstraShortestPath.FindPath method which terminates upon finding destination for improved speed (Thanks to flend for this update)
- Added AppVeyor continuous builds (Thanks to Glenn Hoeppner)
- New constructors for GoalMap and PathFinder to allow for paths which include diagonal movement
- Map.GetCellsInCircle and Map.GetBorderCellsInCircle methods use midpoint circle algorithm to get cells within a radius
- Multiple new “Try” methods which work like their normal counterparts except they return null instead of throwing exceptions
- Path.TryStepForward and Path.TryStepBackward which will return null instead of throwing a NoMoreStepsException
- PathFinder.TryFindShortestPath will return null instead of throwing a PathNotFoundException
- GoalMap.TryFindPath will return null instead of throwing a PathNotFoundException
Breaking changes:
- Point and Rectangle classes are now structs (Thanks to James Neal)
- Updated all the appropriate references to Cell with ICell (Thanks to Courtney Strachan)
- Map.ComputeFov and Map.AppendFov both return a ReadonlyCollection<ICell> for the cells in the field-of-view instead of returning void.
- The Path returned from PathFinder.ShortestPath now includes the source cell in the returned Path. This behavior is consistent with how the GoalMap pathfinder works
- Map.GetCellsInArea was renamed to Map.GetCellsInSquare
- Map.GetBorderCellsInArea was renamed to Map.GetBorderCellsInSquare
- Map.GetCellsInRadius was renamed to Map.GetCellsInDiamond
- Map.GetBorderCellsInRadius was renamed to Map.GetBorderCellsInDiamond
Pathfinder Diagonal Path Example:
By using the new constructor on the PathFinder class and providing a second argument which is the cost of diagonal movement you can now return paths that consider diagonals.
GoalMap Diagonal Path Example:
The GoalMap class also received a new constructor which will allow it to use diagonals.
Map.GetCellsInCircle Example:
RogueSharp has always had a lot of different Cell selection methods as seen in this old post.
What it has been missing is a good method for getting cells in a Circle. We now have two new methods which will help with this.
Using the new circle selection code it is possible to create poor implementation of circular field-of-view even though RogueSharp doesn’t have native support for it. Here is an example of some code that will do it.
It will create field-of-view that looks like this: