Dan(Tasanar)

Moderator
I reported a bug about one of the new Doom Artifacts deleting on start up. That bug was fixed. I went back to double check all the other new doom artifacts, just added to the repo, and notice some Ser/DeSer were written one way while the others were written another way.


Code:
public override void Serialize(GenericWriter writer)
+       {
+           base.Serialize(writer);
+
+           writer.Write((int)0); // version
+       }
+
+       public override void Deserialize(GenericReader reader)
+       {
+           base.Deserialize(reader);
+
+           int version = reader.ReadInt();
+       }

and

Code:
public override void Serialize(GenericWriter writer)
+       {
+           base.Serialize(writer);
+
+           writer.WriteEncodedInt(0); // version
+       }
+
+       public override void Deserialize(GenericReader reader)
+       {
+           base.Deserialize(reader);
+
+           int version = reader.ReadEncodedInt();
+       }
+   }


Are they just two ways to say the exact same thing or would one be better than the other? Just curious and trying to learn.
 
Back