graphmine-core / io.github.sof3.graphmine.feature / FeatureGraph
class FeatureGraph
The Feature Graph is the main registry of features in the server. It is an undirected multi-graph that allows FeatureEdges (the features themselves) to handle interaction events (FeatureEvent) between FeatureNodes (the objects of features, e.g. entities, blocks, or abstract concepts like commands), or self-loop edges that handle events on a single object (e.g. player join).
| <init> | FeatureGraph()The Feature Graph is the main registry of features in the server. It is an undirected multi-graph that allows FeatureEdges (the features themselves) to handle interaction events (FeatureEvent) between FeatureNodes (the objects of features, e.g. entities, blocks, or abstract concepts like commands), or self-loop edges that handle events on a single object (e.g. player join). |
| edges | val edges: MutableMap<FeatureNode<*, *>, MutableMap<FeatureNode<*, *>, MutableSet<FeatureEdge<*, *, *, *>>>>the features registered on this server |
| addEdge | fun addEdge(edge: FeatureEdge<out FeatureNode<*, *>, out FeatureNode<*, *>, out FeatureNodeInstance<*, *>, out FeatureNodeInstance<*, *>>): UnitRegisters a FeatureEdge |
| addNode | fun addNode(node: FeatureNode<*, *>): UnitRegisters a FeatureNode so that edges can be added upon it |
| dispatch | fun <Inst1 : FeatureNodeInstance<Inst1, *>, Inst2 : FeatureNodeInstance<Inst2, *>> dispatch(inst1: Inst1, inst2: Inst2, event: FeatureEvent): UnitDispatch a single-node event fun <Inst : FeatureNodeInstance<Inst, *>> dispatch(inst: Inst, event: FeatureEvent): UnitDispatch a two-node event |
| handle | fun <Node : FeatureNode<Node, Inst>, Inst : FeatureNodeInstance<Inst, Node>, Ev : FeatureEvent> FeatureGraph.handle(node: Node, fn: (inst: Inst, event: Ev) -> Unit): UnitA convenient wrapper for FeatureGraph.addEdge and SingleFeatureEdge construction (for one node) fun <Node1 : FeatureNode<Node1, Inst1>, Inst1 : FeatureNodeInstance<Inst1, Node1>, Node2 : FeatureNode<Node2, Inst2>, Inst2 : FeatureNodeInstance<Inst2, Node2>, Ev : FeatureEvent> FeatureGraph.handle(node1: Node1, node2: Node2, fn: (inst1: Inst1, inst2: Inst2, event: Ev) -> Unit): UnitA convenient wrapper for FeatureGraph.addEdge and FeatureEdge construction (for two nodes) |