Inheritance: StatePattern.ATMState
示例#1
0
        public ATMMachine()
        {
            hasCard       = new HasCard(this);
            noCard        = new NoCard(this);
            hasCorrectPin = new HasPin(this);
            atmOutOfMoney = new NoCash(this);

            atmState = noCard;

            if (cashInMachine < 0)
            {
                atmState = atmOutOfMoney;
            }
        }
        public ATMMachine()
        {
            hasCard = new HasCard(this);
            noCard = new NoCard(this);
            hasCorrectPin = new HasPin(this);
            atmOutOfMoney = new NoCash(this);

            atmState = noCard;

            if(cashInMachine < 0)
            {
                atmState = atmOutOfMoney;
            }
        }