コード例 #1
0
ファイル: Program.cs プロジェクト: mandatorySuicide/Algorithm
        static void Main(string[] args)
        {
            Console.WriteLine("Client (a or b): ");
            var client = Console.ReadLine();
            IFactory factory = client == "a" ? new ClientAFactory() : new ClientAFactory();
            Order order = new Order()
            {
                Tablets = ParseInt(Console.ReadLine()),
                Computers = ParseInt(Console.ReadLine()),
                SmartPhones = ParseInt(Console.ReadLine())
            };

            var company = new HandyDandyManufacturingCompany(factory);
            Console.WriteLine(company.Computers.Count());
            Console.WriteLine(company.Tablets.Count());
            Console.WriteLine(company.SmartPhones.Count());
        }
コード例 #2
0
 public void Produce(Order order)
 {
     CreateComputers(order.Computers);
     CreateComputers(order.Tablets);
     CreateComputers(order.SmartPhones);
 }