Beispiel #1
0
        // Sounds (at least) 10x scarier than it really is
        public static object ApplyRecursiveControlFunc(Control ctrl, ControlFunc ctrlFunc, object result = null)
        {
            result = ctrlFunc(ctrl, result);

            foreach (Control c in ctrl.Controls)
            {
                result = ApplyRecursiveControlFunc(c, ctrlFunc, result);
            }

            return(result);
        }
Beispiel #2
0
        private NormalMovement normScheme; // A reference to the NormalMovement on the object



        // ===================
        // * PRIVATE METHODS *
        // ===================

        // Initialize Control Values
        private void Start()
        {
            // get class instances
            buttons    = new ButtonPresses();
            normScheme = GetComponent <NormalMovement>();

            // initialize button presses to false
            buttons.setAll(false);

            // initialize controlScheme to normal controls
            controlScheme = normScheme.Interface;
        }
        public void FrameU_StartDtAct()
        {
            const ControlFunc cf = ControlFunc.STARTDT_ACT;
            var frm1             = new FrameU(cf);

            var buffer       = new byte[Constants.MinFrameLength].AsSpan();
            var bytesWritten = frm1.TryWrite(buffer);
            var desc         = ByteUtil.Describe(buffer, 0, length: Constants.MinFrameLength, annotations: FrameU.Annotations);

            var(error, frm2) = FrameU.Read(buffer.Slice(2));

            Assert.Equal(ErrorCode.None, error);
            Assert.Equal(cf, frm2.ControlFunc);
        }
Beispiel #4
0
 public FrameU(ControlFunc controlFuncId)
 {
     ControlFunc = controlFuncId;
 }