| 12345678910111213141516171819202122232425 |
- 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
- }
|