AdamsLair / duality

a 2D Game Development Framework
https://adamslair.github.io/duality
MIT License
1.41k stars 288 forks source link

Extract flood fill algorithm from FillTilemapTool #627

Closed ChristianGreiner closed 6 years ago

ChristianGreiner commented 6 years ago

https://github.com/AdamsLair/duality/issues/612

Barsonax commented 6 years ago

I myself am not a big fan of static state due to its potential for all kind of nasty side effects (also it keeps it in memory forever unless you null it). It should be possible to modify the code so that static is no longer needed.

Aside from that looks clean.

Barsonax commented 6 years ago

Excuse me I meant making the buffer a instance field of TilemapFloodFill. My mistake.

ChristianGreiner commented 6 years ago

I made some changes (see last commit) @Barsonax @ilexp

ChristianGreiner commented 6 years ago

@ilexp Done 👍 Do you agree with the changes?

ilexp commented 6 years ago

@BobGneu Since this PR is primarily about extracting the algorithm implementation, I'd say all improvements to the algorithm itself are entirely optional. Merging now, but further improvements are of course appreciated!