This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let hasInvalidlyPlacedItems (items: Actor array, maxX: int32, maxY: int32): bool = | |
let mutable hasIssues = false | |
for itemA in items do | |
// Don't allow items to spawn in corners | |
if (itemA.Pos.X = 1 || itemA.Pos.X = maxX) && (itemA.Pos.Y = 1 || itemA.Pos.Y = maxY) then | |
hasIssues <- true | |
for itemB in items do | |
if itemA <> itemB then | |
// Don't allow two objects to start next to each other | |
if isAdjacentTo itemA.Pos itemB.Pos then | |
hasIssues <- true | |
hasIssues |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment