Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Serialize not public on math types #418

Closed
Fleischner opened this issue Jun 19, 2014 · 2 comments
Closed

Serialize not public on math types #418

Fleischner opened this issue Jun 19, 2014 · 2 comments

Comments

@Fleischner
Copy link

In the math types (e.g. Vector3) the IDataSerializable Interface method serialize is not public. I need this method public to copy the data to a Byte Array using the BinarySerializer

Current method is private
void IDataSerializable.Serialize(BinarySerializer serializer)

Changing to gives an compile error:
public void IDataSerializable.Serialize(BinarySerializer serializer)

But the following seems to work fine
public void Serialize(BinarySerializer serializer)

I suggest to change in the next release, if there are no other side effects

@dfkeenan
Copy link
Contributor

IDataSerializable has been implemented explicitly. Meaning you have to cast the value to type IDataSerializable first.

@ArtiomCiumac
Copy link
Contributor

@dfkeenan is right - the interface is implemented explicitly and you need to cast to IDataSerializable. Alternatively you can use BinarySerializer.Save method. There are no plans to make this implementation public as it may be removed completely in future releases for the reasons described in #398.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants