public ScoreCounter( LinesRewardConfig linesRewardConfig, LinesCounter linesCounter, IUiUpdater uiUpdater) { _linesRewardConfigConfig = linesRewardConfig; _linesCounter = linesCounter; _uiUpdater = uiUpdater; }
public LevelController( DifficultyConfig difficultyConfig, LinesCounter linesCounter, IUpgradable[] upgradableObjects, IUiUpdater uiUpdater) { _difficultyConfig = difficultyConfig; _linesCounter = linesCounter; _upgradableObjects = upgradableObjects; _uiUpdater = uiUpdater; }
private void Start() { _winWindow.SetActive(false); _timer = GameObject.Find("Timer").GetComponent <Timer>(); _levelManager = GameObject.Find("LevelManager").GetComponent <LevelManager>(); _travaGenerator = GameObject.Find("Background").GetComponent <TravaGenerator>(); _linesController = new LinesController(_defaultMaterial, _levelManager.LinesCount); _charactersGeneratorScript = gameObject.GetComponent <CharactersGenerator>(); _clearAllButton.onClick.AddListener(ClearAll); _undoButton.onClick.AddListener(UndoLastAction); _linesCounter = new LinesCounter(_linesCount, _levelManager.LinesCount); }
public static IEnumerable <ObjectElementValidationError> CheckLinesCount(IObjectElementValue value, IElementConstraints elementConstraints) { var textValue = TextValueExtractor(value); if (string.IsNullOrEmpty(textValue)) { return(Array.Empty <ObjectElementValidationError>()); } var constraints = (FormattedTextElementConstraints)elementConstraints; if (!constraints.MaxLines.HasValue) { return(Array.Empty <ObjectElementValidationError>()); } var linesCount = new LinesCounter() .CountLines(textValue); return(linesCount > constraints.MaxLines.Value ? new[] { new TooManyLinesError(constraints.MaxLines.Value, linesCount) } : Array.Empty <ObjectElementValidationError>()); }
static void Main(string[] args) { LinesCounter lc = new LinesCounter(args[0]); lc.count(); }