c# - Comparing values of lists -


Another list compared to the question. Now I want to compare one quantity of one item to another quantity, and if the amount of the first object is equal to or equal to the second object, then return the truth.

  public hair equal item 1, item item 2) {if item (item 1. e.l.s.s.s. (item 2.itm name) & item 1. item mark> gt; Item 2. ITMCount) {back true; }   

But the amount of the first item does not make any difference, it always gives the truth. Is there a problem with this block code or is it a problem anyway?

  var General Items = Items Insight (Inventory. Item, New List Compiler) ToList (); If (normal item number () == item. Calculation ()) {return output; }   

This is where I am comparing lists. Items in the items of 3 objects will be items. 1 rock, 1 twine and 2 vines, it is being compared to my inventory, and even if I have only 1 vine, then it gets right.

It has forgotten to add that the first block of code is in a class which

  public class list compactor: iCuLyty Comparifier & lt; Items & gt;    

Then you have a "recipe" such as [1 rock, 1 twig, 3 bell] , and you want to know that there are items with the least amount of your inventory.

One of the ways you can use this is:

  if (recipe = all = (Inventory.ei (i = & gt; i. Name == r.Name & amp; amp; i.ItemCount> gt; r.ItemCount)))   

Then, "if every recipe item is at least with the necessary amount Matches a commodity object ". It is believed that there can be nothing in any list.

What you should not do, nothing other than "equal" should be defined again by equal . Many framework codes work under the assumption that equals will work continuously - for example, a. The result of ecloss (B) will be similar to b.Equals (a). It's possible that you are currently running, because your code does not provide it, and falsely the method will trust it.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -