Hacknet-Pathfinder icon indicating copy to clipboard operation
Hacknet-Pathfinder copied to clipboard

Add ConvertToXElement method to ElementInfo

Open tenesiss opened this issue 2 years ago • 4 comments

Add ConvertToXElement method to ElementInfo

Related to issue #177

tenesiss avatar May 15 '22 17:05 tenesiss

I don't see the need for two versions of this method to exist (I would remove the static method). However, if there are to be two, one of them should probably call the other instead of having all of the code repeated.

SoundOfScooting avatar May 15 '22 17:05 SoundOfScooting

I don't see the need for two versions of this method to exist (I would remove the static method). However, if there are to be two, one of them should probably call the other instead of having all of the code repeated.

I think the static one can be useful in some specific cases, however I probably will call the static one in the other giving this as parameter

tenesiss avatar May 15 '22 17:05 tenesiss

Line 78 is blank.

SoundOfScooting avatar May 15 '22 17:05 SoundOfScooting

I don't see what the point of the static method would serve, why are you duplicating functionality? In any case you have an ElementInfo you can just call the Convert method on it, it actually would cause an NRE in the method if the ElementInfo was null, which would be the only reason I could conceive for maybe having a static method, and even if you solve the NRE, how is it any different from info?.ConvertToXElement()?

Spartan322 avatar May 16 '22 00:05 Spartan322