JimmyCushnie / JECS

Jimmy's Epic Config System
Do What The F*ck You Want To Public License
154 stars 16 forks source link

SUCC should be smart enough to use constructors when deserializing #37

Open JimmyCushnie opened 2 years ago

JimmyCushnie commented 2 years ago

Suppose I have the following class:

public class Color
{
    public byte R, G, B;
    public Color(byte r, byte g, byte b) => (R, G, B) = (r, g, b);
}

Currently, SUCC cannot deserialize this type, because it requires complex types to have a parameterless constructor. The system should be upgraded to check the constructor parameter names against the member names, and use those instead. Related: #14