How does one declare a static array of custom data type with hard-coded values?
<p><strong>Goal:</strong></p>

<p>I want to implement a hard-coded lookup table for data that doesn't change often, but when it does change I want to be able to quickly update the program and rebuild.</p>

<p><strong>Plan:</strong></p>

<p>My plan was to define a custom data type like so...</p>

<pre><code>private class ScalingData
{
    public float mAmount;
    public String mPurpose;
    public int mPriority;

    ScalingData(float fAmount, String strPurpose, int iPriority)
    {
        mAmount = fAmount;
        mPurpose = strPurpose;
        mPriority = iPriority;
    }
}
</code></pre>

<p>and then, in the main class, hard-code the array like so ...</p>

<pre><code>public static ScalingData[] ScalingDataArray =
{
        {1.01f, "Data point 1", 1},
        {1.55f, "Data point 2", 2}
};
</code></pre>

<p>However, this doesn't build. I keep seeing the message "Type mismatch: cannot convert from float[] to ScalingData".</p>

<p>How can I achieve my objective ?</p>

<p><strong>UPDATE</strong></p>

<p>I've attempted to implement the suggestions so far, but still running into an error...</p>

<p>The code looks like:</p>

<pre><code>public class CustomConverter
{
    //Lookup Table
    private static ScalingData[] ScalingDataArray =
    {
        new ScalingData(1.01f, "Data point 1", 1),
        new ScalingData(1.55f, "Data point 2", 2)
    };


    //Constructor
    CustomConverter()
    {
        //does stuff
    }


    //Custom Data type
    private class ScalingData
    {
        public float mAmount;
        public String mPurpose;
        public int mPriority;

        ScalingData(float fAmount, String strPurpose, int iPriority)
        {
            mAmount = fAmount;
            mPurpose = strPurpose;
            mPriority = iPriority;
        }
    }
}
</code></pre>

<p>and the error with the hard-coded array is <code>No enclosing instance of type CustomConverter is accessible. Must qualify the allocation with an enclosing instance of type CustomConverter (e.g. x.new A() where x is an instance of CustomConverter).</code></p>

<p><strong>EDIT... complete solution as per answers below</strong></p>

<pre><code>public class CustomConverter
{
    //Lookup Table
    private static ScalingData[] ScalingDataArray =
    {
        new ScalingData(1.01f, "Data point 1", 1),
        new ScalingData(1.55f, "Data point 2", 2)
    };


    //Constructor
    CustomConverter()
    {
        //does stuff
    }


    //Custom Data type
    private static class ScalingData
    {
        public float mAmount;
        public String mPurpose;
        public int mPriority;

        ScalingData(float fAmount, String strPurpose, int iPriority)
        {
            mAmount = fAmount;
            mPurpose = strPurpose;
            mPriority = iPriority;
        }
    }
}
</code></pre>
