java.lang.Object
com.portingdeadmods.researchd.client.screens.research.graph.lines.ResearchHead

public class ResearchHead extends Object
  • Constructor Details

    • ResearchHead

      public ResearchHead(int x, int y, boolean isInput)
      Parameters:
      x - Should be based on the x position of the node, split evenly if there are multiple heads
      y - Should be the y position of the node
      (+ Node height if it's output)
      isInput - Should be true if it's an input head, false if it's an output head
  • Method Details

    • getX

      public int getX()
    • getY

      public int getY()
    • setX

      public void setX(int x)
    • setY

      public void setY(int y)
    • getConnectionPoint

      public Point getConnectionPoint()
      Returns:
      The point where the last pixel is drawn for the head (going from the node outwards)
    • isInput

      public boolean isInput()
    • translate

      public void translate(int dx, int dy)
    • render

      public void render(net.minecraft.client.gui.GuiGraphics graphics)
    • inputsOf

      public static com.portingdeadmods.portingdeadlibs.utils.UniqueArray<ResearchHead> inputsOf(ResearchNode node)
      Parameters:
      node - ResearchNode to get input heads for
      Returns:
      UniqueArray of input heads, order left -> right
    • outputsOf

      public static com.portingdeadmods.portingdeadlibs.utils.UniqueArray<ResearchHead> outputsOf(ResearchNode node)
      Parameters:
      node - ResearchNode to get output heads for
      Returns:
      UniqueArray of output heads, order left -> right
    • inputsOf

      public static com.portingdeadmods.portingdeadlibs.utils.UniqueArray<ResearchHead> inputsOf(ResearchNode node, Collection<ResearchNode> visibleNodes)
      Parameters:
      node - ResearchNode to get input heads for
      visibleNodes - Collection of visible nodes in the current graph
      Returns:
      UniqueArray of input heads, order left -> right
    • outputsOf

      public static com.portingdeadmods.portingdeadlibs.utils.UniqueArray<ResearchHead> outputsOf(ResearchNode node, Collection<ResearchNode> visibleNodes)
      Parameters:
      node - ResearchNode to get output heads for
      visibleNodes - Collection of visible nodes in the current graph
      Returns:
      UniqueArray of output heads, order left -> right
    • createInputHeads

      public static com.portingdeadmods.portingdeadlibs.utils.UniqueArray<ResearchHead> createInputHeads(ResearchNode node, int count)
      Creates a specific number of input heads for a node, evenly distributed along the top edge.
      Parameters:
      node - The research node to create input heads for
      count - The number of input heads to create
      Returns:
      A UniqueArray of evenly distributed input heads
    • createOutputHeads

      public static com.portingdeadmods.portingdeadlibs.utils.UniqueArray<ResearchHead> createOutputHeads(ResearchNode node, int count)
      Creates a specific number of output heads for a node, evenly distributed along the bottom edge.
      Parameters:
      node - The research node to create output heads for
      count - The number of output heads to create
      Returns:
      A UniqueArray of evenly distributed output heads
    • getColor

      public int getColor()
    • setColor

      public void setColor(int color)