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(); }
public Bee(Hive hive) { MyHive = hive; //hive.WorkStart += new EventHandler<WorkEventArgs>(DoJob); }
//public Drone(Hive hive) { // //Console.WriteLine("Drone()"); //} public Drone(Hive hive) : base(hive) { }
public Queen(Hive hive) : base(hive) { }
public static void CheckIfSuccessul(Hive hive) { Console.WriteLine(hive.StoredHoney > 110 ? "Successful" : "Not successful"); }
public Worker(Hive hive) : base(hive) { }