20 lines
378 B
Go
20 lines
378 B
Go
package gamelogic
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/bootdotdev/learn-pub-sub-starter/internal/routing"
|
|
)
|
|
|
|
func (gs *GameState) HandlePause(ps routing.PlayingState) {
|
|
defer fmt.Println("------------------------")
|
|
fmt.Println()
|
|
if ps.IsPaused {
|
|
fmt.Println("==== Pause Detected ====")
|
|
gs.pauseGame()
|
|
} else {
|
|
fmt.Println("==== Resume Detected ====")
|
|
gs.resumeGame()
|
|
}
|
|
}
|