GraphMine

graphmine-core / io.github.sof3.graphmine.feature

Package io.github.sof3.graphmine.feature

Types

DoubleFeatureHandler class DoubleFeatureHandler<Node1 : FeatureNode<Node1, Inst1>, Inst1 : FeatureNodeInstance<Inst1, Node1>, Node2 : FeatureNode<Node2, Inst2>, Inst2 : FeatureNodeInstance<Inst2, Node2>> : FeatureEdge<Node1, Node2, Inst1, Inst2>
FeatureEdge interface FeatureEdge<Node1 : FeatureNode<Node1, Inst1>, Node2 : FeatureNode<Node2, Inst2>, Inst1 : FeatureNodeInstance<Inst1, Node1>, Inst2 : FeatureNodeInstance<Inst2, Node2>>
Represents the implementation of a feature.
FeatureEvent interface FeatureEvent
Represents an event on some node(s). Implementations shall contain mutable and immutable properties for FeatureEdges to read and modify, except the FeatureNodeInstances do not need to be in the event since they are passed to the event in a different way.
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).
FeatureNode interface FeatureNode<Self : FeatureNode<Self, Inst>, Inst : FeatureNodeInstance<Inst, Self>>
Represents a concrete or abstract concept that can interact with itself or other FeatureNodes, such as an entity, a block, a client or a command.
FeatureNodeInstance interface FeatureNodeInstance<Self : FeatureNodeInstance<Self, Node>, Node : FeatureNode<Node, Self>>
Represents an instance of FeatureNode. The FeatureNode represents the type in general, while FeatureNodeInstance represents each instance of the type. It is valid for FeatureNodeInstance to be singleton or even same as the FeatureNode. For example, each instance of the Client class represents one client, while the singleton Client.Node companion object represents the client type.
SingleFeatureEdge interface SingleFeatureEdge<Node : FeatureNode<Node, Inst>, Inst : FeatureNodeInstance<Inst, Node>> : FeatureEdge<Node, Node, Inst, Inst>
Convenience implementation of self-looping FeatureEdge
SingleFeatureHandler class SingleFeatureHandler<Node : FeatureNode<Node, Inst>, Inst : FeatureNodeInstance<Inst, Node>> : SingleFeatureEdge<Node, Inst>

Functions

handle fun <Node : FeatureNode<Node, Inst>, Inst : FeatureNodeInstance<Inst, Node>, Ev : FeatureEvent> FeatureGraph.handle(node: Node, fn: (inst: Inst, event: Ev) -> Unit): Unit
A 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): Unit
A convenient wrapper for FeatureGraph.addEdge and FeatureEdge construction (for two nodes)