thesadrogue / TheSadRogue.Integration

An integration library between SadConsole and GoRogue
MIT License
8 stars 5 forks source link

FOVHandlerBase Doesn't Allow Gradient Easily #75

Open Chris3606 opened 1 year ago

Chris3606 commented 1 year ago

Currently, FOVHandlerBase only calls UpdateTerrainSeen when the terrain was unseen and is now seen.

This is good default behavior, but does not support some use cases well. For example, consider a case where the user wants to apply a "gradient" to FOV based on how far a cell is from the center. Even if a cell was visible last time and is still visible this time, the distance from the center will likely change.

Therefore, I propose the following changes:

  1. FOV visibility handlers should take a flag at construction which specifies whether to call TerrainSeen on only NewlySeen cells, or on all cells in Seen. This will allow an easy way to handle the gradient type situation.
  2. Parent_PlayerFOVRecalculated should be virtual. This acts as a worst-case way for a user to use the existing code if they need to do something very custom