Skip to content

Commit 976e159

Browse files
author
abstrct
committed
reactor refactoring, but left the hooks for now.
1 parent 0199a18 commit 976e159

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package keeper
2+
3+
import (
4+
"structs/x/structs/types"
5+
)
6+
7+
// GetReactor returns a Reactor by ID, caching the result.
8+
func (cc *CurrentContext) GetReactor(reactorId string) (*ReactorCache) {
9+
if cache, exists := cc.reactors[reactorId]; exists {
10+
return cache
11+
}
12+
13+
cc.reactors[reactorId] = &ReactorCache{
14+
ReactorId: reactorId,
15+
CC: cc,
16+
ReactorLoaded: false,
17+
Changed: false,
18+
}
19+
20+
return cc.reactors[reactorId]
21+
}
22+

0 commit comments

Comments
 (0)