I tried to pre-bake as much as I could so lots of references are calculated on startup such as the rules, so that all states are put into dictionary's which return the possibility's, the tiles themselves are all stored in hashsets. Its faster as an exe too.
I never thought about pre-calculating possibilities and storing them for later use. This is a great optimization technique that I'll definitely keep in mind for future projects. tks bro