diff --git a/.idea/modules/app/ScienceQuest.app.iml b/.idea/modules/app/ScienceQuest.app.iml deleted file mode 100644 index d048db3..0000000 --- a/.idea/modules/app/ScienceQuest.app.iml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/android/app/src/main/java/fr/iut/sciencequest/model/dto/extensions/ScientifiqueExtensions.kt b/android/app/src/main/java/fr/iut/sciencequest/model/dto/extensions/ScientifiqueExtensions.kt new file mode 100644 index 0000000..7dd533b --- /dev/null +++ b/android/app/src/main/java/fr/iut/sciencequest/model/dto/extensions/ScientifiqueExtensions.kt @@ -0,0 +1,27 @@ +package fr.iut.sciencequest.model.dto.extensions + +import fr.iut.sciencequest.model.dto.ScientifiqueDTO +import fr.iut.sciencequest.model.metier.Scientifique + +fun ScientifiqueDTO.ToModel(): Scientifique { + val model = Scientifique( + id = this.id, + descriptif = this.descriptif, + nom = this.nom, + prenom = this.photo, + photo = this.photo, + difficulte = this.difficulte.ToModel(), + sexe = this.sexe, + ratioTrouve = this.ratioTrouve, + thematique = this.thematique.ToModel() + ) + return model +} + +fun List.ToModel(): List { + val liste = ArrayList(); + for (dto in this) { + liste.add(dto.ToModel()) + } + return liste +} \ No newline at end of file