コード例 #1
0
ファイル: Form1.cs プロジェクト: Agus-git/AntSimulation
        private void InitializeWorld()
        {
            Nest nest = new Nest();

            nest.Position = world.Center;
            world.Add(nest);

            for (int i = 0; i < 75; i++)
            {
                Ant ant = new Ant(nest);
                ant.Rotation = world.Random() * Math.PI * 2;
                ant.Position = nest.Position;
                world.Add(ant);
            }
            SpawnSomeFood();
        }
コード例 #2
0
 public Ant(Nest nest)
 {
     this.nest = nest;
 }