public static double Magnitude(DeusVector2 lhs, DeusVector2 rhs) { float precision = Math.Min(lhs.m_precision, rhs.m_precision); return(Math.Pow((rhs.m_x - lhs.m_x) / precision, 2) + Math.Pow((rhs.m_y - lhs.m_y) / precision, 2)); }
public static DeusVector2 operator *(DeusVector2 a, float scalar) { DeusVector2 result = new DeusVector2(); result.m_x = (int)(a.m_x * scalar); result.m_y = (int)(a.m_y * scalar); return(result); }
public static DeusVector2 operator -(DeusVector2 a, DeusVector2 b) { DeusVector2 result = new DeusVector2(); result.m_x = a.m_x - b.m_x; result.m_y = a.m_y - b.m_y; return(result); }
public override void OnDeserialize(byte[] buffer, int index) { uint componentId = 0; Serializer.DeserializeData(buffer, ref index, out componentId); ComponentId = componentId; uint skill = 0; Serializer.DeserializeData(buffer, ref index, out skill); SkillId = skill; DeusVector2 pos = DeusVector2.Zero; Serializer.DeserializeData(buffer, ref index, out pos); SkillLaunchPosition = pos; }
public override void OnAnswerDeserialize(byte[] buffer, int index) { uint objectId = 0; Serializer.DeserializeData(buffer, ref index, out objectId); ObjectId = objectId; uint skillId = 0; Serializer.DeserializeData(buffer, ref index, out skillId); SkillId = skillId; DeusVector2 pos = DeusVector2.Zero; Serializer.DeserializeData(buffer, ref index, out pos); SkillLaunchPosition = pos; uint tmpSrcMs = 0; Serializer.DeserializeData(buffer, ref index, out tmpSrcMs); SkillLaunchTimestampMs = tmpSrcMs; }
public static double SqrtMagnitude(DeusVector2 lhs, DeusVector2 rhs) { return(Math.Sqrt(Magnitude(lhs, rhs))); }
public PacketUseSkillRequest(uint componentId, uint skillId, DeusVector2 skillPos) : base(EPacketType.UseSkillRequest) { ComponentId = componentId; SkillId = skillId; SkillLaunchPosition = skillPos; }