Sfoglia il codice sorgente

Remove (outdated) comments

Sacha Ligthert 2 anni fa
parent
commit
64e20f36f2
2 ha cambiato i file con 1 aggiunte e 32 eliminazioni
  1. 1 9
      game.go
  2. 0 23
      robots.go

+ 1 - 9
game.go

@@ -19,11 +19,6 @@ func gameinit() {
 	// Quit the screen
 	quit(&game)
 
-	// fmt.Println("\nDebug time: Trash")
-	// for i, t := range game.trash {
-	// 	fmt.Println("Trash: ", i, t)
-	// }
-
 	// Give closure
 	if game.gameover == 1 {
 		fmt.Println("\nYou got rekt by a robot")
@@ -66,9 +61,7 @@ func initialize() (Game, error) {
 			moves:     0,
 			teleports: 0,
 		},
-		level: 1,
-		// robots:   []Robot, // I need this maybe
-		// trash: []Position, // I will need this
+		level:    1,
 		gameover: 0,
 	}
 
@@ -168,7 +161,6 @@ func (game *Game) keyboardProcessor() {
 }
 
 func quit(game *Game) {
-	// game.screen.Clear()
 	maybePanic := recover()
 	game.screen.Fini()
 	if maybePanic != nil {

+ 0 - 23
robots.go

@@ -85,31 +85,8 @@ func (game *Game) onRobot(robot Robot) bool {
 	return found
 }
 
-// TODO: improve this
 func (game *Game) deleteRobot(robot Robot) {
 
-	// The following would work, if it wasn't for the fact you are iterating through an array,
-	// and deleting elements form that same array. So deleting item #15 isn't going to work
-	// when the array has been reduced to 13 elements.
-	// if robot < len(game.robots) {
-	// 	game.robots = append(game.robots[:robot], game.robots[robot+1:]...)
-	// }
-
-	// This isn't going to work for the same reason,
-	// and it adds the issue that random robots will get deleted.
-	// var rowboz []Position
-
-	// for i, r := range game.robots {
-	// 	if robot != i {
-	// 		rowboz = append(rowboz, r)
-	// 	}
-	// }
-
-	// game.robots = nil
-	// game.robots = rowboz
-
-	// Conclusion: I need to find a different way to do this properly while iterating to that same array.
-
 	var rowboz []Robot
 
 	for _, r := range game.robots {