public bool ConnectionValidTo(ISquarePiece nextPiece)
        {
            if (!ConnectionHelper.AdjancentToLastPiece(_squarePiece, nextPiece))
            {
                return(false);
            }

            if (nextPiece != null && nextPiece.PieceConnection is AnyAdjancentConnection)
            {
                return(true);
            }

            if (nextPiece != null && nextPiece.PieceConnection is TwoSpriteConnection)
            {
                var fade = nextPiece.PieceConnection as TwoSpriteConnection;
                if (fade.SecondColour == _squarePiece.PieceColour || fade.SecondColour == SecondColour)
                {
                    return(true);
                }
            }

            if (nextPiece != null && nextPiece.PieceColour != _squarePiece.PieceColour && nextPiece.PieceColour != SecondColour)
            {
                return(false);
            }

            return(true);
        }
Exemple #2
0
        public bool ConnectionValidTo(ISquarePiece nextPiece)
        {
            if (!ConnectionHelper.AdjancentToLastPiece(_squarePiece, nextPiece))
            {
                return(false);
            }

            if (nextPiece.PieceConnection is NoConnection)
            {
                return(false);
            }

            return(true);
        }
Exemple #3
0
        public bool ConnectionValidTo(ISquarePiece nextPiece)
        {
            if (!ConnectionHelper.AdjancentToLastPiece(_squarePiece, nextPiece))
            {
                return(false);
            }

            if (nextPiece != null && nextPiece.PieceConnection is AnyAdjancentConnection)
            {
                return(true);
            }

            if (nextPiece != null && nextPiece.PieceColour != _squarePiece.PieceColour)
            {
                return(false);
            }

            return(true);
        }