feat(grid): add IsRowFull()
This commit is contained in:
parent
e958f87e64
commit
eb31bdf50c
1 changed files with 9 additions and 0 deletions
|
|
@ -30,3 +30,12 @@ func (g Grid) Tile(x, y byte) graphics.Tile {
|
|||
func (g *Grid) Set(x, y byte, c Block) {
|
||||
(*g)[uint16(x)+(uint16(y)*GRID_WIDTH)] = c
|
||||
}
|
||||
|
||||
func (g *Grid) IsRowFull(y byte) bool {
|
||||
for x := range byte(g.Width()) {
|
||||
if g.At(x, y) == BLOCK_EMPTY {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue