Exemplo n.º 1
0
func evac(ship *dtl.Ship, escapeSector *dtl.Sector) error {
	for {
		if ship.CanTravel() {
			fmt.Printf("Evaccing to %s\n", escapeSector.Name)
			return ship.Travel(escapeSector)
		}
		time.Sleep(1 * time.Second)
	}
}
Exemplo n.º 2
0
func travel(ship *dtl.Ship, sector *dtl.Sector) error {
	for {
		if ship.CanTravel() {
			fmt.Printf("Travelling to %s\n", sector.Name)
			return ship.Travel(sector)
		}
		time.Sleep(1 * time.Second)
	}
}