Esempio n. 1
0
        internal JumpLink(Square from, Square via, Square to)
            : base(from, to)
        {
            if (!from.IsAdjacentTo(via) || !to.IsAdjacentTo(via))
            {
                throw new InvalidOperationException("Squares should be adjacent.");
            }

            _via = via;
        }
Esempio n. 2
0
        private MoveResult GetMoveResult(Square from, Square to)
        {
            if (from.IsAdjacentTo(to))
            {
                return GetMoveResult(from, from.Links.Single(l => l.LinkedSquare(from) == to));
            }

            throw new InvalidOperationException("Jump cases should go via links.");
        }