Core/Refactor: Part 1

This commit is contained in:
hondacrx
2018-05-07 18:56:09 -04:00
parent b2c1554065
commit 216db1c23a
83 changed files with 298 additions and 296 deletions
+7 -2
View File
@@ -156,18 +156,23 @@ namespace Game.Maps
{
return (p1.x_coord == p2.x_coord && p1.y_coord == p2.y_coord);
}
public static bool operator !=(CellCoord p1, CellCoord p2)
{
return !(p1 == p2);
}
public override bool Equals(object obj)
{
return base.Equals(obj);
if (obj is CellCoord)
return (CellCoord)obj == this;
return false;
}
public override int GetHashCode()
{
return base.GetHashCode();
return x_coord.GetHashCode() ^ y_coord.GetHashCode();
}
public uint x_coord { get; set; }
+9 -9
View File
@@ -160,15 +160,15 @@ namespace Game.Maps
float[][] boundGridCoords =
{
new float[] { 0.0f, 0.0f },
new float[] { 0.0f, -266.66666f },
new float[] { 0.0f, -533.33331f },
new float[] { -266.66666f, 0.0f },
new float[] { -266.66666f, -266.66666f },
new float[] { -266.66666f, -533.33331f },
new float[] { -533.33331f, 0.0f },
new float[] { -533.33331f, -266.66666f },
new float[] { -533.33331f, -533.33331f }
new [] { 0.0f, 0.0f },
new [] { 0.0f, -266.66666f },
new [] { 0.0f, -533.33331f },
new [] { -266.66666f, 0.0f },
new [] { -266.66666f, -266.66666f },
new [] { -266.66666f, -533.33331f },
new [] { -533.33331f, 0.0f },
new [] { -533.33331f, -266.66666f },
new [] { -533.33331f, -533.33331f }
};
_minHeightPlanes = new Plane[8];
+2 -3
View File
@@ -398,15 +398,14 @@ namespace Game.Maps
void ReadSaveDataBossStates(StringArguments data)
{
uint bossId = 0;
foreach (var i in bosses)
foreach (var pair in bosses)
{
EncounterState buff = (EncounterState)data.NextUInt32();
if (buff == EncounterState.InProgress || buff == EncounterState.Fail || buff == EncounterState.Special)
buff = EncounterState.NotStarted;
if (buff < EncounterState.ToBeDecided)
SetBossState(bossId++, buff);
SetBossState(pair.Key, buff);
}
}