Class Network
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.network.Network
An abstract Network class to manage networks in a stateful way
- Author:
- meiamsome, TheBusyBiscuit
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidabstract NetworkComponentThis method assigns the givenLocationa type ofNetworkComponentfor classification.booleanvoiddisplay()abstract intgetRange()This method returns the range of theNetwork.intgetSize()This returns the size of thisNetwork.voidabstract voidonClassificationChange(Location l, NetworkComponent from, NetworkComponent to) voidtick()This method updates thisNetworkand serves as the starting point for any running operations.
-
Field Details
-
regulator
-
regulatorNodes
-
connectorNodes
-
terminusNodes
-
-
Constructor Details
-
Network
- Parameters:
manager- TheNetworkManagerinstanceregulator- TheLocationmarking the regulator of thisNetwork.
-
-
Method Details
-
getRange
public abstract int getRange()This method returns the range of theNetwork. The range determines how far theNetworkwill search for nearby nodes from any given node. It basically translates to the maximum distance between nodes.- Returns:
- the range of this
Network
-
classifyLocation
This method assigns the givenLocationa type ofNetworkComponentfor classification.- Parameters:
l- TheLocationto classify- Returns:
- The assigned type of
NetworkComponentfor thisLocation
-
onClassificationChange
- Parameters:
l- TheLocationthat is changing its classificationfrom- TheNetworkComponentthisLocationwas previously classified asto- TheNetworkComponentthisLocationis changing to
-
getSize
public int getSize()This returns the size of thisNetwork. It is equivalent to the amount ofLocationsconnected to thisNetwork.- Returns:
- The size of this
Network
-
addLocationToNetwork
- Parameters:
l- TheLocationto add
-
markDirty
- Parameters:
l- TheLocationto update
-
connectsTo
-
display
public void display() -
getRegulator
- Returns:
- The
Locationof our regulator
-
tick
public void tick()This method updates thisNetworkand serves as the starting point for any running operations.
-