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

mlange-42 / ark / 13731577050

08 Mar 2025 12:07AM CUT coverage: 99.378% (-0.05%) from 99.424%
13731577050

Pull #159

github

web-flow
Merge 8dd1bf7ad into bdb658fea
Pull Request #159: Add method `ID.Index`

0 of 3 new or added lines in 1 file covered. (0.0%)

6387 of 6427 relevant lines covered (99.38%)

27758.88 hits per line

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

85.0
/ecs/types.go
1
package ecs
2

3
import "reflect"
4

5
// ID is the component identifier.
6
// It is not relevant when using the default generic API.
7
type ID struct {
8
        id uint8
9
}
10

11
func id(id int) ID {
2,035✔
12
        return ID{uint8(id)}
2,035✔
13
}
2,035✔
14

15
func id8(id uint8) ID {
505,242✔
16
        return ID{id}
505,242✔
17
}
505,242✔
18

19
// Index returns the internal component index of this Index.
NEW
20
func (id ID) Index() uint8 {
×
NEW
21
        return id.id
×
NEW
22
}
×
23

24
// IDs is an immutable list of [ID] values.
25
type IDs struct {
26
        data []ID
27
}
28

29
func newIDs(ids []ID) IDs {
11✔
30
        return IDs{
11✔
31
                data: ids,
11✔
32
        }
11✔
33
}
11✔
34

35
// Get returns the ID at the given index.
36
func (ids *IDs) Get(index int) ID {
2✔
37
        return ids.data[index]
2✔
38
}
2✔
39

40
// Len returns the number of IDs.
41
func (ids *IDs) Len() int {
1✔
42
        return len(ids.data)
1✔
43
}
1✔
44

45
// ResID is the resource identifier.
46
// It is not relevant when using the default generic API.
47
type ResID struct {
48
        id uint8
49
}
50

51
// Batch is like a filter for batch processing of entities.
52
// Create it using [Filter2.Batch] etc.
53
type Batch struct {
54
        filter    filter
55
        relations []RelationID
56
}
57

58
// EntityDump is a dump of the entire entity data of the world.
59
//
60
// See [World.DumpEntities] and [World.LoadEntities].
61
type EntityDump struct {
62
        Entities  []Entity // Entities in the World's entity pool.
63
        Alive     []uint32 // IDs of all alive entities in query iteration order.
64
        Next      uint32   // The next free entity of the World's entity pool.
65
        Available uint32   // The number of allocated and available entities in the World's entity pool.
66
}
67

68
// CompInfo provides information about a registered component.
69
// Returned by [ComponentInfo].
70
type CompInfo struct {
71
        ID         ID
72
        Type       reflect.Type
73
        IsRelation bool
74
}
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