Ejemplo n.º 1
0
        public BoardCell BehindTheBackOfOccupying(BoardCell cell)
        {
            if (!cell.IsOccupied)
            {
                return(null);
            }

            var index = Board.Cells.IndexOf(cell) +
                        (cell.OccupiedBy.GetComponent <ActorComponent>().Model.IsFacingLeft ? 1 : -1);

            if (!Board.Cells.IndexInBounds(index))
            {
                return(null);
            }

            var behindTheBack = Board.Cells[index];

            if (!behindTheBack.IsWalkable)
            {
                return(null);
            }

            return(behindTheBack);
        }
Ejemplo n.º 2
0
 private void OnCellMouseUp(BoardCell cell)
 {
     CellMouseUp?.Invoke(cell);
 }
Ejemplo n.º 3
0
 private void OnCellMouseDown(BoardCell cell)
 {
     AudioManager.Instance.PlayOneShot(this.cellClickSound);
     CellMouseDown?.Invoke(cell);
 }
Ejemplo n.º 4
0
 private void OnCellMouseExit(BoardCell cell)
 {
     CellMouseExit?.Invoke(cell);
 }
Ejemplo n.º 5
0
 private void OnCellMouseEnter(BoardCell cell)
 {
     LastHoveredCell = cell;
     CellMouseEnter?.Invoke(cell);
 }
Ejemplo n.º 6
0
 public void Initialize(BoardCell cell)
 {
     Cell = cell;
 }