Package appeng.me

Examples of appeng.me.Grid


      if ( te instanceof IGridHost )
      {
        GridNode node = (GridNode) ((IGridHost) te).getGridNode( ForgeDirection.getOrientation( side ) );
        if ( node != null )
        {
          Grid g = node.getInternalGrid();
          IGridNode center = g.getPivot();
          outputMsg( player, "This Node: " + node.toString() );
          outputMsg( player, "Center Node: " + center.toString() );
         
          IPathingGrid pg = g.getCache( IPathingGrid.class );
          if ( pg.getControllerState() == ControllerState.CONTROLLER_ONLINE )
          {
            int length = 0;
           
            HashSet<IGridNode> next = new HashSet<IGridNode>();
            next.add( node );
           
            int maxLength = 10000;
           
            outer: while ( ! next.isEmpty() )
            {
              HashSet<IGridNode> current = next;
              next = new HashSet<IGridNode>();
             
              for ( IGridNode n : current )
              {
                if ( n.getMachine() instanceof TileController )
                  break outer;
               
                for ( IGridConnection c : n.getConnections() )
                  next.add( c.getOtherSide( n ) );
              }
             
              length++;
             
              if ( length > maxLength )
                break;
            }
           
            outputMsg( player, "Cable Distance: " + length );
          }
         
          if ( center.getMachine() instanceof PartP2PTunnel )
          {
            outputMsg( player, "Freq: " + ((PartP2PTunnel) center.getMachine()).freq );
          }

          TickManagerCache tmc = g.getCache( ITickManager.class );
          for (Class c : g.getMachineClasses())
          {
            int o = 0;
            long nanos = 0;
            for (IGridNode oj : g.getMachines( c ))
            {
              o++;
              nanos += tmc.getAvgNanoTime( oj );
            }
View Full Code Here

TOP

Related Classes of appeng.me.Grid

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.