示例#1
0
 public ScoreCounter(
     LinesRewardConfig linesRewardConfig,
     LinesCounter linesCounter,
     IUiUpdater uiUpdater)
 {
     _linesRewardConfigConfig = linesRewardConfig;
     _linesCounter            = linesCounter;
     _uiUpdater = uiUpdater;
 }
示例#2
0
 public LevelController(
     DifficultyConfig difficultyConfig,
     LinesCounter linesCounter,
     IUpgradable[] upgradableObjects,
     IUiUpdater uiUpdater)
 {
     _difficultyConfig  = difficultyConfig;
     _linesCounter      = linesCounter;
     _upgradableObjects = upgradableObjects;
     _uiUpdater         = uiUpdater;
 }
示例#3
0
        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>());
        }
示例#5
0
文件: task3.cs 项目: seniorivn/ITMO
 static void Main(string[] args)
 {
     LinesCounter lc = new LinesCounter(args[0]);
     lc.count();
 }
示例#6
0
    static void Main(string[] args)
    {
        LinesCounter lc = new LinesCounter(args[0]);

        lc.count();
    }