예제 #1
0
 /// <summary>
 /// Discovers Computer nodes by a name enumerable.
 /// </summary>
 /// <returns>A List of booleans for each discovered node</returns>
 /// <param name="netmap">The NetworkMap</param>
 /// <param name="names">The Computer names to discover</param>
 /// <param name="flashTime">The flash time length for the discovery</param>
 /// <seealso cref="DiscoverNodeByName"/>
 public static List <bool> DiscoverNodesByNames(this Hacknet.NetworkMap netmap,
                                                IEnumerable <string> names,
                                                float flashTime = 1f) =>
 netmap.DiscoverNodes(names.Select(s => netmap.GetComputerByName(s)), flashTime);
예제 #2
0
 /// <summary>
 /// Discovers a Computer node by name if it exists.
 /// </summary>
 /// <returns><c>true</c>, if node exists and was discovered, <c>false</c> otherwise.</returns>
 /// <param name="netmap">The NetworkMap</param>
 /// <param name="name">The Computer name to discover</param>
 /// <param name="flashTime">The flash time length for the discovery</param>
 public static bool DiscoverNodeByName(this Hacknet.NetworkMap netmap, string name, float flashTime = 1f) =>
 netmap.DiscoverNode(netmap.GetComputerByName(name), flashTime);