rowboz/robots/trash.go

26 lines
441 B
Go

package robots
func (game *Game) drawTrash() {
for _, t := range game.trash {
game.screen.SetContent(t.x, t.y, '*', nil, game.style)
}
}
func (game *Game) onTrash(pos Position) bool {
var found bool
for _, t := range game.trash {
if t == pos {
found = true
}
}
return found
}
func (game *Game) addTrash(robot Robot) {
game.trash = append(game.trash, robot.position)
}
func (game *Game) cleanTrash() {
game.trash = nil
}