Пример #1
0
 public BoidActionSeparation(World world,int id)
 {
     _world = world;
     _id = id;
     _flee = new BoidActionFlee();
     _wander = new BoidActionWander();
 }
Пример #2
0
        public MainPage()
        {
            InitializeComponent();
            this.MainCanvas.Children.Add(_fleeEllipse);
            _world = new WorldLogic.World(MainCanvas);
            menuControl1.World = _world;

            _timer = new GameTimer(new EventHandler(TimerCallback));

            MainCanvas.MouseMove += new MouseEventHandler(MainPage_MouseMove);

            //for (int i = 0; i < 100; i++)
            //{
            //    _world.AddWorldObject(new WorldObjectFood(2));
            //}

            //Parameters of starting simulation
            //for (int i = 0; i < 100; i++)
            //{
            //    int id = _world.AddBoid();

            //    //if (i == 0)
            //    //{
            //    //    _world.BoidList[0].Action = new BoidActionWander(id);
            //    //}
            //    //else
            //    //{
            //    //    _world.BoidList[i].Action = new BoidActionAligment(_world.BoidList[0]);
            //    //}

            //    //_world.BoidList[i].Action = new BoidActionSeparation(_world,id);

            //    _world.BoidList[i].Action = new BoidAi(id, _world);
            //}

            //_world.SetGlobalAction(WorldStatus.LookForFood);
            //_world.SetGlobalAction(WorldStatus.GlobalCohesion);
            //_world.SetGlobalAction(WorldStatus.GlobalWander);

            //_world.AddColony();
            //_world.AddColony();
        }
Пример #3
0
 public BoidActionLookFor(IWorldObject objectToLook,World world)
 {
     _objectToLookFor = objectToLook;
     _world = world;
 }
Пример #4
0
 public BoidAi(int boidID,World world)
 {
     _boidID = boidID;
     _world = world;
 }