Exemple #1
0
 public static Package Open(string path)
 {
     Package p = new Package();
     p._package = s3pi.Package.Package.OpenPackage(0, path, true);
     p._filename = path;
     return p;
 }
Exemple #2
0
        public static NameMap Load(Package _package)
        {
            NameMap nm = new NameMap();

            nm.resource = _package.FindResource(MatchNMAPResourceType);
            nm._package = _package;

            return nm.resource.IResource == null ? null : nm;
        }
Exemple #3
0
        public static NameMap New(Package _package, ulong? iid = null)
        {
            NameMap nm = new NameMap();

            nm.resource = _package.NewResource(NMAPResourceType, 0, iid.HasValue ? iid.Value : Package.NewInstance());
            nm._package = _package;

            return nm;
        }
Exemple #4
0
        public static List<ulong> FindAll(Package package)
        {
            List<ulong> seen = new List<ulong>();

            foreach (var rie in package.FindAll(x => x.ResourceType == StringTable.STBLResourceType))
            {
                ulong iid = rie.Instance & 0x00FFFFFFFFFFFFFF;
                if (!seen.Contains(iid))
                    seen.Add(iid);
            }

            return seen;
        }
Exemple #5
0
        public static StringTableSet Load(Package package, ulong iid)
        {
            if ((iid >> 56) != 0)
                throw new ArgumentException("Instance ID must not contain language to load StringTableSet");

            StringTableSet sts = new StringTableSet(package, iid);
            
            foreach (Language l in Enum.GetValues(typeof(Language)))
            {
                StringTable stl = StringTable.Load(package, l, iid);

                if (stl != null)
                {
                    stl.ResourceChanged += new EventHandler(sts.OnResourceChanged);
                    sts.Add(l, stl);
                }
            }

            return sts;
        }
Exemple #6
0
        public static StringTableSet New(Package package)
        {
            StringTableSet sts = new StringTableSet(package, Package.NewInstance() >> 8);

            return sts;
        }
Exemple #7
0
 private StringTableSet(Package package, ulong iid) { _iid = iid; _package = package; }
Exemple #8
0
 public static Package New()
 {
     Package p = new Package();
     p._package = s3pi.Package.Package.NewPackage(0);
     return p;
 }