public class Student
{
// Keys
public int Id { get; set; }
// Key fragments
[Required]
public int Money { get; set; } = 0;
[Required]
public int Energy { get; set; } = 100;
// Experience and position in ranking
[Required]
public int LevelPoints { get; set; } = 0;
[Required]
public Ranks Rank { get; set; } = Ranks.Silver_I;
[Required]
public int Level { get; set; } = 1;
[Required]
public int Experience { get; set; } = 0;
// Points used in fights, events etc.
[Required]
public int HealthPoints { get; set; } = 100; // bazowe zdrowie
[Required]
public int AttackPoints { get; set; } = 1; // bazowy atak
[Required]
public int DefensePoints { get; set; } = 1; // zwieksza procentowo hp przy ataku
[Required]
public int LuckPoints { get; set; } = 1; // pomaga przy losowaniu do ataku
[Required]
public int IntelligencePoints { get; set; } = 1;// cappuje zakladanie broni/zbroi aby nie bylo przypadku kiedy osoba na 1lvl moze zalozyc najlepszy przedmiot w grze
// Equipped items
[ForeignKey("Armour")]
[AllowNull]
public int? ArmourId { get; set; }
[ForeignKey("Weapon")]
[AllowNull]
public int? WeaponId { get; set; }
[ForeignKey("Account")]
public int AccountId { get; set; }
// Db relation
public ICollection<Student_Weapon> Student_Weapons { get; set; } = new List<Student_Weapon>();
public ICollection<Student_Armour> Student_Armours { get; set; } = new List<Student_Armour>();
public ICollection<Student_Food> Student_Foods { get; set; } = new List<Student_Food>();
public Stat? Stats{ get; set; }
//child
public Armour Armour { get; set; } = null!;
public Weapon Weapon { get; set; } = null!;
public Account Account { get; set; } = null!;
}
public class Food
{
public int Id { get; set; }
[Required]
public string Name { get; set; } = string.Empty;
[Required]
public int BoostAmount { get; set; }
[Required]
public Boost BoostType { get; set; }
[Required]
public int Duration { get; set; }
[Required]
public int Cost { get; set; }
[Required]
public Rarity Rarity{ get; set; }
// Db relation
public ICollection<Student_Food> Student_Foods { get; set; } = new List<Student_Food>();
}
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum Boost
{
HealthBoost = 1,
AttackBoost = 2,
DefenseBoost = 3,
LuckBoost = 4
}
public class Student
{
// Keys
public int Id { get; set; }
// Key fragments
[Required]
public int Money { get; set; } = 0;
[Required]
public int Energy { get; set; } = 100;
// Experience and position in ranking
[Required]
public int LevelPoints { get; set; } = 0;
[Required]
public Ranks Rank { get; set; } = Ranks.Silver_I;
[Required]
public int Level { get; set; } = 1;
[Required]
public int Experience { get; set; } = 0;
// Points used in fights, events etc.
[Required]
public int HealthPoints { get; set; } = 100; // bazowe zdrowie
[Required]
public int AttackPoints { get; set; } = 1; // bazowy atak
[Required]
public int DefensePoints { get; set; } = 1; // zwieksza procentowo hp przy ataku
[Required]
public int LuckPoints { get; set; } = 1; // pomaga przy losowaniu do ataku
[Required]
public int IntelligencePoints { get; set; } = 1;// cappuje zakladanie broni/zbroi aby nie bylo przypadku kiedy osoba na 1lvl moze zalozyc najlepszy przedmiot w grze
// Equipped items
[ForeignKey("Armour")]
[AllowNull]
public int? ArmourId { get; set; }
[ForeignKey("Weapon")]
[AllowNull]
public int? WeaponId { get; set; }
[ForeignKey("Account")]
public int AccountId { get; set; }
// Db relation
public ICollection<Student_Weapon> Student_Weapons { get; set; } = new List<Student_Weapon>();
public ICollection<Student_Armour> Student_Armours { get; set; } = new List<Student_Armour>();
public ICollection<Student_Food> Student_Foods { get; set; } = new List<Student_Food>();
public Stat? Stats{ get; set; }
//child
public Armour Armour { get; set; } = null!;
public Weapon Weapon { get; set; } = null!;
public Account Account { get; set; } = null!;
}
public class Food
{
public int Id { get; set; }
[Required]
public string Name { get; set; } = string.Empty;
[Required]
public int BoostAmount { get; set; }
[Required]
public Boost BoostType { get; set; }
[Required]
public int Duration { get; set; }
[Required]
public int Cost { get; set; }
[Required]
public Rarity Rarity{ get; set; }
// Db relation
public ICollection<Student_Food> Student_Foods { get; set; } = new List<Student_Food>();
}
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum Boost
{
HealthBoost = 1,
AttackBoost = 2,
DefenseBoost = 3,
LuckBoost = 4
}