コード例 #1
0
ファイル: Program.cs プロジェクト: zyssx/Unity3DTraining
        static void Main(string[] args)
        {
            Context context;

            context = new Context(new ConcreteStrategyA());
            context.ContextOperation();

            context = new Context(new ConcreteStrategyB());
            context.ContextOperation();

            context = new Context(new ConcreteStrategyC());
            context.ContextOperation();


            ProduceContext produceContext = new ProduceContext(new ProduceStrategySummer());

            produceContext.GetDecision(1);

            produceContext = new ProduceContext(new ProduceStrategyWinter());
            produceContext.GetDecision(1);

            ProduceContext ps = new ProduceContext(1);

            ps.GetDecision(1);

            ps = new ProduceContext(2);
            ps.GetDecision(1);
        }