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