Core/Refactor: Fix alot of Possible loss of fraction warnings

This commit is contained in:
hondacrx
2018-05-07 17:34:41 -04:00
parent daa425b029
commit b2c1554065
17 changed files with 31 additions and 30 deletions
+4 -3
View File
@@ -83,16 +83,17 @@ namespace Game.Collision
{
return base.Equals(obj);
}
public override int GetHashCode()
{
return base.GetHashCode();
return x.GetHashCode() ^ y.GetHashCode();
}
public static Cell ComputeCell(float fx, float fy)
{
Cell c = new Cell();
c.x = (int)(fx * (1.0f / CELL_SIZE) + (CELL_NUMBER / 2));
c.y = (int)(fy * (1.0f / CELL_SIZE) + (CELL_NUMBER / 2));
c.x = (int)(fx * (1.0f / CELL_SIZE) + (CELL_NUMBER / 2f));
c.y = (int)(fy * (1.0f / CELL_SIZE) + (CELL_NUMBER / 2f));
return c;
}