title: Is there a way to tell apart the items in a list?
body: <p>While this does concern Unity, it's actually more of a general programming question.</p>
  
  <p>So I can't use tuples, and I needed to return multiple float values. These are sort of like damage buffs. So I'll have the archer do extra damage to the cavalry, this damage is x. My code (cumbersome though it is) can tell it better: </p>
  
  <pre><code>private List&lt;float&gt; DetermineCounter()
  {
      CounterData cd = new CounterData();
  
      List&lt;float&gt; counterList = new List&lt;float&gt;();
  
      if (gameObject.tag == "Hoplite")
      {
         float archer = cd.counterArcher = 10.0f;
         float peltast = cd.counterPeltast =5.0f;
         float slinger = cd.counterSlinger = 20.0f;
  
          List&lt;float&gt; counterData = new List&lt;float&gt;();
          counterData.Add(archer);
          counterData.Add(peltast);
          counterData.Add(slinger);
  
          counterData = counterList;
  
  
      }
  
      if (gameObject.tag == "Peltast")
      {
          float archer = cd.counterArcher = 5.0f;
          float slinger = cd.counterSlinger = 5.0f;
  
          List&lt;float&gt; counterData = new List&lt;float&gt;();
          counterData.Add(archer);
          counterData.Add(slinger);
  
          counterData = counterList;
  
      }
  
      if (gameObject.tag == "Archer")
      {
          float cavalry = cd.counterCavalry = 15.0f;
          float slinger = cd.counterSlinger = 10.0f;
  
          List&lt;float&gt; counterData = new List&lt;float&gt;();
          counterData.Add(cavalry);
          counterData.Add(slinger);
  
          counterData = counterList;
  
      }
  
      if (gameObject.tag == "Cavalry")
      {
          float hoplite = cd.counterHoplite = 20.0f;
          float peltast = cd.counterPeltast = 10.0f;
  
          List&lt;float&gt; counterData = new List&lt;float&gt;();
          counterData.Add(hoplite);
          counterData.Add(peltast);
  
          counterData = counterList;
  
      }
      return counterList;
  
  }
  </code></pre>
  
  <p>So it returns 2 or 3 values, depending on which object I have the script on. So if it's an archer that I have the script on, then it will return the values 15 and 10. My problem is that these aren't just any values, they mean something specific. 15 pertains to the additional damage factor against the cavalry, and this information is important. </p>
  
  <p>So when I use a foreach for the list, there's no way of determining what each value corresponds to. I was wondering if there is a way of remedying this?</p>