public override bool Equals(object obj) { if (obj is DirectionFlags) { DirectionFlags other = (DirectionFlags)obj; return(up == other.up && right == other.right && down == other.down && left == other.left); } return(false); }
/// <summary>Rotate by the given amount, relative to up.</summary> public DirectionFlags RotatedFromUpTo(CardinalDir dir) { DirectionFlags rotated = this; for (int i = 0; i < (int)dir; i++) { rotated = rotated.rotated90; } return(rotated); }
public bool Equals(DirectionFlags other) { return(up == other.up && right == other.right && down == other.down && left == other.left); }