Exemplo n.º 1
0
        public void ExecuteActions()
        {
            if (Actions.Count == 0)
            {
                return;
            }

            IPieceAction actionToDo = Actions[0];

            Actions.Remove(actionToDo);

            StartCoroutine(actionToDo.DoAction(ExecuteActions));
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public void AddAction(IPieceAction action)
 {
     Actions.Add(action);
 }