Esempio n. 1
0
        static void Main(string[] args)
        {
            Hive hive1 = new Hive();

            Console.WriteLine("Life of hive1 has started");
            for (int i = 0; i < 10; i++)
            {
                hive1.Tick();
                Console.WriteLine(hive1.BeesAmount);
                HiveUtils.CheckIfSuccessul(hive1);
                Console.ReadKey();
            }
            Console.WriteLine("Life of hive1 has ended");
            Queen directQueen = new Queen();
            Hive  hive2       = new Hive(directQueen);

            Console.WriteLine("Life of hive2 has started");
            for (int i = 0; i < 10; i++)
            {
                hive2.Tick();
                Console.WriteLine(hive2.BeesAmount);
                HiveUtils.CheckIfSuccessul(hive2);
                Console.ReadKey();
            }
            Console.WriteLine("Life of hive2 has ended");

            var    arg = new WorkEventArgs(true);
            Worker w   = new Worker();

            try
            {
                w.DoJob(null, arg);
            }
            catch (HiveNotFoundException <HiveNotFoundExceptionArgs> e)
            {
                Console.WriteLine(e.Message);
            }

            Console.ReadKey();
        }
Esempio n. 2
0
File: Bee.cs Progetto: TGIfr/courses
 public Bee(Hive hive)
 {
     MyHive = hive;
     //hive.WorkStart += new EventHandler<WorkEventArgs>(DoJob);
 }
Esempio n. 3
0
        //public Drone(Hive hive)  {
        //    //Console.WriteLine("Drone()");
        //}

        public Drone(Hive hive) : base(hive)
        {
        }
Esempio n. 4
0
 public Queen(Hive hive) : base(hive)
 {
 }
Esempio n. 5
0
 public static void CheckIfSuccessul(Hive hive)
 {
     Console.WriteLine(hive.StoredHoney > 110 ? "Successful" : "Not successful");
 }
Esempio n. 6
0
 public Worker(Hive hive) : base(hive)
 {
 }