Exemplo n.º 1
0
        public override bool ProcessUnsignedIntegerValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink,
                                                         TAGDictionaryItem valueType, uint value)
        {
            bool result = false;

            if (valueType.Type == TAGDataType.t4bitUInt)
            {
                switch (value)
                {
                case 0:
                    valueSink.SetOnGround(OnGroundState.No);
                    break;

                case 1:
                    valueSink.SetOnGround(OnGroundState.YesLegacy);
                    break;

                default:
                    valueSink.SetOnGround(OnGroundState.Unknown);
                    break;
                }

                result = true;
            }

            return(result);
        }
Exemplo n.º 2
0
        public void Test_TAGProcessorStateBase_SetOnGround()
        {
            var state = new TAGProcessorStateBase();

            Assert.True(state.OnGrounds.GetLatest() == OnGroundState.YesLegacy, "Initial value incorrect");
            state.SetOnGround(OnGroundState.No);
            Assert.True(state.OnGrounds.NumAttrs == 2 && state.OnGrounds.GetLatest() == OnGroundState.No, "Initial value incorrect");
        }
Exemplo n.º 3
0
        public override bool ProcessUnsignedIntegerValue(TAGValueMatcherState state, TAGProcessorStateBase valueSink,
                                                         TAGDictionaryItem valueType, uint value)
        {
            bool result = false;

            if (valueType.Type == TAGDataType.t4bitUInt &&
                (value >= OnGroundStateConsts.ON_GROUND_STATE_MIN_VALUE && value <= OnGroundStateConsts.ON_GROUND_STATE_MAX_VALUE))
            {
                valueSink.SetOnGround((OnGroundState)value);
                result = true;
            }

            return(result);
        }