Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2015-05-04 19:10:11, last edited by den3107 (2015-06-14 15:32:46)

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

[CODE] [C#] WorldData deserializer & how to use

As the title says a WorldData deserializer for the latest EE version, written in C#.

The code is completely commented and also contains help on how to use it.

This is an updated and improved version of Capasha's deserializer.

The title shows for which version of EE it is. When this isn't the same as EE's current version then it's outdated.

Code:
http://pastebin.com/DsWyWxj9

How to use:
It's advisable to put the code snippet inside a method/function, but not required.

The code snippet uses variables that define the read data, personalized per block.

After the for-lop, but still inside the while-loop you can handle the found information.
Do mind that you should first check what variables have been given a value to (if the value of a variable is -1 or null that means the block doesn't use that data).

Offline

#2 2015-05-04 20:34:15

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: [CODE] [C#] WorldData deserializer & how to use

Updated:
You could get the position of only the first item, it's updated so you actually receive all blocks with all their positions.
(A block is mentioned only once, but with positions for all occurrences of the block)

Offline

#3 2015-05-04 23:08:25

DarkDragon4900
Member
Joined: 2015-03-17
Posts: 251

Re: [CODE] [C#] WorldData deserializer & how to use

den3107 wrote:

(A block is mentioned only once, but with positions for all occurrences of the block)

That's basically the way init gives the block list to the player.
Anyhow, it looks good.

Offline

#4 2015-05-04 23:46:06

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: [CODE] [C#] WorldData deserializer & how to use

DarkDragon4900 wrote:
den3107 wrote:

(A block is mentioned only once, but with positions for all occurrences of the block)

That's basically the way init gives the block list to the player.

I knew that, though forgot to actually implement it...
Basically put it there since I know that people that have never been in touch with RoomData are not aware of this (and might want to be).

DarkDragon4900 wrote:

Anyhow, it looks good.

Glad you like it, much appreciated!

Offline

#5 2015-05-09 00:09:49

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: [CODE] [C#] WorldData deserializer & how to use

Quick update:
Previously you could only use the world deserializer for the "init" event.
Now you can also use it for the "reset" event.

Offline

den31071431126589502707

Board footer

Powered by FluxBB

[ Started around 1732476811.1315 - Generated in 0.030 seconds, 10 queries executed - Memory usage: 1.41 MiB (Peak: 1.52 MiB) ]