JimmyCushnie / JECS

Jimmy's Epic Config System

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SUCC should be smart enough to use constructors when deserializing

JimmyCushnie opened this issue · comments

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