private void Start()
    {
        StrategyContext context = new StrategyContext();

        context.Strategy = new StrategyA();
        context.Cal();
        context.Strategy = new StrategyB();
        context.Cal();
    }
Exemplo n.º 2
0
    void Start()
    {
        StrategyContext context = new StrategyContext();

        context.strategy = new ConcreteStrategyA();
        context.Cal();

        context.strategy = new ConcreteStrategyB();
        context.Cal();
    }