Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative adjacency rule? #18

Open
TheAtomAnt opened this issue Jun 22, 2021 · 1 comment
Open

Negative adjacency rule? #18

TheAtomAnt opened this issue Jun 22, 2021 · 1 comment

Comments

@TheAtomAnt
Copy link

While exploring this tool I was not yet able to find a 'negative' adjacency rule. I realize that simply not defining a rule would potentially cause it to not apply but in my case I'm not seeing a way to deal with an issue.

            var tile1 = new Tile("█");
            var tile2 = new Tile(" ");

            var model = new AdjacentModel(directions: DirectionSet.Cartesian2d);
            var tiles = new[] { tile1, tile2 };

            model.AddAdjacency(tiles, tiles, 1, 0, 0);
            model.AddAdjacency(tiles, tiles, 0, 1, 0);

            model.SetFrequency(tile1, 1);
            model.SetFrequency(tile2, .25);

What I'd like to see is a way to disable diagonal directions. Not sure if this is possible with the way the adjacency system is designed but I'll continue exploring. Currently I'm building a quick and dirty constraint to deal with this - though extending the connected constraint might be the better way to go.

Just wondering about the adjacency system and if I'm missing a negative rule, or the ability to remove a previously configured rule.

@BorisTheBrave
Copy link
Owner

I had intended that you just don't add adjacencies you don't want.

In any case, adjacency model only looks ad direct adjacencies, not diagonals, so it won't do what you want. For diagonals, you'd either need to use the overlapping model, or use a custom topology where each tile is adjacent to 8 others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants