コード例 #1
0
 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);
 }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
 public bool Equals(DirectionFlags other)
 {
     return(up == other.up && right == other.right && down == other.down && left == other.left);
 }