示例#1
0
 private void CopyPositionFrom(DevCard other)
 {
     Angle       = other.Angle;
     Position    = other.Position;
     ScaleFactor = other.ScaleFactor;
     IsSelected  = false; // the cards were most likely selected in order to select them for swapping positions.
 }
示例#2
0
        /// <summary>
        /// Swaps the positions of the two cards. Both DevCard objects will still display the card they displayed before, but somewhere else than before.
        /// </summary>
        /// <param name="first">The graphics of the first card.</param>
        /// <param name="second">The graphics of the second card.</param>
        public static void SwapPositions(DevCard first, DevCard second)
        {
            var firstClone  = first.Clone();
            var secondClone = second.Clone();

            first.CopyPositionFrom(secondClone);
            second.CopyPositionFrom(firstClone);
        }