|
|
|
@ -0,0 +1,68 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace EntityFramework
|
|
|
|
|
{
|
|
|
|
|
public class SkinEntity //ON TO MANY
|
|
|
|
|
{
|
|
|
|
|
public string Name
|
|
|
|
|
{
|
|
|
|
|
get => name;
|
|
|
|
|
private init
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrWhiteSpace(value))
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentException("A skin must have a name");
|
|
|
|
|
}
|
|
|
|
|
name = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private readonly string name = null!;
|
|
|
|
|
|
|
|
|
|
public string Description
|
|
|
|
|
{
|
|
|
|
|
get => description;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrWhiteSpace(value))
|
|
|
|
|
{
|
|
|
|
|
description = "";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
description = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private string description = "";
|
|
|
|
|
|
|
|
|
|
public string Icon { get; set; }
|
|
|
|
|
public LargeImageEntity Image { get; set; }
|
|
|
|
|
|
|
|
|
|
public float Price { get; set; }
|
|
|
|
|
|
|
|
|
|
public ChampionEntity Champion
|
|
|
|
|
{
|
|
|
|
|
get => champion;
|
|
|
|
|
private init
|
|
|
|
|
{
|
|
|
|
|
if (value == null)
|
|
|
|
|
throw new ArgumentNullException("A skill can't have a null champion");
|
|
|
|
|
champion = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private readonly ChampionEntity champion = null!;
|
|
|
|
|
|
|
|
|
|
public SkinEntity(string name, ChampionEntity champion, float price = 0.0f, string icon = "", string image = "", string description = "")
|
|
|
|
|
{
|
|
|
|
|
Name = name;
|
|
|
|
|
Champion = champion;
|
|
|
|
|
Champion.AddSkin(this);
|
|
|
|
|
Price = price;
|
|
|
|
|
Icon = icon;
|
|
|
|
|
Image = new LargeImageEntity(image);
|
|
|
|
|
Description = description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|