コード例 #1
0
ファイル: Gate.cs プロジェクト: pankajgcet56/DesignPatterns
        public Gate(GateState state)
        {
            if (state == null)
            {
                // Start From Closed State

                this.currentGateState = new ClosedGateState(this);
            }
            this.currentGateState = state;
        }
コード例 #2
0
ファイル: Gate.cs プロジェクト: pankajgcet56/DesignPatterns
        public void changeState(GateState state)
        {
            if (state == null)
            {
                // Can't Put FSM to null state
                return;
            }

            Console.WriteLine("Changing State From : " + currentGateState.GetType().Name + " to : " + state.GetType().Name);

            this.currentGateState = state;
        }
コード例 #3
0
ファイル: Gate.cs プロジェクト: pankajgcet56/DesignPatterns
 public Gate()
 {
     // Start FSM with Closed gate State
     this.currentGateState = new ClosedGateState(this);
 }