예제 #1
0
 // Usually, the Context allows replacing a Strategy object at runtime.
 public void SetStrategy(IFighterStrategy strategy)
 {
     _fighterStrategy = strategy;
 }
예제 #2
0
 // Usually, the Context accepts a strategy through the constructor, but
 // also provides a setter to change it at runtime.
 public FighterContext(IFighterStrategy strategy)
 {
     _fighterStrategy = strategy;
 }