• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mlange-42 / arche / 4725747591

17 Apr 2023 08:58PM CUT coverage: 100.0%. Remained the same
4725747591

push

github

GitHub
Add parallel simulations example (#223)

2729 of 2729 relevant lines covered (100.0%)

4272.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/ecs/archetypes.go
1
package ecs
2

3
// Interface for an iterator over archetypes.
4
type archetypes interface {
5
        Get(index int) *archetype
6
        Len() int
7
}
8

9
// Implementation of an archetype iterator for a single archetype.
10
// Implements [archetypes].
11
//
12
// Used for the [Query] returned by entity batch creation methods.
13
type batchArchetype struct {
14
        Archetype  *archetype
15
        StartIndex uint32
16
}
17

18
// Get returns the value at the given index.
19
func (s batchArchetype) Get(index int) *archetype {
4✔
20
        return s.Archetype
4✔
21
}
4✔
22

23
// Len returns the current number of items in the paged array.
24
func (s batchArchetype) Len() int {
10✔
25
        return 1
10✔
26
}
10✔
27

28
// Implementation of an archetype iterator for pointers.
29
// Implements [archetypes].
30
//
31
// Used for tracking filter archetypes in [Cache].
32
type archetypePointers struct {
33
        pointers []*archetype
34
}
35

36
// Get returns the value at the given index.
37
func (a *archetypePointers) Get(index int) *archetype {
12✔
38
        return a.pointers[index]
12✔
39
}
12✔
40

41
// Add adds an element.
42
func (a *archetypePointers) Add(arch *archetype) {
51✔
43
        a.pointers = append(a.pointers, arch)
51✔
44
}
51✔
45

46
// Len returns the current number of items in the paged array.
47
func (a *archetypePointers) Len() int {
13✔
48
        return len(a.pointers)
13✔
49
}
13✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc