|
Within a sequence, the context value |
![]()
package main |
import ( "fmt" |
|
"github.com/shasderias/ilysa" "github.com/shasderias/ilysa/beatsaber" "github.com/shasderias/ilysa/context" "github.com/shasderias/ilysa/timer" ) |
|
func main() { m, _ := beatsaber.NewMockMap(beatsaber.EnvironmentOrigins, 120, "[]") p := ilysa.New(m) |
|
p.Sequence(timer.Seq([]float64{0, 1.5, 2.5, 3, 4}, 6), func(ctx context.Context) { fmt.Printf("%4.2f %4.2f %1d %4.2f %t\n", |
|
|
|
ctx.B(), ctx.T(), ctx.Ordinal(), ctx.SeqNextBOffset(), ctx.Last())
})
}
|
$ go run sequence-context.go 0.00 0.00 0 1.50 false 1.50 0.25 1 1.00 false 2.50 0.50 2 0.50 false 3.00 0.75 3 1.00 false 4.00 1.00 4 2.00 true |
Next example: Range.