Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private IEnumerable<(int XPosition, int YPosition)> GetFreeLocations()
- {
- for (var index = 0; index < ClaimedCellsBitmap.Length; index++)
- if (!ClaimedCellsBitmap[index])
- yield return GetLocationFromIndex(index);
- }
- public (int XPosition, int YPosition) GetRandomFreeLocation()
- {
- return GetFreeLocations().ElementAt(Random.Instance.Next(GetFreeLocations().Count()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement