public static int[] CreateGroundLevels(IntentionGrid grid) { var floorHeight = 2.0; var groundLevels = new int[(int)Math.Floor((grid.Height - 2) / floorHeight)]; for (var i = 0; i < groundLevels.Count(); i++) { groundLevels[i] = (int)Math.Floor((i) * (grid.Height - 2) / (float)groundLevels.Count()); groundLevels[i] += (int)floorHeight; } for (var x = 1; x < grid.Width - 1; x++) { for (var y = 0; y < grid.Height; y++) { if (groundLevels.Any(gl => gl == y)) { grid.Positions[x, y].Intentions.Add(Intention.GroundLevelIntention()); } } } DebugPrintMeaning(grid, Meaning.GroundLevel); return(groundLevels); }