public CloudProcessor(Options options, IWordSource wordSource, IGrammarInfoParser grammarInfoParser, GrammarFormJoiner grammarFormJoiner, IWordFilter[] wordFilters, IFontManager fontManager, ICloudGenerator cloudGenerator, IColorManager colorManager, ICloudRenderer cloudRenderer) { this.wordSource = wordSource; this.grammarInfoParser = grammarInfoParser; this.grammarFormJoiner = grammarFormJoiner; this.wordFilters = wordFilters; wordCount = options.Count; this.fontManager = fontManager; this.cloudGenerator = cloudGenerator; this.colorManager = colorManager; this.cloudRenderer = cloudRenderer; }
public CommandsParser(ICloudGenerator cloud, string[] args) { Cloud = cloud; RegisteredCommands = new Dictionary<string, ICommand> { { "size", new SetSize(this) }, { "scale", new SetWordsScale(this) }, { "moreDensity", new SetDensityFlag(this) }, { "boring", new SetBoringWords(this) }, { "font", new SetFontFamily(this) }, { "colors", new SetWordsColors(this)}, { "help", new Help(this) } }; _commands = new HashSet<ICommand>(); var pattern = ".+:|.+$"; string keyWord; foreach (var command in args) { keyWord = Regex.Match(command, pattern).ToString().Replace(":", ""); if (RegisteredCommands.ContainsKey(keyWord)) _commands.Add(RegisteredCommands[keyWord].CreateCommand(command)); } }
public ImageGenerator(ICloudGenerator cloud) { Cloud = cloud; _rnd = new Random(DateTime.Now.Millisecond); }