public GameMapGenerator(List <T> players) { if (players.Count <= 1 || players.Count > 12) { throw new ArgumentException("Number of players should be between 2 and 12!"); } _players = players; _entityFactory = new EntityFactory(); if (_players.Count == 4) { _powerUpGenerator = new DistanceBasedPowerUpGenerator(_entityFactory); } else { _powerUpGenerator = new RandomPowerUpGenerator(_entityFactory); } if (_players.Count <= 4) { MapSize = MapSizes.Small; } else if (_players.Count <= 8) { MapSize = MapSizes.Meduim; } else { MapSize = MapSizes.Large; } }
public GameMapGenerator(List <T> players, bool useRandomPowerupGenerator) : this(players) { if (useRandomPowerupGenerator) { _powerUpGenerator = new RandomPowerUpGenerator(_entityFactory); } else { _powerUpGenerator = new DistanceBasedPowerUpGenerator(_entityFactory); } }