package com.sf._05_接口练习.demo2;

public class Test {

    public static void main(String[] args) {
        SmartTV smartTV = new SmartTV("小米",3999);
        WashingMachine washingMachine = new WashingMachine("海尔",1999);

        work(smartTV);
        System.out.println("=====");
        work(washingMachine);
//        smartTV.setTimer(10);
//        smartTV.remoteStart();
//        smartTV.remoteStop();
//        smartTV.start();
//        smartTV.stop();
//
//        System.out.println("=======================");
//
//        washingMachine.setTimer(10);
//        washingMachine.start();
//        washingMachine.stop();
    }

    public static void work(IFun  fun){
        if(fun instanceof SmartTV){
            fun.setTimer(10);
            fun.remoteStart();
            fun.remoteStop();
            fun.start();
            fun.stop();
        }else if(fun instanceof WashingMachine){
            fun.setTimer(10);
            fun.start();
            fun.stop();
        }
    }


}
