Return a collection of objects from a bitmask
<p>I "need" a better way to generate a collection of objects from a bitmask (a ushort passed,  on binary form it's interpreted as a mask) </p>

<p>The easy, non elegant solution would be:</p>

<p><code>  </p>

<pre><code>public static Things[] Decode(ushort mask)  
{  
    switch (mask)  
    {  
        case 1: // 1  
            return new[] { new Thing(0) };    
        case 2: //10  
            return new[] { new Thing(1) };  
        case 3: // 11  
            return new[] { new Thing(1), new Thing(0) };  
        case 4: // 100  
            return new[] { new Thing(2) };   
        case 5: // 101  
            return new[] { new Thing(2), new Thing(0) };  
</code></pre>

<p>// so on ......</p>

<p></code></p>
