Exemplo n.º 1
0
        private void SortItems(object[] items, int[] values)
        {
            ArtifactList.SortData[] array = new ArtifactList.SortData[items.Length];
            for (int index = 0; index < items.Length; ++index)
            {
                array[index] = new ArtifactList.SortData(items[index], values[index]);
            }
            int result = 0;

            Array.Sort <ArtifactList.SortData>(array, (Comparison <ArtifactList.SortData>)((x, y) =>
            {
                result = x.mStatusValue - y.mStatusValue;
                if (result != 0)
                {
                    return(result);
                }
                result = x.artifactParam.CompareByID(y.artifactParam);
                if (result != 0 || !x.isArtifactData || !y.isArtifactData)
                {
                    return(result);
                }
                result = (int)x.artifactData.Lv - (int)y.artifactData.Lv;
                if (result != 0)
                {
                    return(result);
                }
                return(x.artifactData.Exp - y.artifactData.Exp);
            }));
            for (int index = 0; index < items.Length; ++index)
            {
                items[index]  = array[index].mArtifact;
                values[index] = array[index].mStatusValue;
            }
        }
Exemplo n.º 2
0
 private void SortItems(object[] items, int[] values)
 {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: variable of a compiler-generated type
     ArtifactList.\u003CSortItems\u003Ec__AnonStorey2FA itemsCAnonStorey2Fa = new ArtifactList.\u003CSortItems\u003Ec__AnonStorey2FA();
     ArtifactList.SortData[] array = new ArtifactList.SortData[items.Length];
     for (int index = 0; index < items.Length; ++index)
     {
         array[index] = new ArtifactList.SortData(items[index], values[index]);
     }
     // ISSUE: reference to a compiler-generated field
     itemsCAnonStorey2Fa.result = 0;
     // ISSUE: reference to a compiler-generated method
     Array.Sort <ArtifactList.SortData>(array, new Comparison <ArtifactList.SortData>(itemsCAnonStorey2Fa.\u003C\u003Em__307));
     for (int index = 0; index < items.Length; ++index)
     {
         items[index]  = array[index].mArtifact;
         values[index] = array[index].mStatusValue;
     }
 }