Beispiel #1
0
        public bool TryToGetPieceMovementByRelativePosition(PublicDataType.IntegerVector2 relativePosition, out PieceMovement pieceMovement)
        {
            bool isExpanded = fieldChecker != null && fieldChecker.IsExpandedMoveField(this.Position);

            foreach (PieceMovement moveable in GetMoveablePosition(isExpanded))
            {
                if (moveable.IsMoveable(relativePosition))
                {
                    pieceMovement = moveable;
                    return(true);
                }
            }

            pieceMovement = PieceMovement.Default;
            return(false);
        }
Beispiel #2
0
        public bool TryToGetPieceMovement(PublicDataType.IntegerVector2 worldPosition, out PieceMovement pieceMovement)
        {
            var relativePosition = ConvertWorldPositionToRelativePosition(worldPosition);

            return(TryToGetPieceMovementByRelativePosition(relativePosition, out pieceMovement));
        }