Cleaned up some warnings.

This commit is contained in:
Filip Maj 2019-05-04 20:53:08 -04:00
parent 1e4a1cf263
commit 10017b7e8c
27 changed files with 68 additions and 98 deletions

View file

@ -60,7 +60,7 @@ namespace FFXIVClassic.Common
// Calculate a bitmask of the desired length
long mask = 0;
for (int i = 0; i < fieldLength; i++)
mask |= 1 << i;
mask |= 1L << i;
r |= ((UInt32)f.GetValue(t) & mask) << offset;

View file

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic.Common
{
@ -64,7 +60,7 @@ namespace FFXIVClassic.Common
public static bool operator ==(Vector3 lhs, Vector3 rhs)
{
return (lhs?.X == rhs?.X && lhs?.Y == rhs?.Y && lhs?.Z == rhs?.Z);
}
}
public float Length()
{
@ -141,5 +137,23 @@ namespace FFXIVClassic.Common
//If the relative angle is less than the total angle of the cone, the target is inside the cone
return angleToTarget >= 0 && angleToTarget <= (coneAngle * Math.PI);
}
public override bool Equals(object obj)
{
var vector = obj as Vector3;
return vector != null &&
X == vector.X &&
Y == vector.Y &&
Z == vector.Z;
}
public override int GetHashCode()
{
var hashCode = -307843816;
hashCode = hashCode * -1521134295 + X.GetHashCode();
hashCode = hashCode * -1521134295 + Y.GetHashCode();
hashCode = hashCode * -1521134295 + Z.GetHashCode();
return hashCode;
}
}
}