示例#1
0
 public override int GetHashCode()
 {
     return(((RefObj?.GetHashCode() ?? 0) * 397) ^ (ParamName?.GetHashCode() ?? 0));
 }
示例#2
0
        public override bool CreateField(BinaryFileReader r, GameFormat format, string type, int dataSize)
        {
            //Console.WriteLine($"   {type}");
            if (!InFRMR && type == "FRMR")
            {
                InFRMR = true;
            }
            if (!InFRMR)
            {
                switch (type)
                {
                case "EDID":
                case "NAME": EDID = r.ReadSTRV(dataSize); return(true);

                case "FULL":
                case "RGNN": FULL = r.ReadSTRV(dataSize); return(true);

                case "DATA": DATA = r.ReadINTV(format == GameFormat.TES3 ? 4 : dataSize).ToUI16Field(); if (format == GameFormat.TES3)
                    {
                        goto case "XCLC";
                    }
                    return(true);

                case "XCLC": XCLC = r.ReadT <XCLCField>(format == GameFormat.TES3 ? 8 : dataSize); return(true);

                case "XCLL":
                case "AMBI": XCLL = r.ReadT <XCLLField>(dataSize); return(true);

                case "XCLW":
                case "WHGT": XCLW = r.ReadT <FLTVField>(dataSize); return(true);

                // TES3
                case "NAM0": NAM0 = r.ReadT <UI32Field>(dataSize); return(true);

                case "INTV": INTV = r.ReadINTV(dataSize); return(true);

                case "NAM5": NAM5 = r.ReadT <CREFField>(dataSize); return(true);

                // TES4
                case "XCLR":
                    XCLRs = new FMIDField <REGNRecord> [dataSize >> 2];
                    for (var i = 0; i < XCLRs.Length; i++)
                    {
                        XCLRs[i] = new FMIDField <REGNRecord>(r, 4);
                    }
                    return(true);

                case "XCMT": XCMT = r.ReadT <BYTEField>(dataSize); return(true);

                case "XCCM": XCCM = new FMIDField <CLMTRecord>(r, dataSize); return(true);

                case "XCWT": XCWT = new FMIDField <WATRRecord>(r, dataSize); return(true);

                case "XOWN": XOWNs.Add(new XOWNGroup {
                        XOWN = new FMIDField <Record>(r, dataSize)
                    }); return(true);

                case "XRNK": XOWNs.Last().XRNK = r.ReadT <IN32Field>(dataSize); return(true);

                case "XGLB": XOWNs.Last().XGLB = new FMIDField <Record>(r, dataSize); return(true);

                default: return(false);
                }
            }
            // Referenced Object Data Grouping
            else
            {
                switch (type)
                {
                // RefObjDataGroup sub-records
                case "FRMR":
                    _lastRef      = new RefObj(); RefObjs.Add(_lastRef);
                    _lastRef.FRMR = r.ReadT <UI32Field>(dataSize); return(true);

                case "NAME": _lastRef.EDID = r.ReadSTRV(dataSize); return(true);

                case "XSCL": _lastRef.XSCL = r.ReadT <FLTVField>(dataSize); return(true);

                case "DODT": _lastRef.DODT = r.ReadT <RefObj.XYZAField>(dataSize); return(true);

                case "DNAM": _lastRef.DNAM = r.ReadSTRV(dataSize); return(true);

                case "FLTV": _lastRef.FLTV = r.ReadT <FLTVField>(dataSize); return(true);

                case "KNAM": _lastRef.KNAM = r.ReadSTRV(dataSize); return(true);

                case "TNAM": _lastRef.TNAM = r.ReadSTRV(dataSize); return(true);

                case "UNAM": _lastRef.UNAM = r.ReadT <BYTEField>(dataSize); return(true);

                case "ANAM": _lastRef.ANAM = r.ReadSTRV(dataSize); return(true);

                case "BNAM": _lastRef.BNAM = r.ReadSTRV(dataSize); return(true);

                case "INTV": _lastRef.INTV = r.ReadT <IN32Field>(dataSize); return(true);

                case "NAM9": _lastRef.NAM9 = r.ReadT <UI32Field>(dataSize); return(true);

                case "XSOL": _lastRef.XSOL = r.ReadSTRV(dataSize); return(true);

                case "DATA": _lastRef.DATA = r.ReadT <RefObj.XYZAField>(dataSize); return(true);

                //
                case "CNAM": _lastRef.CNAM = r.ReadSTRV(dataSize); return(true);

                case "NAM0": _lastRef.NAM0 = r.ReadT <UI32Field>(dataSize); return(true);

                case "XCHG": _lastRef.XCHG = r.ReadT <IN32Field>(dataSize); return(true);

                case "INDX": _lastRef.INDX = r.ReadT <IN32Field>(dataSize); return(true);

                default: return(false);
                }
            }
        }
示例#3
0
 void RefMethod2(RefObj o) => RefMethod3(o);
示例#4
0
 void RefMethod3(RefObj o)
 {
     o.Foo = 0;
     Console.WriteLine($"*** oInit Foo final (should be 0) {oInit.Foo} ***");
 }
示例#5
0
 void RefMethod1(RefObj o) => RefMethod2(o);