Exemple #1
0
        public static NwWaypoint?Deserialize(byte[] serialized)
        {
            CNWSWaypoint?waypoint = null;
            bool         result   = NativeUtils.DeserializeGff(serialized, (resGff, resStruct) =>
            {
                if (!resGff.IsValidGff("UTW"))
                {
                    return(false);
                }

                waypoint = new CNWSWaypoint(Invalid);
                if (waypoint.LoadWaypoint(resGff, resStruct, null).ToBool())
                {
                    waypoint.LoadObjectState(resGff, resStruct);
                    waypoint.m_oidArea = Invalid;
                    GC.SuppressFinalize(waypoint);
                    return(true);
                }

                waypoint.Dispose();
                return(false);
            });

            return(result && waypoint != null?waypoint.ToNwObject <NwWaypoint>() : null);
        }
Exemple #2
0
 public override byte[]? Serialize()
 {
     return(NativeUtils.SerializeGff("UTW", (resGff, resStruct) =>
     {
         Waypoint.SaveObjectState(resGff, resStruct);
         return Waypoint.SaveWaypoint(resGff, resStruct).ToBool();
     }));
 }