Ejemplo n.º 1
0
        /// <summary>
        /// Uses the input eventName to find the platform check functions and then executes the appropriate one, thus tesing whether input was sufficient to meet the event on our platform.
        /// Returns true if platform input was sufficient for the event and false if not.
        /// </summary>
        /// <param name="eventName"></param>
        public override bool CheckInputEvent(string eventName, object[] windowsParameters, object[] androidParameters)
        {
            CheckFuncs checkFuncs = new CheckFuncs(EmptyCheck, EmptyCheck);
            bool       result     = EventFuncMap.TryGetValue(eventName, out checkFuncs); // Do not put this in the assert!  I did this and then in release it didn't work....

            Debug.Assert(result);

            return(checkFuncs.Item1.Invoke(windowsParameters));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds an event for out input manager with the appropriate check functions which we will use at runtime to determine whether input was sufficient on the current platform for the event.
        /// If the event already exists, it will just exit without failure - this will save extra 'isEventAdded' flags on classes adding their own events.
        /// </summary>
        /// <param name="eventName"></param>
        /// <param name="pcCheck"></param>
        /// <param name="touchScreenCheck"></param>
        public void AddInputEvent(string eventName, Func <object[], bool> pcCheck, Func <object[], bool> touchScreenCheck)
        {
            if (EventFuncMap.ContainsKey(eventName))
            {
                return;
            }

            EventFuncMap.Add(eventName, new CheckFuncs(pcCheck, touchScreenCheck));
        }