Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

I'm not sure what serialize/deserialize is?


Cratthorax
 Share

Recommended Posts

2 hours ago, diesieben07 said:

Depends entirely on the context. As it stands those are two words that you can look up in a dictionary.

Lol. I didn't mean the literate word. Of course I can review that in a translator. By definition that would mean "to repeatedly, or in succession tag/label/numerize/sent/release something", if related to actual code?

I may as well completely expressed myself wrongly. What I mend was, when do I want to use it? Is it comparable to a "for loop", only it automatically applies numbered variables?

Does it have any relation to "produce in series"?

I've seen people using it, and asking for it all the time, yet I haven't had a case to use it myself. I just want to prepared, so I actually understand when I want to use it, once it shows up. I guess I'd use it when a serializer doesn't exist for a given tag/recipe/loot_table etc.?

Edited by Cratthorax
Link to comment
Share on other sites

In programming serialization usually means converting to a "storable" format. If you have an object in memory and you serialize it to e.g. JSON you can then store that JSON file on disk or send it over the network. If you then deserialize that JSON back into an object of that same type you have an equivalent object back.

Link to comment
Share on other sites

Oh, so load from/into memory?

Like this is adding a new "serializer" to the "acceptedItems" aka -> 0_0, 0_1, 0_2 etc.???, if the length is 1? If not, it will create a new array which will serialize like 0, 1, 2, 3?

I really still don't understand what I'm talking about.

 
	   public JsonElement serialize() {
      if (this.acceptedItems.length == 1) {
         return this.acceptedItems[0].serialize();
      } else {
         JsonArray jsonarray = new JsonArray();
	         for(Ingredient.IItemList ingredient$iitemlist : this.acceptedItems) {
            jsonarray.add(ingredient$iitemlist.serialize());
         }
	         return jsonarray;
      }
   }

 

Edited by Cratthorax
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.