Exemplo n.º 1
0
 virtual public void PushRight(int delta)
 {
     movementState = movementState.Right();
     physics.PushRight(delta);
     int[] pos = physics.GetPosition;
     xCoordinate = pos[0];
     yCoordinate = pos[1];
 }
Exemplo n.º 2
0
 public void RemoveState(IEnemyMovementState StateToRemove)
 {
     for (int i = 0; i < m_MovementState.Count; i++)
     {
         if (StateToRemove == m_MovementState[i])
         {
             if (StateToRemove != null)
             {
                 m_MovementState[m_MovementState.Count].OnEnter();
             }
             m_MovementState.Add(StateToRemove);
         }
     }
 }
Exemplo n.º 3
0
    public void AddState(IEnemyMovementState StateToAdd)
    {
        bool notIn = true;

        if (m_MovementState.Count != 0)
        {
            for (int i = 0; i < m_MovementState.Count; i++)
            {
                if (StateToAdd == m_MovementState[i])
                {
                    notIn = false;
                }
            }
        }
        if (notIn)
        {
            m_MovementState.Add(StateToAdd);
            if (StateToAdd != null)
            {
                m_MovementState[m_MovementState.Count - 1].OnEnter();
            }
        }
    }
Exemplo n.º 4
0
 virtual public void RightRun()
 {
     movementState = movementState.Right();
     physics.RightRun();
 }
Exemplo n.º 5
0
 virtual public void LeftRun()
 {
     movementState = movementState.Left();
     physics.LeftRun();
 }