feat: add outgoing messages to client

This commit is contained in:
k0t9i
2023-02-09 22:45:08 +04:00
parent abcf3b20c0
commit ad5d7a5159
25 changed files with 739 additions and 74 deletions

View File

@@ -18,6 +18,6 @@ namespace Client.Domain.Entities
string BriefInfo { get; }
CreatureTypeEnum Type { get; }
uint AggroRadius { get; set; }
bool IsHostile { get; set; }
}
}

View File

@@ -62,6 +62,7 @@ namespace Client.Domain.Entities
}
}
public uint AggroRadius { get; set; } = 0;
public bool IsHostile { get; set; } = false;
public Hero(uint id, Transform transform, FullName fullName, VitalStats vitalStats, Phenotype phenotype, ExperienceInfo experienceInfo, PermanentStats permanentStats, VariableStats variableStats, Reputation reputation, InventoryInfo inventoryInfo, uint targetId, bool isStanding)
{

View File

@@ -74,7 +74,7 @@ namespace Client.Domain.Entities
{
string result = FullName.Nickname;
if (IsDead())
if (VitalStats.IsDead)
{
result += " (dead)";
}
@@ -124,17 +124,12 @@ namespace Client.Domain.Entities
private void VitalStats_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "Hp" || e.PropertyName == "MaxHp")
if (e.PropertyName == "IsDead")
{
OnPropertyChanged("Name");
}
}
public bool IsDead()
{
return VitalStats.MaxHp > 0 && VitalStats.Hp <= 0;
}
private uint level;
private uint aggroRadius;
private VitalStats vitalStats;

View File

@@ -62,6 +62,7 @@ namespace Client.Domain.Entities
public VitalStats VitalStats { get => vitalStats; set => vitalStats = value; }
public CreatureTypeEnum Type { get => CreatureTypeEnum.Player; }
public uint AggroRadius { get; set; } = 0;
public bool IsHostile { get; set; } = false;
public Player(uint id, Transform transform, FullName fullName, Phenotype phenotype)
{