Ejemplo n.º 1
0
 public void SetData(Cell cell)
 {
     Type = cell.Type;
     CurrentDirection = cell.CurrentDirection;
     PreviousDirection = cell.PreviousDirection;
     Coorditanes[0] = cell.Coorditanes[0];
     Coorditanes[1] = cell.Coorditanes[1];
 }
Ejemplo n.º 2
0
 public void Move(Cell cell)
 {
     I = cell.Coorditanes[0];
     J = cell.Coorditanes[1];
     _start = transform.position;
     _destinition = new Vector3(cell.Coorditanes[0], cell.Coorditanes[1], 20f);
     IsMoving = true;
 }
Ejemplo n.º 3
0
 private void SwapCells(Cell cell1, Cell cell2)
 {
     Cell cell = new Cell(0,0);
     cell.SetData(cell1);
     cell1.SetData(cell2);
     cell2.SetData(cell);
 }
Ejemplo n.º 4
0
        private CellType GetNextCellType(CellType type, Cell nextCell)
        {
            var cellInfo = new CellInfo(type, nextCell.CurrentDirection, nextCell.PreviousDirection);
            var result = CellType.Empty;
            if (cellTypes.TryGetValue(cellInfo, out result))
            {
                return result;
            }

            return GetTurnType(nextCell.CurrentDirection, nextCell.PreviousDirection);
        }
Ejemplo n.º 5
0
 private void FieldOnCreateBodyPart(Cell cell)
 {
     CreateSnakeBodyPartSignal.Dispatch(cell, View.transform);
 }