DS-Pokemon-Rom-Editor/DS_Map/ROMFiles/HeadbuttEncounterMap.cs
Miguel Terol Espino 5bfbde28e9 Added the levelscript editor
Co-authored-by: Cuddlyogre <cuddlyogre@users.noreply.github.com>
2024-03-06 00:37:15 +01:00

37 lines
891 B
C#

namespace DSPRE.ROMFiles {
//This class is in case a MapHeader uses the same MapFile more than once
//ToString is the matrix x,y and mapID
class HeadbuttEncounterMap {
public readonly int mapID;
public readonly int x;
public readonly int y;
public HeadbuttEncounterMap(int mapID, int x, int y) {
this.mapID = mapID;
this.x = x;
this.y = y;
}
public override string ToString() {
return $"{mapID} - {x},{y}";
}
public override bool Equals(object obj) {
// If the passed object is null
if (obj == null) {
return false;
}
if (obj is HeadbuttEncounterMap) {
return this.ToString() == ((HeadbuttEncounterMap)obj).ToString();
}
return false;
}
public override int GetHashCode() {
return this.x.GetHashCode() ^ y.GetHashCode() ^ mapID.GetHashCode();
}
}
}