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

mlange-42 / arche / 7568976173

18 Jan 2024 11:00AM CUT coverage: 100.0%. Remained the same
7568976173

push

github

web-flow
Fix relation events, reset target on relation change, document subscriptions (#340)

* Target is reset to zero when (ex)-changing the relation component
* `RelationChanged` always triggers `TargetChanged`
* Document subscription logic

5242 of 5242 relevant lines covered (100.0%)

61034.39 hits per line

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

100.0
/ecs/bitmask_common.go
1
package ecs
2

3
const wordSize = 64
4

5
// All creates a new Mask from a list of IDs.
6
// Matches all entities that have the respective components, and potentially further components.
7
//
8
// See also [Mask.Without] and [Mask.Exclusive]
9
//
10
// If any [ID] is greater than or equal to [MaskTotalBits], it will not be added to the mask.
11
func All(ids ...ID) Mask {
25,789✔
12
        var mask Mask
25,789✔
13
        for _, id := range ids {
51,984✔
14
                mask.Set(id, true)
26,195✔
15
        }
26,195✔
16
        return mask
25,789✔
17
}
18

19
// Matches the mask as filter against another mask.
20
func (b Mask) Matches(bits *Mask) bool {
77,074✔
21
        return bits.Contains(&b)
77,074✔
22
}
77,074✔
23

24
// Without creates a [MaskFilter] which filters for including the mask's components,
25
// and excludes the components given as arguments.
26
func (b Mask) Without(comps ...ID) MaskFilter {
7✔
27
        return MaskFilter{
7✔
28
                Include: b,
7✔
29
                Exclude: All(comps...),
7✔
30
        }
7✔
31
}
7✔
32

33
// Exclusive creates a [MaskFilter] which filters for exactly the mask's components.
34
// Matches only entities that have exactly the given components, and no other.
35
func (b Mask) Exclusive() MaskFilter {
6✔
36
        return MaskFilter{
6✔
37
                Include: b,
6✔
38
                Exclude: b.Not(),
6✔
39
        }
6✔
40
}
6✔
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