Пример #1
0
        public override bool ResolveLinks()
        {
            var result = base.ResolveLinks();

            var entry = PCC.GetObjectEntry(_FuncIndex);

            if (entry != null)
            {
                FunctionName = entry.ObjectName;
                Function     = PCC.GetObjectEntry(_FuncIndex).Object as ME3Function;
            }
            if (Function == null) // TODO
            {
                return(true);     // this should be false, but until native objects are handled by the library this will have to do.
            }
            entry = PCC.GetObjectEntry(_DeleIndex);
            if (entry != null)
            {
                DelegateName = entry.ObjectName;
                Delegate     = PCC.GetObjectEntry(_DeleIndex).Object as ME3Function;
            }
            if (Delegate == null) // TODO
            {
                return(true);     // this should be false, but until native objects are handled by the library this will have to do.
            }
            return(result);
        }
Пример #2
0
        private ObjectTableEntry ReadObject()
        {
            var index     = ReadIndex();
            var remaining = DataContainer.DataScriptSize - (Position - _totalPadding);

            Buffer.BlockCopy(_data, Position, _data, Position + 4, remaining);  // copy the data forward
            Buffer.BlockCopy(new byte[] { 0, 0, 0, 0 }, 0, _data, Position, 4); // write 0 padding

            _totalPadding += 4;
            Position      += 4;

            return(PCC.GetObjectEntry(index));
        }
Пример #3
0
        public override bool ResolveLinks()
        {
            var result = base.ResolveLinks();

            var entry = PCC.GetObjectEntry(_ObjectIndex);

            if (entry != null)
            {
                Object = PCC.GetObjectEntry(_ObjectIndex).Object as ME3Object;
            }

            IsNativeImport = Object == null ? false : true;

            return(result);
        }
Пример #4
0
        public override bool ResolveLinks()
        {
            var result = base.ResolveLinks();

            var entry = PCC.GetObjectEntry(_EnumIndex);

            if (entry != null)
            {
                Enum = entry.Object as ME3Enum;
            }

            IsEnum = Enum == null ? false : true;

            return(result);
        }
Пример #5
0
        public override bool ResolveLinks()
        {
            var result = base.ResolveLinks();

            var entry = PCC.GetObjectEntry(_StructIndex);

            if (entry != null)
            {
                Struct = PCC.GetObjectEntry(_StructIndex).Object as ME3Object;
            }
            if (Struct == null) // TODO
            {
                return(true);   // this should be false, but until native objects are handled by the library this will have to do.
            }
            return(result);
        }
Пример #6
0
        public override bool ResolveLinks()
        {
            var result = base.ResolveLinks();

            OuterClass = PCC.GetExportObject(_OuterClassIndex) as ME3Class;

            ImplementedInterfaces = new List <ME3Class>();
            Components            = new List <ME3Object>();
            FunctionRefs          = new List <ME3Function>();

            foreach (var interfaceRef in _ImplInterfaces) // TODO: overhaul to objectableentry, or provide native object support.
            {
                var obj = PCC.GetExportObject(interfaceRef.ClassIndex);
                if (obj != null)
                {
                    ImplementedInterfaces.Add(obj as ME3Class);
                }
            }

            foreach (var component in _Components) // TODO: overhaul to objectableentry, or provide native object support.
            {
                var obj = PCC.GetExportObject(component.ComponentObjectIndex);
                if (obj != null)
                {
                    Components.Add(obj);
                }
            }

            foreach (var funcRef in _FunctionRefs) // TODO: overhaul
            {
                var entry = PCC.GetObjectEntry(funcRef);
                if (entry != null) // TODO: this shoud probably never happen.
                {
                    ME3Function func = entry.Object as ME3Function;
                    FunctionRefs.Add(func);
                }
            }

            States = new List <ME3State>();
            foreach (var state in Members.Where(s => typeof(ME3State) == s.GetType()))
            {
                States.Add(state as ME3State);
            }

            return(result);
        }