From 093ef4caf221912163f0ca8eb944a84fd7d1531a Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 7 Mar 2022 15:51:25 -0500 Subject: [PATCH] add IsTerrain --- board.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/board.go b/board.go index 1b2cadc..d30fec2 100644 --- a/board.go +++ b/board.go @@ -87,3 +87,11 @@ func (b *Board) AddTerrain(x, y, t int) (bool, error) { b.board[y][x].AddTerrain(t) return true, nil } + +//IsTerrain checks if tile is terrain +func (b *Board) IsTerrain(x, y int) (bool, error) { + if !b.validatePoint(x, y) { + return false, errors.New("River check invalid location") + } + return b.board[y][x].passable, nil +}