-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from nguyenj-c/ZooFinal
Zoo final
- Loading branch information
Showing
125 changed files
with
9,308 additions
and
3,297 deletions.
There are no files selected for viewing
Binary file renamed
BIN
+900 Bytes
..._Beta/Projet_Zoo/bin/Animaux/Aigles.class → ...tophe/Projet_Zoo/bin/Animaux/Aigles.class
Binary file not shown.
Binary file renamed
BIN
+1.74 KB
...ojet_Zoo/bin/Animaux/AnimalRegistry.class → ...ojet_Zoo/bin/Animaux/AnimalRegistry.class
Binary file not shown.
Binary file added
BIN
+4.47 KB
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/bin/Animaux/Animaux.class
Binary file not shown.
Binary file renamed
BIN
+908 Bytes
...eta/Projet_Zoo/bin/Animaux/Baleines.class → ...phe/Projet_Zoo/bin/Animaux/Baleines.class
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added
BIN
+7.54 KB
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/bin/Animaux/Loups.class
Binary file not shown.
Binary file renamed
BIN
+953 Bytes
...ps_Beta/Projet_Zoo/bin/Animaux/Ours.class → ...istophe/Projet_Zoo/bin/Animaux/Ours.class
Binary file not shown.
Binary file renamed
BIN
+952 Bytes
...ta/Projet_Zoo/bin/Animaux/Pingouins.class → ...he/Projet_Zoo/bin/Animaux/Pingouins.class
Binary file not shown.
Binary file renamed
BIN
+935 Bytes
...jet_Zoo/bin/Animaux/Poissons_Rouges.class → ...jet_Zoo/bin/Animaux/Poissons_Rouges.class
Binary file not shown.
Binary file renamed
BIN
+904 Bytes
...Beta/Projet_Zoo/bin/Animaux/Requins.class → ...ophe/Projet_Zoo/bin/Animaux/Requins.class
Binary file not shown.
Binary file renamed
BIN
+1.59 KB
...nimaux/SimulationLoups/ColonieLoups.class → ...nimaux/SimulationLoups/ColonieLoups.class
Binary file not shown.
Binary file renamed
BIN
+3.77 KB
...Animaux/SimulationLoups/CoupleLoups.class → ...Animaux/SimulationLoups/CoupleLoups.class
Binary file not shown.
Binary file renamed
BIN
+2.54 KB
...oups_Beta/Projet_Zoo/bin/Zoo/assets.class → ...n/Animaux/SimulationLoups/LoupsSpec.class
Binary file not shown.
Binary file renamed
BIN
+5.04 KB
.../Animaux/SimulationLoups/MeuteLoups.class → .../Animaux/SimulationLoups/MeuteLoups.class
Binary file not shown.
Binary file renamed
BIN
+960 Bytes
..._Beta/Projet_Zoo/bin/Animaux/Tigres.class → ...tophe/Projet_Zoo/bin/Animaux/Tigres.class
Binary file not shown.
Binary file renamed
BIN
+1.11 KB
...Zoo/bin/Enclos/Enclos$degreProprete.class → ...Zoo/bin/Enclos/Enclos$degreProprete.class
Binary file not shown.
Binary file added
BIN
+5.14 KB
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/bin/Enclos/Enclos.class
Binary file not shown.
Binary file renamed
BIN
+1.28 KB
...rojet_Zoo/bin/Enclos/EnclosAquarium.class → ...rojet_Zoo/bin/Enclos/EnclosAquarium.class
Binary file not shown.
Binary file added
BIN
+1.6 KB
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/bin/Enclos/EnclosLoups.class
Binary file not shown.
Binary file added
BIN
+1.72 KB
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/bin/Enclos/EnclosRegistry.class
Binary file not shown.
Binary file renamed
BIN
+974 Bytes
...rojet_Zoo/bin/Enclos/EnclosVolieres.class → ...rojet_Zoo/bin/Enclos/EnclosVolieres.class
Binary file not shown.
Binary file added
BIN
+7.79 KB
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/bin/Game/Menu/menuAnimaux.class
Binary file not shown.
Binary file added
BIN
+973 Bytes
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/bin/Game/Menu/menuEmploye.class
Binary file not shown.
Binary file added
BIN
+10.6 KB
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/bin/Game/Menu/menuEnclos.class
Binary file not shown.
Binary file added
BIN
+6.66 KB
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/bin/Game/Menu/menuLoups.class
Binary file not shown.
Binary file added
BIN
+5.01 KB
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/bin/Game/Menu/menuZoo.class
Binary file not shown.
Binary file added
BIN
+4.09 KB
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/bin/Game/initGame.class
Binary file not shown.
Binary file renamed
BIN
+627 Bytes
...Loups_Beta/Projet_Zoo/bin/Game/main.class → ...Christophe/Projet_Zoo/bin/Game/main.class
Binary file not shown.
Binary file added
BIN
+3.46 KB
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/bin/Zoo/Employe.class
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
Khalil_Mohamed-Nguyen_Jean-Christophe/Projet_Zoo/src/Animaux/AnimalRegistry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* @author Nguyen, Khalil | ||
* | ||
*/ | ||
package Animaux; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public final class AnimalRegistry { | ||
|
||
private static final Map<Class<? extends Animaux>, List<Animaux>> ANIMAL_REGISTRY = new HashMap<>(); | ||
|
||
/** | ||
* Ajoute l'animal au registre | ||
* | ||
* @param animal à enregistrer | ||
*/ | ||
public static void registerAnimal(Animaux animal) { | ||
if (animal == null) | ||
return; | ||
|
||
assertClassExists(animal.getClass()); | ||
ANIMAL_REGISTRY.get(animal.getClass()).add(animal); | ||
} | ||
|
||
/** | ||
* Enlève l'animal du registre | ||
* | ||
* @param animal à supprimer du registre | ||
*/ | ||
public static void unregisterAnimal(Animaux animal) { | ||
if (animal != null && ANIMAL_REGISTRY.containsKey(animal.getClass())) { | ||
ANIMAL_REGISTRY.get(animal.getClass()).remove(animal); | ||
} | ||
} | ||
|
||
private static void assertClassExists(Class<? extends Animaux> especes) { | ||
ANIMAL_REGISTRY.putIfAbsent(especes, new ArrayList<>()); | ||
} | ||
|
||
/** | ||
* Renvoie la liste d'animaux par classe | ||
* | ||
* @param especes type d'animaux | ||
* @return List | ||
*/ | ||
public static List<Animaux> getRegisteredAnimalsByClass(Class<? extends Animaux> especes) { | ||
if (especes != null && ANIMAL_REGISTRY.containsKey(especes)) { | ||
return ANIMAL_REGISTRY.get(especes); | ||
} | ||
return null; | ||
} | ||
} |
Oops, something went wrong.