title: Using structs for Range variable type
body: <p>I am trying to make a struct for a range variable (minimum, maximum) with a few members and a method to know if between values.</p>
  
  <p>Right now my struct looks like this:</p>
  
  <pre><code>public struct NumRange
  {
      float maximum;
      float minimum;
  
      public NumRange(float min, float max) 
      {
          this.maximum = max;
          this.minimum = min;
      }
  
      public bool IsBetween(float value)
      {
          if (value &lt; maximum &amp;&amp; value &gt; minimum)
              return true;
  
          return false;
      }
  }
  </code></pre>
  
  <p>I want to be able to make number ranges by </p>
  
  <pre><code>NumRange test = new NumRange(15, 20);
  </code></pre>
  
  <p>The whole point of making this range variable type is to make a map key dictionary like:</p>
  
  <pre><code>public Dictionary&lt;NumRange, Color&gt; mapKey = new Dictionary&lt;NumRange, Color&gt;();
  NumRange test = new NumRange(15, 20);
  mapKey.Add(test, Color.Orange);
  </code></pre>
  
  <p>Is this the best way to go about it? Also it doesn't like when I try to add something to mapKey. Says there is invalid tokens such as ',' ')' '('</p>