示例#1
0
文件: Memo.cs 项目: korulis/hackaroo
        public void AddSolvable(WordEquivalencyClassComposition wordEquivalencyClassComposition)
        {
            var charPool = wordEquivalencyClassComposition.CharPool;

            if (ContainsKey(charPool))
            {
                throw new ArgumentException("I should not be here.");
                return;
            }

            var compositionAlternatives = CompositionAlternatives.NotDeadend(wordEquivalencyClassComposition);

            _dict.Add(charPool, compositionAlternatives);
        }
示例#2
0
文件: Memo.cs 项目: korulis/hackaroo
        public void AddSolution(WordEquivalencyClassComposition wordEquivalencyClassComposition)
        {
            var charPool = wordEquivalencyClassComposition.CharPool;

            if (!ContainsKey(charPool))
            {
                var compositionAlternatives = new CompositionAlternatives(wordEquivalencyClassComposition);
                _dict.Add(charPool, compositionAlternatives);
            }
            else
            {
                //todo must check if this is duplicate structure that i am adding (optimisation)
                _dict[charPool].AddAlternative(wordEquivalencyClassComposition);
            }
        }