public Ant(int startX, int startY, WorldBounds worldBounds, MovementGenerator moveGenerator) { XPos = startX; YPos = startY; _boundry = worldBounds; _moveGenerator = moveGenerator; }
public WorldManager(WorldBounds worldBounds, MovementGenerator moveGenerator) { _worldBounds = worldBounds; _moveGenerator = moveGenerator; _random = new Random(); _ants = new List <Ant>(); _foodSources = new List <FoodSource>(); _nests = new List <Nest>(); _worldGrid = new WorldGrid(_numXGridBlocks, _numYGridBlocks, worldBounds); }
public WorldManager(WorldBounds worldBounds, MovementGenerator moveGenerator) { _worldBounds = worldBounds; _moveGenerator = moveGenerator; _random = new Random(); _ants = new List<Ant>(); _foodSources = new List<FoodSource>(); _nests = new List<Nest>(); _worldGrid = new WorldGrid(_numXGridBlocks, _numYGridBlocks, worldBounds); }
public AntForm() { InitializeComponent(); // Assume 1 to 1 pixel mapping for now WorldBounds bounds = new WorldBounds(drawingArea.Size.Width, drawingArea.Size.Height); MovementGenerator moveGenerator = new MovementGenerator(new Random()); _worldManager = new WorldManager(bounds, moveGenerator); _worldManager.GenerateWorld(_numOfAnts); drawingArea.MouseClick += OnDrawingAreaMouseClick; SetupDrawLoop(); }