public override int GetHashCode() { unchecked { var hashCode = Point.X; hashCode = (hashCode * 397) ^ Point.Y; hashCode = (hashCode * 397) ^ IsTransparent.GetHashCode(); hashCode = (hashCode * 397) ^ IsWalkable.GetHashCode(); hashCode = (hashCode * 397) ^ IsInFov.GetHashCode(); hashCode = (hashCode * 397) ^ IsExplored.GetHashCode(); return(hashCode); } }
public string getValue(FieldNames whichElement) { switch (whichElement) { case FieldNames.Nothing: return(""); //case FieldNames.Label: // return label; case FieldNames.isInPath: return(IsInPath.ToString()); case FieldNames.isWalkable: return(IsWalkable.ToString()); case FieldNames.isCombatWalkable: return(IsCombatWalkable.ToString()); case FieldNames.allowLOS: return(AllowLOS.ToString()); //case FieldNames.color: // return color.ToString(); case FieldNames.speed: return(Speed.ToString()); case FieldNames.coordinates: return(String.Format("{0},{1}", X, Y)); case FieldNames.PathFindingInformations: return(DistanceSteps.ToString()); case FieldNames.mapLink: return(MapLink.ToString()); case FieldNames.cellID: return(this.CellId.ToString()); //case FieldNames.firstGfx: // return this.firstGfx.ToString(); //case FieldNames.gfxCount: // return this.gfxCount.ToString(); default: return("???"); } }
/// <summary> /// Determines whether two Cell instances are equal /// </summary> /// <param name="other">The Cell to compare this instance to</param> /// <returns>True if the instances are equal; False otherwise</returns> /// <exception cref="NullReferenceException">Thrown if .Equals is invoked on null Cell</exception> protected bool Equals(Cell other) { if (other == null) { return(false); } return(X == other.X && Y == other.Y && IsTransparent.Equals(other.IsTransparent) && IsWalkable.Equals(other.IsWalkable) && IsInFov.Equals(other.IsInFov) && IsExplored.Equals(other.IsExplored)); }