2023-12-11 21:51:50 +01:00
|
|
|
package robots
|
2023-12-03 22:20:44 +01:00
|
|
|
|
|
|
|
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 {
|
2023-12-06 19:25:16 +01:00
|
|
|
if t == pos {
|
2023-12-03 22:20:44 +01:00
|
|
|
found = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return found
|
|
|
|
}
|
|
|
|
|
2023-12-06 20:32:08 +01:00
|
|
|
func (game *Game) addTrash(robot Robot) {
|
|
|
|
game.trash = append(game.trash, robot.position)
|
2023-12-03 22:20:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (game *Game) cleanTrash() {
|
|
|
|
game.trash = nil
|
|
|
|
}
|