// I.method public Animal createAnimal(int animalCode) { Animal newAnimal = null; switch (animalCode) { case 0: newAnimal = new Kangaroo(); break; case 1: newAnimal = new Dingo(); break; case 2: newAnimal = new Crocodile(); break; case 3: newAnimal = new Koala(); break; } return(newAnimal); }
//private Dictionary<ulong, Reply> _memcache; public ReplyManager(Dingo bot, Logger logger = null) : base(bot, logger) { ReplyTimeout = TimeSpan.FromDays(1); //_memcache = new Dictionary<ulong, Reply>(16); Bot.Discord.MessageUpdated += HandleCommandsAsync; Bot.Discord.MessageDeleted += HandleMessageDelete; }
public void BeginLevel() { if (dingo == null) { dingo = GameObject.Instantiate(dingoPrefab, dingoSpawnPoint, Quaternion.identity); dingo.ReturnedFromHunt += OnDingoReturnedFromHunt; } TimeRemaining = startingGameTime; }
/// <summary> /// Adds the animal. /// </summary> /// <param name="zoo"> The zoo being added.</param> private static void AddAnimal(Zoo zoo) { // Creates a dingo with all of the inputted values. Animal animal = new Dingo("Joey", 43, 344, Gender.Male); bool success = false; AnimalType animalType = ConsoleUtil.ReadAnimalType(); animal = AnimalFactory.CreateAnimal(animalType, "null", 1, 1, Gender.Male); // Sets the name for the animal. while (!success) { try { // Gets the name and makes it upper case. animal.Name = ConsoleUtil.ReadAlphabeticValue("Name"); animal.Name = ConsoleUtil.InitialUpper(animal.Name); success = true; } catch (Exception ex) { Console.WriteLine("Value must only contain letters and spaces."); } } success = false; // Sets the gender for the animal. while (!success) { try { animal.Gender = ConsoleUtil.ReadGender(); success = true; } catch (Exception ex) { throw new Exception(ex.Message); } } success = false; // Sets the age for the animal. while (!success) { try { animal.Age = ConsoleUtil.ReadIntValue("Age"); success = true; } catch (Exception ex) { Console.WriteLine("Value must be between 0 and 100."); } } success = false; // Sets the weight for the animal. while (!success) { try { animal.Weight = ConsoleUtil.ReadDoubleValue("Weight"); success = true; } catch (Exception ex) { Console.WriteLine("Value must be between 0 and 1000."); } } zoo.AddAnimal(animal); ShowAnimal(zoo, animal.Name); }
public Manager(Dingo bot, Logger logger = null) { Bot = bot; Logger = logger ?? new Logger(GetType().Name); }
/// <summary> /// Initializes a new instance of the Zoo class. /// </summary> /// <param name="name">The name of the zoo.</param> /// <param name="capacity">The maximum number of guests the zoo can accommodate at a given time.</param> /// <param name="restroomCapacity">The capacity of the zoo's restrooms.</param> /// <param name="animalFoodPrice">The price of a pound of food from the zoo's animal snack machine.</param> /// <param name="ticketPrice">The price of an admission ticket to the zoo.</param> /// <param name="waterBottlePrice">The price of the water bottles.</param> /// <param name="boothMoneyBalance">The initial money balance of the zoo's ticket booth.</param> /// <param name="attendant">The zoo's ticket booth attendant.</param> /// <param name="vet">The zoo's birthing room vet.</param> public Zoo(string name, int capacity, int restroomCapacity, decimal animalFoodPrice, decimal ticketPrice, decimal waterBottlePrice, decimal boothMoneyBalance, Employee attendant, Employee vet) { this.animals = new List <Animal>(); this.animalSnackMachine = new VendingMachine(animalFoodPrice, new Account()); this.b168 = new BirthingRoom(vet); this.capacity = capacity; this.guests = new List <Guest>(); this.ladiesRoom = new Restroom(restroomCapacity, Gender.Female); this.mensRoom = new Restroom(restroomCapacity, Gender.Male); this.name = name; this.ticketBooth = new MoneyCollectingBooth(attendant, ticketPrice, waterBottlePrice, new MoneyBox()); this.informationBooth = new GivingBooth(attendant); // ticketPrice added to boothMoneyBalance 1.2 step 9c. this.ticketBooth.AddMoney(boothMoneyBalance + ticketPrice); //// Object Initializer. Removed via Zoo 3.2 Step 3A. ////this.animals = new List<Animal>(); ////{ //// new Chimpanzee("Bobo", 10, 128.2, Gender.Male); //// new Chimpanzee("Bubbles", 3, 103.8, Gender.Female); //// new Dingo("Spot", 5, 41.3, Gender.Male); //// new Dingo("Maggie", 6, 37.2, Gender.Female); //// new Dingo("Toby", 0, 15.0, Gender.Male); //// new Eagle("Ari", 12, 10.1, Gender.Female); //// new Hummingbird("Buzz", 2, 0.02, Gender.Male); //// new Hummingbird("Bitsy", 1, 0.03, Gender.Female); //// new Kangaroo("Kanga", 8, 72.0, Gender.Female); //// new Kangaroo("Roo", 0, 23.9, Gender.Male); //// new Kangaroo("Jake", 9, 153.5, Gender.Male); //// new Ostrich("Stretch", 26, 231.7, Gender.Male); //// new Ostrich("Speedy", 30, 213.0, Gender.Female); //// new Platypus("Patti", 13, 4.4, Gender.Female); //// new Platypus("Bill", 11, 4.9, Gender.Male); //// new Platypus("Ted", 0, 1.1, Gender.Male); //// new Shark("Bruce", 19, 810.6, Gender.Female); //// new Shark("Anchor", 17, 458.0, Gender.Male); //// new Shark("Chum", 14, 377.3, Gender.Male); //// new Squirrel("Chip", 4, 1.0, Gender.Male); //// new Squirrel("Dale", 4, 0.9, Gender.Male); //// } Animal brutus = new Dingo("Brutus", 3, 36.0, Gender.Male); Animal coco = new Dingo("Coco", 7, 38.3, Gender.Female); coco.AddChild(brutus); Animal toby = new Dingo("Toby", 4, 42.5, Gender.Male); Animal steve = new Dingo("Steve", 4, 41.1, Gender.Male); Animal maggie = new Dingo("Maggie", 7, 34.8, Gender.Female); maggie.AddChild(toby); maggie.AddChild(steve); Animal lucy = new Dingo("Lucy", 7, 36.5, Gender.Female); Animal ted = new Dingo("Ted", 7, 39.7, Gender.Male); Animal bella = new Dingo("Bella", 10, 40.2, Gender.Female); bella.AddChild(coco); bella.AddChild(maggie); bella.AddChild(lucy); bella.AddChild(ted); List <Animal> tempList = new List <Animal>(); tempList.Add(bella); tempList.Add(new Dingo("Max", 12, 46.9, Gender.Male)); // Initializes a new Cage Dictionary. this.cages = new Dictionary <Type, Cage>(); // Add new cages to the list for each animal. foreach (AnimalType t in Enum.GetValues(typeof(AnimalType))) { this.cages.Add(Animal.ConvertAnimalTypetoType(t), new Cage(400, 800)); } this.AddAnimalsToZoo(tempList); }
private void Awake() { dingo = GetComponent <Dingo>(); }
public LastManager(Dingo bot, Logger logger = null) : base(bot, logger) { bot.Discord.MessageCreated += (e) => GetLast(e.Channel).CheckAsync(e.Message); }
public ConfigurationModule(Dingo bot) { this.Bot = bot; this.Logger = new Logger("CMD-CONFIG", bot.Logger); }
public SiegeManager(Dingo bot, Logger logger = null) : base(bot, logger) { HttpClient = new HttpClient(); }
/// <summary> /// Creates a new zoo. /// </summary> /// <returns> The created zoo.</returns> public static Zoo NewZoo() { Zoo zoo = new Zoo("Como Zoo", 1000, 4, 0.75m, 15.00m, 3640.25m, new Employee("Sam", 42), new Employee("Flora", 98), 3); // Add money to the animal snack machine. zoo.AnimalSnackMachine.AddMoney(42.75m); // Define an animal variable. Animal animal; // Create a new Dingo and add him to the list of animals. animal = new Dingo("Dolly", 4, 35.3); animal.MakePregnant(); zoo.AddAnimal(animal); // Create a new Dingo and add him to the list of animals. animal = new Dingo("Dixie", 3, 33.8); animal.MakePregnant(); zoo.AddAnimal(animal); // Create a new platypus and add him to the list of animals. animal = new Platypus("Patty", 2, 15.5); animal.MakePregnant(); zoo.AddAnimal(animal); // Create a new Hummingbird and add him to the list of animals. animal = new Hummingbird("Harold", 1, 0.5); zoo.AddAnimal(animal); // Create a new chimp and add him to the list of animals. animal = new Chimpanzee("Noah", 12, 500); zoo.AddAnimal(animal); // Create a new eagle and add him to the list of animals. animal = new Eagle("Tracy", 300, 10); zoo.AddAnimal(animal); // Create a new kangaroo and add him to the list of animals. animal = new Kangaroo("Jeff", 25, 30); zoo.AddAnimal(animal); // Create a new ostrich and add him to the list of animals. animal = new Ostrich("Jake", 40, 200); zoo.AddAnimal(animal); // Create a new shark and add him to the list of animals. animal = new Shark("Max", 23, 185); zoo.AddAnimal(animal); // Create a new squirrel and them to the list. animal = new Squirrel("Matt", 21, 200); zoo.AddAnimal(animal); // Create a guest. Guest guest = new Guest("Greg", 44, 150.35m, "Brown"); // Add the guest and sell the ticket to the guest. zoo.AddGuest(guest, zoo.SellTicket(guest)); // Create a guest. guest = new Guest("Darla", 11, 25.25m, "Salmon"); // Add the guest and sell the ticket to the guest. zoo.AddGuest(guest, zoo.SellTicket(guest)); return(zoo); }
public SiegeModule(Dingo bot) { this.Bot = bot; this.Logger = new Logger("CMD-FUN", bot.Logger); }