/// <summary> /// Use DI to inject Strategy /// </summary> /// <param name="strategy"></param> public PyramidContext(IPyramidStrategy strategy) { this.strategy = strategy; this.pyramid = new Pyramid(); }
/// <summary> /// Allow to replace Strategy at Runtime /// </summary> /// <param name="strategy"></param> public void SetStrategy(IPyramidStrategy strategy) { this.strategy = strategy; }
/// <summary> /// Initialize with Default Strategy /// </summary> public PyramidContext() { this.strategy = new DefaultPyramidStrategy(); this.pyramid = new Pyramid(); }