feat: add view models for all entities

This commit is contained in:
k0t9i
2023-01-29 20:44:24 +04:00
parent 16630de6a4
commit 8b27c84a9e
4413 changed files with 1150 additions and 122 deletions

View File

@@ -1,16 +1,33 @@
namespace Client.Domain.ValueObjects
using Client.Domain.Common;
using System;
namespace Client.Domain.ValueObjects
{
public class Vector3
public class Vector3 : NotifyPropertyChanged
{
public float X { get; set; }
public float Y { get; set; }
public float Z { get; set; }
private float x;
private float y;
private float z;
public float X { get => x; set { if (value != x) { x = value; OnPropertyChanged("X"); } } }
public float Y { get => y; set { if (value != y) { y = value; OnPropertyChanged("Y"); } } }
public float Z { get => z; set { if (value != z) { z = value; OnPropertyChanged("X"); } } }
public Vector3(float x, float y, float z)
{
X = x;
Y = y;
Z = z;
this.x = x;
this.y = y;
this.z = z;
}
public float HorizontalSqrDistance(Vector3 other)
{
return MathF.Pow(x - other.x, 2) + MathF.Pow(y - other.y, 2);
}
public float HorizontalDistance(Vector3 other)
{
return MathF.Sqrt(HorizontalSqrDistance(other));
}
}
}