예제 #1
0
 public override void Push(bool is_on, bool is_edge, IntPair move)
 {
     base.Push(is_on, is_edge, move);
     if (is_on || is_edge)
     {
         this.m_pos_history.push_front(move);
     }
     else
     {
         this.m_pos_history.push_front(new IntPair(0, 0));
     }
 }
예제 #2
0
        private bool addMove(IntPair move)
        {
            bool flag = false;

            this.m_move_accumulate.first  += move.first;
            this.m_move_accumulate.second += move.second;
            if (this.m_move_threshold < Math.Abs(this.m_move_accumulate.first) || this.m_move_threshold < Math.Abs(this.m_move_accumulate.second))
            {
                flag = true;
            }
            if (flag)
            {
                this.m_move_report     = this.m_move_accumulate;
                this.m_move_accumulate = new IntPair();
            }
            return(flag);
        }
예제 #3
0
        public CArray2 <float> GetDragSpeed()
        {
            IntPair intPair = new IntPair(0, 0);

            for (int index = 0; index < this.m_pos_history.size(); ++index)
            {
                IntPair at = this.m_pos_history.getAt(index);
                intPair.first  += at.first;
                intPair.second += at.second;
            }
            float num = 1f / (float)this.m_pos_history.max_size();

            return(new CArray2 <float>()
            {
                x = (float)intPair.first * num,
                y = (float)intPair.second * num
            });
        }
예제 #4
0
        protected override bool hitTest(IntPair pos, uint index)
        {
            bool flag = false;

            if (this.m_flag[0])
            {
                uint hitNum = AppMain.AoActGetHitNum(this.m_act);
                AppMain.AOS_ACT_HIT[] aosActHitArray = AppMain.New <AppMain.AOS_ACT_HIT>((int)hitNum);
                int hitTbl = (int)AppMain.AoActGetHitTbl((AppMain.ArrayPointer <AppMain.AOS_ACT_HIT>)aosActHitArray, hitNum, this.m_act);
                for (int index1 = 0; (long)index1 < (long)hitNum; ++index1)
                {
                    if (AppMain.AoActHitTestCorReverse(aosActHitArray[index1], (float)pos.first, (float)pos.second))
                    {
                        flag = true;
                        break;
                    }
                }
            }
            return(flag);
        }
 // Token: 0x060029D7 RID: 10711 RVA: 0x00158CAC File Offset: 0x00156EAC
 public virtual void Update()
 {
     if (this.IsValid() && !this.m_flag[0])
     {
         for (int i = 0; i < AppMain._am_tp_touch.Length; i++)
         {
             bool is_on = false;
             AppMain.AMS_TP_TOUCH_STATUS ams_TP_TOUCH_STATUS = AppMain._am_tp_touch[i];
             bool    flag;
             IntPair move;
             if (AppMain.amTpIsTouchOn(i))
             {
                 flag = AppMain.amTpIsTouchPush(i);
                 if (flag)
                 {
                     this.m_pos[i] = new IntPair((int)ams_TP_TOUCH_STATUS.push[0], (int)ams_TP_TOUCH_STATUS.push[1]);
                 }
                 IntPair intPair = new IntPair((int)ams_TP_TOUCH_STATUS.on[0], (int)ams_TP_TOUCH_STATUS.on[1]);
                 if (!this.m_flag[1])
                 {
                     is_on = this.hitTest(intPair, (uint)i);
                 }
                 move          = intPair - this.m_pos[i];
                 this.m_pos[i] = intPair;
             }
             else
             {
                 flag = AppMain.amTpIsTouchPull(i);
                 move = new IntPair((int)ams_TP_TOUCH_STATUS.pull[0], (int)ams_TP_TOUCH_STATUS.pull[1]) - this.m_pos[i];
                 if (flag)
                 {
                     this.m_pos[i] = default(IntPair);
                 }
             }
             T t = this.m_state[i];
             t.Push(is_on, flag, move);
         }
     }
 }
예제 #6
0
 public virtual void Update()
 {
     if (!this.IsValid() || this.m_flag[0])
     {
         return;
     }
     for (int index = 0; index < AppMain._am_tp_touch.Length; ++index)
     {
         bool is_on = false;
         AppMain.AMS_TP_TOUCH_STATUS amsTpTouchStatus = AppMain._am_tp_touch[index];
         bool    is_edge;
         IntPair move;
         if (AppMain.amTpIsTouchOn(index))
         {
             is_edge = AppMain.amTpIsTouchPush(index);
             if (is_edge)
             {
                 this.m_pos[index] = new IntPair((int)amsTpTouchStatus.push[0], (int)amsTpTouchStatus.push[1]);
             }
             IntPair pos = new IntPair((int)amsTpTouchStatus.on[0], (int)amsTpTouchStatus.on[1]);
             if (!this.m_flag[1])
             {
                 is_on = this.hitTest(pos, (uint)index);
             }
             move = pos - this.m_pos[index];
             this.m_pos[index] = pos;
         }
         else
         {
             is_edge = AppMain.amTpIsTouchPull(index);
             move    = new IntPair((int)amsTpTouchStatus.pull[0], (int)amsTpTouchStatus.pull[1]) - this.m_pos[index];
             if (is_edge)
             {
                 this.m_pos[index] = new IntPair();
             }
         }
         this.m_state[index].Push(is_on, is_edge, move);
     }
 }
예제 #7
0
        // Token: 0x06002AB8 RID: 10936 RVA: 0x0015B150 File Offset: 0x00159350
        protected override bool hitTest(IntPair pos, uint index)
        {
            bool result = false;

            if (this.m_flag[0])
            {
                uint num = AppMain.AoActGetHitNum(this.m_act);
                AppMain.AOS_ACT_HIT[] array = AppMain.New <AppMain.AOS_ACT_HIT>((int)num);
                AppMain.AoActGetHitTbl(array, num, this.m_act);
                int num2 = 0;
                while ((long)num2 < (long)((ulong)num))
                {
                    if (AppMain.AoActHitTestCorReverse(array[num2], (float)pos.first, (float)pos.second))
                    {
                        result = true;
                        break;
                    }
                    num2++;
                }
            }
            return(result);
        }
예제 #8
0
 private void updateMoveOver(IntPair move)
 {
     CTrgState.CBitset at = this.m_state.getAt(0);
     if (at.test(2))
     {
         at.set(12, true);
         if (at.test(14))
         {
             at.set(9, true);
         }
         if (!this.m_state[1].test(14))
         {
             this.resetMove();
         }
     }
     else if (at.test(0))
     {
         if (this.addMove(move))
         {
             at.set(12, true);
             if (at.test(14))
             {
                 at.set(9, true);
                 at.set(15, true);
             }
         }
     }
     else if (at.test(14) && this.addMove(move))
     {
         at.set(9, true);
         at.set(15, true);
     }
     if (!this.m_state[1].test(10))
     {
         return;
     }
     at.set(15, false);
 }
예제 #9
0
 private void resetMove()
 {
     this.m_move_accumulate = new IntPair();
     this.m_move_report     = this.m_move_accumulate;
 }
예제 #10
0
 public void SetRepeatInterval(IntPair repeat_interval)
 {
     this.m_repeat_interval = repeat_interval;
 }
 // Token: 0x060029EF RID: 10735 RVA: 0x0015911D File Offset: 0x0015731D
 protected virtual bool hitTest(IntPair pos, uint index)
 {
     return(false);
 }