public void ExecuteActions() { if (Actions.Count == 0) { return; } IPieceAction actionToDo = Actions[0]; Actions.Remove(actionToDo); StartCoroutine(actionToDo.DoAction(ExecuteActions)); }
private IPieceAction ProcessCell(Cell cell) { IPieceAction actionToDo = null; if (cell.piecePlaced) { if (piece.dummy) { actionToDo = new MovementAction(cell, 0, speed, piece); } else { actionToDo = new PushAction(cell.piecePlaced, speed, piece); } } else { switch (cell.type) { case Cell.CellType.Normal: actionToDo = new MovementAction(cell, 0, speed, piece); break; case Cell.CellType.Portal: actionToDo = new TeleportAction(cell, 0, speed, piece); break; case Cell.CellType.DestructibleWall: actionToDo = new DestroyAction(cell, Cost, speed, piece); break; } } return(actionToDo); }
public void AddAction(IPieceAction action) { Actions.Add(action); }