virtual public void PushRight(int delta) { movementState = movementState.Right(); physics.PushRight(delta); int[] pos = physics.GetPosition; xCoordinate = pos[0]; yCoordinate = pos[1]; }
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); } } }
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(); } } }
virtual public void RightRun() { movementState = movementState.Right(); physics.RightRun(); }
virtual public void LeftRun() { movementState = movementState.Left(); physics.LeftRun(); }