Ejemplo n.º 1
0
 public Solver(string[][] initialState, ICombinator combinator, CancellationToken cancellationToken)
 {
     _combinator        = combinator;
     _initialState      = new State(initialState);
     _movementQueue     = new Queue <Tuple <Movement, List <Movement> > >();
     _currentProgress   = new Progress();
     _cols              = initialState[0].Length;
     _rows              = initialState.Length;
     _cancellationToken = cancellationToken;
 }
 private ICombinator _GetCombinator()
 {
     return _combinator ?? (_combinator = GetCombinator());
 }
Ejemplo n.º 3
0
 private ICombinator _GetCombinator()
 {
     return(_combinator ?? (_combinator = GetCombinator()));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructs a combinator mapping key
 /// </summary>
 /// <param name="ns">
 /// The combinator namespace
 /// </param>
 /// <param name="combinator">
 /// The combinator instance
 /// </param>
 /// <returns>
 /// The constructed mapping key
 /// </returns>
 private String GetCombinatorKey(String ns, ICombinator combinator)
 {
     return String.Format("{0}.{1}", ns, combinator.GetType().FullName);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Registers a combinator with the database
 /// </summary>
 /// <param name="ns">
 /// The combinator namespace
 /// </param>
 /// <param name="combinator">
 /// The combinator to register
 /// </param>
 public void Register(String ns, ICombinator combinator)
 {
     if (ns.Contains('.'))
     throw new ArgumentException("ns");
      if (combinator == null)
     throw new ArgumentNullException("combinator");
      this.combinators[GetCombinatorKey(ns, combinator)] = combinator;
 }
Ejemplo n.º 6
0
 public Anagram2(ICombinator <char> combinator, List <string> words)
 {
     _combinator = combinator;
     _words      = words;
 }