private bool DropReleasesCheck( PieceEV pieceToDrop, Vector2 location, PlayerColor playerColor, PieceSide side, HandPieceEV handPiece, DropCheckmateLevel recursionLevel, IEntitiesDB entitiesDB) { bool returnValue; PieceEV?topPieceAtLocation = pieceFindService.FindTopPieceByLocation(location, entitiesDB); pieceSetService.SetTopOfTowerToFalse(topPieceAtLocation, entitiesDB); int tier = topPieceAtLocation.HasValue ? topPieceAtLocation.Value.Tier.Tier + 1 : 1; pieceSetService.SetPieceLocationAndTier(pieceToDrop, location, tier, entitiesDB); pieceSetService.SetPiecePlayerOwner(pieceToDrop, playerColor, entitiesDB); pieceSetService.SetPieceSide(pieceToDrop, side, entitiesDB); handService.DecrementHandPiece(ref handPiece); PlayerColor enemyPlayerColor = TurnService.CalcOtherTurnPlayer(playerColor); returnValue = DropCheckmateNotViolated( pieceToDrop, location, playerColor, side, handPiece, recursionLevel, entitiesDB); if (returnValue) { returnValue = !checkService.IsCommanderInCheck(playerColor, entitiesDB); } handService.IncrementHandPiece(ref handPiece); pieceSetService.SetPieceLocationToHandLocation(pieceToDrop, entitiesDB); if (topPieceAtLocation.HasValue) { pieceSetService.SetTopOfTower(topPieceAtLocation.Value, entitiesDB); } return(returnValue); }