Esempio n. 1
0
 public Ant(int startX, int startY, WorldBounds worldBounds, MovementGenerator moveGenerator)
 {
     XPos           = startX;
     YPos           = startY;
     _boundry       = worldBounds;
     _moveGenerator = moveGenerator;
 }
Esempio n. 2
0
 public Ant(int startX, int startY, WorldBounds worldBounds, MovementGenerator moveGenerator)
 {
     XPos = startX;
     YPos = startY;
     _boundry = worldBounds;
     _moveGenerator = moveGenerator;
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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();
        }
Esempio n. 6
0
        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();
        }