private void IterateFigureMoveTurnRules <T>(Action actionChecker) where T : Object { ResetCellsStatus(); foreach (var figureMoveTurnRules in AssetUtils.FindAllAssets <T>()) { if (figureMoveTurnRules is BaseFigureMoveTurnRulesSO baseFigureMoveTurnRules) { baseFigureMoveTurnRules.Construct(BoardModel, GameModel); baseFigureMoveTurnRules.CalculateMoveTurnData(_mainFigure); actionChecker.Invoke(); } else { Assert.Fail($"FigureMoveTurnRules:{figureMoveTurnRules} can't cast to BaseFigureMoveTurnRulesSO"); } } }