public static GameState MakeInitialGameState(List <Player> players, TurnCount totalRounds, GridSize gridSize, ICollisions iCollisions, IEndGame iEndGame) { var gameState = new GameState() { Round = 1, TotalRounds = totalRounds, GameOver = false, GridSize = gridSize, Players = new List <Player>(), Collisions = iCollisions, EndGame = iEndGame }; foreach (var player in players) { int x = RandomWrapper.RandomNumber(0, gameState.GridSize.Cols); int y = RandomWrapper.RandomNumber(0, gameState.GridSize.Rows); player.Destroyed = false; player.Position = new Position(x, y); gameState.Players.Add(player); } return(gameState); }
public bool Collisions(ICollisions o) => o.Rect.IntersectsWith(Rect);