package ecs
import "unsafe"
func (q *Query0 ) Next () bool {
if int64 (q .cursor .index ) < q .cursor .maxIndex {
q .cursor .index ++
return true
}
return q .nextTableOrArchetype ()
}
func (q *Query0 ) NextTable () bool {
return q .nextTableOrArchetype ()
}
func (q *Query0 ) Entity () Entity {
return q .table .GetEntity (q .cursor .index )
}
func (q *Query0 ) Entities () []Entity {
return q .table .entities .data .Interface ().([]Entity )[:q .table .len :q .table .len ]
}
func (q *Query1 [A ]) Next () bool {
if int64 (q .cursor .index ) < q .cursor .maxIndex {
q .cursor .index ++
return true
}
return q .nextTableOrArchetype ()
}
func (q *Query1 [A ]) NextTable () bool {
return q .nextTableOrArchetype ()
}
func (q *Query1 [A ]) Entity () Entity {
return q .table .GetEntity (q .cursor .index )
}
func (q *Query1 [A ]) Entities () []Entity {
return q .table .entities .data .Interface ().([]Entity )[:q .table .len :q .table .len ]
}
func (q *Query1 [A ]) Get () *A {
index := q .cursor .index
return (*A )(unsafe .Add (q .columnPtrA , index *q .itemSizeA ))
}
func (q *Query1 [A ]) GetColumns () []A {
return q .columnA .data .Interface ().([]A )[:q .table .len :q .table .len ]
}
func (q *Query2 [A , B ]) Next () bool {
if int64 (q .cursor .index ) < q .cursor .maxIndex {
q .cursor .index ++
return true
}
return q .nextTableOrArchetype ()
}
func (q *Query2 [A , B ]) NextTable () bool {
return q .nextTableOrArchetype ()
}
func (q *Query2 [A , B ]) Entity () Entity {
return q .table .GetEntity (q .cursor .index )
}
func (q *Query2 [A , B ]) Entities () []Entity {
return q .table .entities .data .Interface ().([]Entity )[:q .table .len :q .table .len ]
}
func (q *Query2 [A , B ]) Get () (*A , *B ) {
index := q .cursor .index
return (*A )(unsafe .Add (q .columnPtrA , index *q .itemSizeA )),
(*B )(unsafe .Add (q .columnPtrB , index *q .itemSizeB ))
}
func (q *Query2 [A , B ]) GetColumns () ([]A , []B ) {
return q .columnA .data .Interface ().([]A )[:q .table .len :q .table .len ],
q .columnB .data .Interface ().([]B )[:q .table .len :q .table .len ]
}
func (q *Query3 [A , B , C ]) Next () bool {
if int64 (q .cursor .index ) < q .cursor .maxIndex {
q .cursor .index ++
return true
}
return q .nextTableOrArchetype ()
}
func (q *Query3 [A , B , C ]) NextTable () bool {
return q .nextTableOrArchetype ()
}
func (q *Query3 [A , B , C ]) Entity () Entity {
return q .table .GetEntity (q .cursor .index )
}
func (q *Query3 [A , B , C ]) Entities () []Entity {
return q .table .entities .data .Interface ().([]Entity )[:q .table .len :q .table .len ]
}
func (q *Query3 [A , B , C ]) Get () (*A , *B , *C ) {
index := q .cursor .index
return (*A )(unsafe .Add (q .columnPtrA , index *q .itemSizeA )),
(*B )(unsafe .Add (q .columnPtrB , index *q .itemSizeB )),
(*C )(unsafe .Add (q .columnPtrC , index *q .itemSizeC ))
}
func (q *Query3 [A , B , C ]) GetColumns () ([]A , []B , []C ) {
return q .columnA .data .Interface ().([]A )[:q .table .len :q .table .len ],
q .columnB .data .Interface ().([]B )[:q .table .len :q .table .len ],
q .columnC .data .Interface ().([]C )[:q .table .len :q .table .len ]
}
func (q *Query4 [A , B , C , D ]) Next () bool {
if int64 (q .cursor .index ) < q .cursor .maxIndex {
q .cursor .index ++
return true
}
return q .nextTableOrArchetype ()
}
func (q *Query4 [A , B , C , D ]) NextTable () bool {
return q .nextTableOrArchetype ()
}
func (q *Query4 [A , B , C , D ]) Entity () Entity {
return q .table .GetEntity (q .cursor .index )
}
func (q *Query4 [A , B , C , D ]) Entities () []Entity {
return q .table .entities .data .Interface ().([]Entity )[:q .table .len :q .table .len ]
}
func (q *Query4 [A , B , C , D ]) Get () (*A , *B , *C , *D ) {
index := q .cursor .index
return (*A )(unsafe .Add (q .columnPtrA , index *q .itemSizeA )),
(*B )(unsafe .Add (q .columnPtrB , index *q .itemSizeB )),
(*C )(unsafe .Add (q .columnPtrC , index *q .itemSizeC )),
(*D )(unsafe .Add (q .columnPtrD , index *q .itemSizeD ))
}
func (q *Query4 [A , B , C , D ]) GetColumns () ([]A , []B , []C , []D ) {
return q .columnA .data .Interface ().([]A )[:q .table .len :q .table .len ],
q .columnB .data .Interface ().([]B )[:q .table .len :q .table .len ],
q .columnC .data .Interface ().([]C )[:q .table .len :q .table .len ],
q .columnD .data .Interface ().([]D )[:q .table .len :q .table .len ]
}
func (q *Query5 [A , B , C , D , E ]) Next () bool {
if int64 (q .cursor .index ) < q .cursor .maxIndex {
q .cursor .index ++
return true
}
return q .nextTableOrArchetype ()
}
func (q *Query5 [A , B , C , D , E ]) NextTable () bool {
return q .nextTableOrArchetype ()
}
func (q *Query5 [A , B , C , D , E ]) Entity () Entity {
return q .table .GetEntity (q .cursor .index )
}
func (q *Query5 [A , B , C , D , E ]) Entities () []Entity {
return q .table .entities .data .Interface ().([]Entity )[:q .table .len :q .table .len ]
}
func (q *Query5 [A , B , C , D , E ]) Get () (*A , *B , *C , *D , *E ) {
index := q .cursor .index
return (*A )(unsafe .Add (q .columnPtrA , index *q .itemSizeA )),
(*B )(unsafe .Add (q .columnPtrB , index *q .itemSizeB )),
(*C )(unsafe .Add (q .columnPtrC , index *q .itemSizeC )),
(*D )(unsafe .Add (q .columnPtrD , index *q .itemSizeD )),
(*E )(unsafe .Add (q .columnPtrE , index *q .itemSizeE ))
}
func (q *Query5 [A , B , C , D , E ]) GetColumns () ([]A , []B , []C , []D , []E ) {
return q .columnA .data .Interface ().([]A )[:q .table .len :q .table .len ],
q .columnB .data .Interface ().([]B )[:q .table .len :q .table .len ],
q .columnC .data .Interface ().([]C )[:q .table .len :q .table .len ],
q .columnD .data .Interface ().([]D )[:q .table .len :q .table .len ],
q .columnE .data .Interface ().([]E )[:q .table .len :q .table .len ]
}
func (q *Query6 [A , B , C , D , E , F ]) Next () bool {
if int64 (q .cursor .index ) < q .cursor .maxIndex {
q .cursor .index ++
return true
}
return q .nextTableOrArchetype ()
}
func (q *Query6 [A , B , C , D , E , F ]) NextTable () bool {
return q .nextTableOrArchetype ()
}
func (q *Query6 [A , B , C , D , E , F ]) Entity () Entity {
return q .table .GetEntity (q .cursor .index )
}
func (q *Query6 [A , B , C , D , E , F ]) Entities () []Entity {
return q .table .entities .data .Interface ().([]Entity )[:q .table .len :q .table .len ]
}
func (q *Query6 [A , B , C , D , E , F ]) Get () (*A , *B , *C , *D , *E , *F ) {
index := q .cursor .index
return (*A )(unsafe .Add (q .columnPtrA , index *q .itemSizeA )),
(*B )(unsafe .Add (q .columnPtrB , index *q .itemSizeB )),
(*C )(unsafe .Add (q .columnPtrC , index *q .itemSizeC )),
(*D )(unsafe .Add (q .columnPtrD , index *q .itemSizeD )),
(*E )(unsafe .Add (q .columnPtrE , index *q .itemSizeE )),
(*F )(unsafe .Add (q .columnPtrF , index *q .itemSizeF ))
}
func (q *Query6 [A , B , C , D , E , F ]) GetColumns () ([]A , []B , []C , []D , []E , []F ) {
return q .columnA .data .Interface ().([]A )[:q .table .len :q .table .len ],
q .columnB .data .Interface ().([]B )[:q .table .len :q .table .len ],
q .columnC .data .Interface ().([]C )[:q .table .len :q .table .len ],
q .columnD .data .Interface ().([]D )[:q .table .len :q .table .len ],
q .columnE .data .Interface ().([]E )[:q .table .len :q .table .len ],
q .columnF .data .Interface ().([]F )[:q .table .len :q .table .len ]
}
func (q *Query7 [A , B , C , D , E , F , G ]) Next () bool {
if int64 (q .cursor .index ) < q .cursor .maxIndex {
q .cursor .index ++
return true
}
return q .nextTableOrArchetype ()
}
func (q *Query7 [A , B , C , D , E , F , G ]) NextTable () bool {
return q .nextTableOrArchetype ()
}
func (q *Query7 [A , B , C , D , E , F , G ]) Entity () Entity {
return q .table .GetEntity (q .cursor .index )
}
func (q *Query7 [A , B , C , D , E , F , G ]) Entities () []Entity {
return q .table .entities .data .Interface ().([]Entity )[:q .table .len :q .table .len ]
}
func (q *Query7 [A , B , C , D , E , F , G ]) Get () (*A , *B , *C , *D , *E , *F , *G ) {
index := q .cursor .index
return (*A )(unsafe .Add (q .columnPtrA , index *q .itemSizeA )),
(*B )(unsafe .Add (q .columnPtrB , index *q .itemSizeB )),
(*C )(unsafe .Add (q .columnPtrC , index *q .itemSizeC )),
(*D )(unsafe .Add (q .columnPtrD , index *q .itemSizeD )),
(*E )(unsafe .Add (q .columnPtrE , index *q .itemSizeE )),
(*F )(unsafe .Add (q .columnPtrF , index *q .itemSizeF )),
(*G )(unsafe .Add (q .columnPtrG , index *q .itemSizeG ))
}
func (q *Query7 [A , B , C , D , E , F , G ]) GetColumns () ([]A , []B , []C , []D , []E , []F , []G ) {
return q .columnA .data .Interface ().([]A )[:q .table .len :q .table .len ],
q .columnB .data .Interface ().([]B )[:q .table .len :q .table .len ],
q .columnC .data .Interface ().([]C )[:q .table .len :q .table .len ],
q .columnD .data .Interface ().([]D )[:q .table .len :q .table .len ],
q .columnE .data .Interface ().([]E )[:q .table .len :q .table .len ],
q .columnF .data .Interface ().([]F )[:q .table .len :q .table .len ],
q .columnG .data .Interface ().([]G )[:q .table .len :q .table .len ]
}
func (q *Query8 [A , B , C , D , E , F , G , H ]) Next () bool {
if int64 (q .cursor .index ) < q .cursor .maxIndex {
q .cursor .index ++
return true
}
return q .nextTableOrArchetype ()
}
func (q *Query8 [A , B , C , D , E , F , G , H ]) NextTable () bool {
return q .nextTableOrArchetype ()
}
func (q *Query8 [A , B , C , D , E , F , G , H ]) Entity () Entity {
return q .table .GetEntity (q .cursor .index )
}
func (q *Query8 [A , B , C , D , E , F , G , H ]) Entities () []Entity {
return q .table .entities .data .Interface ().([]Entity )[:q .table .len :q .table .len ]
}
func (q *Query8 [A , B , C , D , E , F , G , H ]) Get () (*A , *B , *C , *D , *E , *F , *G , *H ) {
index := q .cursor .index
return (*A )(unsafe .Add (q .columnPtrA , index *q .itemSizeA )),
(*B )(unsafe .Add (q .columnPtrB , index *q .itemSizeB )),
(*C )(unsafe .Add (q .columnPtrC , index *q .itemSizeC )),
(*D )(unsafe .Add (q .columnPtrD , index *q .itemSizeD )),
(*E )(unsafe .Add (q .columnPtrE , index *q .itemSizeE )),
(*F )(unsafe .Add (q .columnPtrF , index *q .itemSizeF )),
(*G )(unsafe .Add (q .columnPtrG , index *q .itemSizeG )),
(*H )(unsafe .Add (q .columnPtrH , index *q .itemSizeH ))
}
func (q *Query8 [A , B , C , D , E , F , G , H ]) GetColumns () ([]A , []B , []C , []D , []E , []F , []G , []H ) {
return q .columnA .data .Interface ().([]A )[:q .table .len :q .table .len ],
q .columnB .data .Interface ().([]B )[:q .table .len :q .table .len ],
q .columnC .data .Interface ().([]C )[:q .table .len :q .table .len ],
q .columnD .data .Interface ().([]D )[:q .table .len :q .table .len ],
q .columnE .data .Interface ().([]E )[:q .table .len :q .table .len ],
q .columnF .data .Interface ().([]F )[:q .table .len :q .table .len ],
q .columnG .data .Interface ().([]G )[:q .table .len :q .table .len ],
q .columnH .data .Interface ().([]H )[:q .table .len :q .table .len ]
}
The pages are generated with Golds v0.8.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .