Esempio n. 1
0
        public IOtomatState GetOtomatState(KahveOtomati.OtomatState state, KahveOtomati otomat)
        {
            IOtomatState otomatState = null;

            switch (state)
            {
            case KahveOtomati.OtomatState.BEKLEMEDE:
                otomatState = new BeklemedeState(otomat);
                break;

            case KahveOtomati.OtomatState.BAKIYE_YETERSIZ:
                otomatState = new BakiyeYetersizState(otomat);
                break;

            case KahveOtomati.OtomatState.BAKIYE_YETERLI:
                otomatState = new BakiyeYeterliState(otomat);
                break;

            case KahveOtomati.OtomatState.KAHVE_HAZIR:
                otomatState = new KahveHazirState(otomat);
                break;

            default:
                break;
            }

            return(otomatState);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            KahveOtomati otomat = new KahveOtomati();

            otomat.ParaEkle(0.5m);
            otomat.SiparisVer(KahveOtomati.KahveTuru.ORTA);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            KahveOtomati otomat = new KahveOtomati();

            otomat.ParaEkle(0.5m);
            otomat.SiparisVer(KahveOtomati.KahveTuru.ORTA);
        }
Esempio n. 4
0
        public IOtomatState GetOtomatState(KahveOtomati.OtomatState state, KahveOtomati otomat)
        {
            IOtomatState otomatState = null;

            switch (state)
            {
                case KahveOtomati.OtomatState.BEKLEMEDE:
                    otomatState = new BeklemedeState(otomat);
                    break;
                case KahveOtomati.OtomatState.BAKIYE_YETERSIZ:
                    otomatState = new BakiyeYetersizState(otomat);
                    break;
                case KahveOtomati.OtomatState.BAKIYE_YETERLI:
                    otomatState = new BakiyeYeterliState(otomat);
                    break;
                case KahveOtomati.OtomatState.KAHVE_HAZIR:
                    otomatState = new KahveHazirState(otomat);
                    break;
                default:
                    break;
            }

            return otomatState;
        }
Esempio n. 5
0
 public KahveHazirState(KahveOtomati otomat)
     : base(otomat)
 {
 }
 public virtual void SiparisVer(KahveOtomati.KahveTuru tur)
 {
     throw new NotImplementedException();
 }
 public AbstractOtomatState(KahveOtomati otomat)
 {
     Otomat = otomat;
 }
Esempio n. 8
0
 public KahveHazirState(KahveOtomati otomat)
     : base(otomat)
 {
 }
 public BakiyeYetersizState(KahveOtomati otomat)
     : base(otomat)
 {
 }
Esempio n. 10
0
 public BeklemedeState(KahveOtomati otomat) : base(otomat)
 {
 }
Esempio n. 11
0
 public BakiyeYeterliState(KahveOtomati otomat) : base(otomat)
 {
 }
Esempio n. 12
0
 public BeklemedeState(KahveOtomati otomat)
     : base(otomat)
 {
 }
 public override void SiparisVer(KahveOtomati.KahveTuru tur)
 {
     base.Otomat.Bakiye = 0;
     base.Otomat.SetState(KahveOtomati.OtomatState.KAHVE_HAZIR);
 }
 public AbstractOtomatState(KahveOtomati otomat)
 {
     Otomat = otomat;
 }