private void RemplirEnclosAnimal(MouseEventArgs e, Animaux a) { for (int i = 0; i < numEnclos.GetLength(0); i++) { for (int j = 0; j < numEnclos.GetLength(1); j++) { if (numEnclos[i, j] == numEnclos[e.X / 32, e.Y / 32]) { enclosAnimal[i, j] = a; } } } }
/// <summary> /// Constructeur Animal /// </summary> /// <param name="type"></param> /// <param name="x2"></param> /// <param name="y2"></param> public Animal(Animaux type, int x2, int y2) { TypeAnimal = type; x = x2; y = y2; Adulte = true; Nourri = true; Random rng = new Random(); int randomGenre = rng.Next(0, 2); Genre = randomGenre == 0; switch (TypeAnimal) { case Animaux.Lion: TempsGestation = 110; TempsAvantAdulte = 110; TempsAvantNourrir = 60; currentDir = TestTilesetZoo.TilesetImageGenerator.GetTile(44); break; case Animaux.Mouton: TempsGestation = 150; TempsAvantAdulte = 150; TempsAvantNourrir = 60; currentDir = TestTilesetZoo.TilesetImageGenerator.GetTile(45); break; case Animaux.Grizzly: TempsGestation = 220; TempsAvantAdulte = 220; TempsAvantNourrir = 60; currentDir = TestTilesetZoo.TilesetImageGenerator.GetTile(46); break; case Animaux.Rhinoceros: TempsGestation = 480; TempsAvantAdulte = 480; TempsAvantNourrir = 90; currentDir = TestTilesetZoo.TilesetImageGenerator.GetTile(47); break; case Animaux.Licorne: TempsGestation = 360; TempsAvantAdulte = 360; TempsAvantNourrir = 90; currentDir = TestTilesetZoo.TilesetImageGenerator.GetTile(48); break; case Animaux.Buffle: TempsGestation = 340; TempsAvantAdulte = 340; TempsAvantNourrir = 90; currentDir = TestTilesetZoo.TilesetImageGenerator.GetTile(49); break; } if (Genre) { AttendBebe = null; } else { AttendBebe = false; } TimePassedLastFed = 1; }