root / GES_PAC / Model / SerieAnimal.cs @ 12ddf7ef
Historique | Voir | Annoter | Télécharger (1,262 ko)
1 | 65ad7e66 | Lucas Bihannic | |
---|---|---|---|
2 | 9fd69a0e | lbihannic | using Microsoft.Maui.Layouts; |
3 | |||
4 | 65ad7e66 | Lucas Bihannic | namespace GES_PAC.Model |
5 | { |
||
6 | public class SerieAnimal |
||
7 | { |
||
8 | public long Id { get; set; } |
||
9 | public int NumeroBoite { get; set; } |
||
10 | public double Poids { get; set; } |
||
11 | ba296a27 | lbihannic | public DateTime DatePesee { get; set; } |
12 | 65ad7e66 | Lucas Bihannic | public string RFID { get; set; } |
13 | public List<Mesure> Mesures { get; set; } |
||
14 | public List<Comportement> Comportements { get; set; } |
||
15 | 9fd69a0e | lbihannic | public bool IsOut { get; set; } = false; |
16 | ba296a27 | lbihannic | |
17 | public SerieAnimal(int numeroBoite, double poids, DateTime datePesee, string rFID) |
||
18 | { |
||
19 | NumeroBoite = numeroBoite; |
||
20 | Poids = poids; |
||
21 | DatePesee = datePesee; |
||
22 | RFID = rFID; |
||
23 | Mesures = []; |
||
24 | Comportements = []; |
||
25 | } |
||
26 | fff89fc5 | lbihannic | |
27 | public int GetMeasureCount() |
||
28 | { |
||
29 | return Mesures.Count(); |
||
30 | } |
||
31 | |||
32 | internal void AddMeasure(Mesure newMeasure) |
||
33 | { |
||
34 | Mesures.Add(newMeasure); |
||
35 | } |
||
36 | 1019554c | lbihannic | |
37 | public Mesure GetLastMeasure() |
||
38 | { |
||
39 | return Mesures.Last(); |
||
40 | } |
||
41 | 9fd69a0e | lbihannic | |
42 | public void AddBehaviour(Comportement newBehaviour) |
||
43 | { |
||
44 | Comportements.Add(newBehaviour); |
||
45 | } |
||
46 | |||
47 | public bool HasBehaviour() |
||
48 | { |
||
49 | return Comportements.Any(); |
||
50 | } |
||
51 | 65ad7e66 | Lucas Bihannic | } |
52 | } |