You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.8 KiB
94 lines
2.8 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.Serialization;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml.Linq;
|
|
|
|
namespace Model.Classes
|
|
{
|
|
[DataContract(Name = "equipage")]
|
|
public class Equipage : ObjetOhara
|
|
{
|
|
[DataMember(Name = "nomromanise")]
|
|
public string NomRomanise { get; set; }
|
|
[DataMember(Name = "region")]
|
|
public string Region { get; set; }
|
|
[DataMember(Name = "premierchap")]
|
|
public int PremierChap { get; set; }
|
|
[DataMember(Name = "premierep")]
|
|
public int PremierEp { get; set; }
|
|
[DataMember(Name = "statut")]
|
|
public bool Statut { get; set; }
|
|
[DataMember(Name = "description")]
|
|
public string Description { get; set; }
|
|
[DataMember(Name = "capitaine")]
|
|
public Personnage? Capitaine { get; set; }
|
|
[DataMember(Name = "membre")]
|
|
public List<Personnage> Membre { get; set; } = new List<Personnage>();
|
|
[DataMember(Name = "allie")]
|
|
public List<Equipage> Allie { get; set; } = new List<Equipage>();
|
|
|
|
|
|
public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut, string description) : base(nom)
|
|
{
|
|
|
|
NomRomanise = nomRomanise;
|
|
Region = region;
|
|
if (premierEp < 0)
|
|
{
|
|
PremierEp = 0;
|
|
}
|
|
else
|
|
{
|
|
PremierEp = premierEp;
|
|
}
|
|
if (premierChap < 0)
|
|
{
|
|
premierChap = 0;
|
|
}
|
|
else
|
|
{
|
|
PremierChap = premierChap;
|
|
}
|
|
Statut = statut;
|
|
Description = description;
|
|
|
|
}
|
|
|
|
public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut, string description, string image) : this(nom, nomRomanise, region, premierChap, premierEp, statut, description)
|
|
{
|
|
|
|
Image = image;
|
|
|
|
}
|
|
|
|
public override bool Equals(object? obj)
|
|
{
|
|
if (obj == null) return false;
|
|
if (this.GetType() != obj.GetType())
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
Equipage o = (Equipage)obj;
|
|
return o.Nom == Nom;
|
|
}
|
|
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
|
|
return HashCode.Combine(NomRomanise, Region, PremierChap, PremierEp, Statut, Description);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return "Equipage :" + Nom +" "+EstFavori+ " " + NomRomanise + " " + Region + " " + PremierChap + " " + PremierEp + " " + Statut + " " + Description + " " + Image;
|
|
}
|
|
}
|
|
}
|