/// <summary> /// Returns cell by position /// </summary> public Cell GetCellByPosition(IntVector2 position) { return(cells[position.x, position.y]); }
private bool IsValidPosition(IntVector2 position) { return(position.x > 0 && position.x <= width && position.y > 0 && position.y <= height); }
/// <summary> /// Checks that in table with bonus items by given position is castle /// </summary> public bool IsCastle(IntVector2 position) { return(bonusTable[position.x, position.y] is Castle); }
/// <summary> /// Returns castle by position /// </summary> public Castle GetCastle(IntVector2 position) { return(bonusTable[position.x, position.y] as Castle); }
/// <summary> /// Returns item from bonus table by position /// </summary> public BoardStorageItem GetBonusItem(IntVector2 position) { return(bonusTable[position.x, position.y]); }
/// <summary> /// Adds castle to table with bonus items by given position /// </summary> public void AddCastle(IntVector2 position, Castle castle) { bonusTable[position.x, position.y] = castle; }
/// <summary> /// Returns board button by given position /// </summary> public BoardButton GetBoardButton(IntVector2 position) { return(board.GetBoardButton(position)); }
/// <summary> /// Sets item to table with army items by given position /// </summary> public void SetItem(IntVector2 position, BoardStorageItem item) { SetItem(position.x, position.y, item); }
/// <summary> /// Returns item from table with army items by given position /// </summary> /// <param name="position"></param> /// <returns></returns> public BoardStorageItem GetItem(IntVector2 position) { return(GetItem(position.x, position.y)); }
/// <summary> /// Returns the button by the given position. /// </summary> public BoardButton GetBoardButton(IntVector2 position) { return(boardButtons[position.x, position.y].gameObject.GetComponent <BoardButton>()); }