Пример #1
0
        /// <summary>
        /// 等號事件
        /// </summary>
        /// <returns>等號響應</returns>
        public FrameUpdate Equal()
        {
            Feature CurrentFeature = Feature.EQUAL;

            return(ThrowOrderException <FrameUpdate>(CurrentFeature, () =>
            {
                FrameUpdate frameUpdate;
                if (PreviousFeature == Feature.Null)
                {
                    return new FrameUpdate("0", new ExpUpdate(removeLength: 0, updateString: "0="));
                }
                else if (PreviousFeature == Feature.EQUAL)
                {
                    //這個怎麼辦
                    frameUpdate = NumberMachine.EqualCombo();
                    //執行成功時記錄下這次的Cast
                    PreviousFeature = Feature.EQUAL;
                    return frameUpdate;
                }
                else if (PreviousFeature == Feature.BINARY)
                {
                    frameUpdate = NumberMachine.BinaryAndEqualCombo();
                    //執行成功時記錄下這次的Cast
                    PreviousFeature = Feature.EQUAL;
                    return frameUpdate;
                }
                frameUpdate = NumberMachine.Equal();

                //執行成功時記錄下這次的Cast
                PreviousFeature = Feature.EQUAL;
                return frameUpdate;
            }));
        }
Пример #2
0
        /// <summary>
        /// 等號事件
        /// </summary>
        /// <returns>等號響應</returns>
        public EqualUpdate Equal()
        {
            Feature CurrentCast = Feature.EQUAL;

            return(CheckOrder <EqualUpdate>(CurrentCast, () =>
            {
                EqualUpdate successResponse;
                if (PreviousCast == Feature.Null)
                {
                    return new EqualUpdate("0", new Updates(removeLength: 0, updateString: "0="));
                }
                else if (PreviousCast == Feature.EQUAL)
                {
                    //這個怎麼辦
                }
                else if (PreviousCast == Feature.BINARY)
                {
                    System.Diagnostics.Debug.WriteLine("there1");
                    successResponse = NumberMachine.BinaryAndEqualCombo();
                    //執行成功時記錄下這次的Cast
                    PreviousCast = Feature.EQUAL;
                    return successResponse;
                }
                successResponse = NumberMachine.Equal();

                //執行成功時記錄下這次的Cast
                PreviousCast = Feature.EQUAL;
                return successResponse;
            }));
        }