示例#1
0
 public static Hacknet.Folder AddRandomFile(this Hacknet.Folder self, object name = null, uint?id = null) =>
 self.AddFile(name as string ??
              Hacknet.FileEntry.filenames[
                  (int)Math.Min(
                      (name as long?).GetValueOrDefault(),
                      Hacknet.FileEntry.filenames.Count - 1
                      )
              ],
              Hacknet.FileEntry.fileData[
                  (int)Math.Min(
                      id.Value,
                      Hacknet.FileEntry.filenames.Count - 1)
              ]);
示例#2
0
 public static Hacknet.Folder AddExecutableFile(this Hacknet.Folder self, string name, int id) =>
 self.AddFile(name, ExeInfoManager.GetExecutableInfo(id).Data);
示例#3
0
 public static Hacknet.Folder AddFile(this Hacknet.Folder self, string name, uint?dataIndex = null) =>
 self.AddFile(name,
              Hacknet.FileEntry.fileData[(int)Math.Min(dataIndex.Value,
                                                       Hacknet.FileEntry.filenames.Count - 1
                                                       )]);
示例#4
0
 public static Hacknet.Folder AddExecutableFile(this Hacknet.Folder self, string name, string id) =>
 self.AddFile(name,
              ExeInfoManager.GetExecutableInfo(id).Data ??
              Executable.Handler.GetStandardFileDataBy(id, true));
示例#5
0
 public static Hacknet.Folder AddFile(this Hacknet.Folder self, string name, Executable.IInterface data) =>
 self.AddFile(name, Executable.Handler.GetStandardFileDataBy(data));