/// <summary> /// Call this method to register your BLS pawns. /// </summary> /// <param name="pawns">List of instances of pawns to register</param> /// <example> /// <code> /// public class SomePawn : BlsPawn {} /// public class SomeOtherPawn : BlsPawn {} /// Bls bls = new Bls(instance_of_storage_provider); /// bls.RegisterBlPawns(new SomePawn(), new SomeOtherPawn()) /// </code> /// </example> public void RegisterBlPawns(params BlsPawn[] pawns) { if (Graph == null) { Graph = new BlGraph(); } Graph.RegisterPawns(pawns); Graph.CompileGraph(); }
/// <summary> /// Use this constructor for manually overriding the instance of the <see cref="IBlGraph"/> interface which, /// by default, is bound to an instance of <see cref="BlGraph"/> class. This is an internal constructor; /// it should stay this way (there is no reason for the consumer to work with the BlGraph) and only used /// for testing purposes. /// </summary> /// <param name="storageProvider"></param> /// <param name="graph"></param> internal Bls(IBlStorageProvider storageProvider, IBlGraph graph) { StorageProvider = storageProvider; Graph = graph; }
/// <summary> /// Use this constructor to create a new instance of the application's business logic. /// You'll have to provide an instance of a storage provider - a class which implements /// <see cref="IBlStorageProvider"/> interface. Storage providers are used by BLS to interact with /// databases or other storage solutions. /// </summary> /// <param name="storageProvider">Storage provider</param> public Bls(IBlStorageProvider storageProvider) { StorageProvider = storageProvider; Graph = new BlGraph(); }