public override EnemyState Update(GameTime gameTime) { if (path == null) { return(nextState()); } if (nextCell == null) { nextCell = path.Dequeue(); } if (nextCell == null) { return(nextState()); } setCurrentCell(); setCurrentHeading(); setCurrentDirection(); return(this); }
private void checkNextCell() { if (nextCell == null) { if (path != null) { nextCell = path.Dequeue(); } if (nextCell == null) { targetCell = null; } if (nextCell == targetCell) { targetCell = null; nextCell = null; } } }