Beispiel #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);
        }
Beispiel #2
0
 private void OnCellMouseUp(BoardCell cell)
 {
     CellMouseUp?.Invoke(cell);
 }
Beispiel #3
0
 private void OnCellMouseDown(BoardCell cell)
 {
     AudioManager.Instance.PlayOneShot(this.cellClickSound);
     CellMouseDown?.Invoke(cell);
 }
Beispiel #4
0
 private void OnCellMouseExit(BoardCell cell)
 {
     CellMouseExit?.Invoke(cell);
 }
Beispiel #5
0
 private void OnCellMouseEnter(BoardCell cell)
 {
     LastHoveredCell = cell;
     CellMouseEnter?.Invoke(cell);
 }
Beispiel #6
0
 public void Initialize(BoardCell cell)
 {
     Cell = cell;
 }