Example #1
0
        public List<IPrimitiveConditionData> GenerateRules(List<TouchPoint2> points)
        {
            List<IPrimitiveConditionData> states = new List<IPrimitiveConditionData>();

            foreach (TouchPoint2 point in points)
            {
                TouchState state = new TouchState();
                switch (point.Action.ToString().ToLower())
                {
                    case "up":
                        state.States.Add("TouchUp");
                        break;

                    case "move":
                        state.States.Add("TouchMove");
                        break;

                    case "down":
                        state.States.Add("TouchDown");
                        break;
                }

                states.Add(state);
            }

               return states;
        }
Example #2
0
        public void Init(IPrimitiveConditionData ruleData)
        {
            _data = ruleData as TouchState;

            foreach (string touchState in _data.States)
            {
                requiredTouchStates.Add(
                        new TouchActionResult()
                        {
                            Action = GetTouchActionType(touchState)
                        });
            }
        }