Created
October 6, 2019 03:19
-
-
Save IntegerMan/876b37892a7e62d0e47dc385c11d9e54 to your computer and use it in GitHub Desktop.
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
module MattEland.FSharpGeneticAlgorithm.Logic.Simulator | |
open MattEland.FSharpGeneticAlgorithm.Logic.WorldPos | |
open MattEland.FSharpGeneticAlgorithm.Logic.World | |
open MattEland.FSharpGeneticAlgorithm.Logic.Actors | |
type GameState = { World : World; Player : Actor } | |
let isValidPos pos (world: World): bool = | |
pos.X >= 1 && pos.Y >= 1 && pos.X <= world.MaxX && pos.Y <= world.MaxY | |
let hasObstacle pos (world: World) : bool = | |
world.Actors | |
|> Seq.exists(fun actor -> pos = actor.Pos) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment