コード例 #1
0
ファイル: Ant.cs プロジェクト: neurobug/AntsSimulator
 public Ant(int startX, int startY, WorldBounds worldBounds, MovementGenerator moveGenerator)
 {
     XPos           = startX;
     YPos           = startY;
     _boundry       = worldBounds;
     _moveGenerator = moveGenerator;
 }
コード例 #2
0
ファイル: Ant.cs プロジェクト: Kanpai888/AntsSimulator
 public Ant(int startX, int startY, WorldBounds worldBounds, MovementGenerator moveGenerator)
 {
     XPos = startX;
     YPos = startY;
     _boundry = worldBounds;
     _moveGenerator = moveGenerator;
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #5
0
ファイル: AntForm.cs プロジェクト: Kanpai888/AntsSimulator
        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();
        }
コード例 #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();
        }