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.
149 lines
4.2 KiB
149 lines
4.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.Serialization;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml.Linq;
|
|
|
|
namespace Model.Classes
|
|
{
|
|
[DataContract(Name = "ile")]
|
|
public class Ile : ObjetOhara
|
|
{
|
|
[DataMember(Name = "nomromanise")]
|
|
private string? nomromanise;
|
|
public string? NomRomanise
|
|
{
|
|
get => nomromanise;
|
|
set
|
|
{
|
|
nomromanise = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
[DataMember(Name = "region")]
|
|
private string? region;
|
|
public string? Region {
|
|
get=>region;
|
|
set
|
|
{
|
|
region = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
[DataMember(Name = "premierchap")]
|
|
private int premierchap;
|
|
public int PremierChap {
|
|
get=>premierchap;
|
|
set
|
|
{
|
|
premierchap = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
[DataMember(Name = "premierep")]
|
|
private int premierep;
|
|
public int PremierEp {
|
|
get=>premierep;
|
|
set
|
|
{
|
|
premierep = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
[DataMember(Name = "description")]
|
|
private string? description;
|
|
public string? Description {
|
|
get=>description;
|
|
set
|
|
{
|
|
description = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
[DataMember(Name = "geographie")]
|
|
private string? geographie;
|
|
public string? Geographie {
|
|
get=>geographie;
|
|
set
|
|
{
|
|
geographie = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Ile(string nom, string nomRomanise, string region, int premierChap, int premierEp, string description, string geographie) : base(nom)
|
|
{
|
|
if (String.IsNullOrWhiteSpace(nomRomanise))
|
|
nomRomanise = "Nom romanisé de l'île...";
|
|
NomRomanise = nomRomanise;
|
|
if (String.IsNullOrWhiteSpace(region))
|
|
region = "Grand Line";
|
|
Region = region;
|
|
if (premierEp < 0)
|
|
{
|
|
PremierEp = 0;
|
|
}
|
|
else
|
|
{
|
|
PremierEp = premierEp;
|
|
}
|
|
if (premierChap < 0)
|
|
{
|
|
PremierChap = 0;
|
|
}
|
|
else
|
|
{
|
|
PremierChap = premierChap;
|
|
}
|
|
if (String.IsNullOrWhiteSpace(description))
|
|
description = "Description de l'île ...";
|
|
Description = description;
|
|
if (String.IsNullOrWhiteSpace(geographie))
|
|
geographie = "Situation géographique de l'ile...";
|
|
Geographie = geographie;
|
|
|
|
}
|
|
|
|
public Ile(string nom, string nomRomanise, string region, int premierChap, int premierEp, string description, string geographie, string image) : this(nom, nomRomanise, region, premierChap, premierEp, description, geographie)
|
|
{
|
|
if(String.IsNullOrWhiteSpace(image)) {
|
|
image = "baseimage.png";
|
|
}
|
|
Image = image;
|
|
}
|
|
|
|
public override bool Equals(object? obj)
|
|
{
|
|
if (obj == null) return false;
|
|
if (this.GetType() != obj.GetType())
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
Ile o = (Ile)obj;
|
|
return o.Nom == Nom;
|
|
}
|
|
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
|
|
return HashCode.Combine(NomRomanise, Region, PremierChap, PremierEp, Description, Geographie);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return "Ile : "+ Nom +" "+NomRomanise+" "+Region+" "+PremierChap+" "+PremierEp+" "+Description+" "+Geographie+" "+Image;
|
|
}
|
|
}
|
|
}
|