0

this code is the original from metadata:

public static int GetZhuoyueAttributeCount(int excellenceInfo)
        {
            if (excellenceInfo <= 0)
            {
                return 0;
            }
            int num = 0;
            int num2 = 32;
            for (int i = 0; i < num2; i++)
            {
                if (Global.GetIntSomeBit(excellenceInfo, i) == 1)
                {
                    num++;
                }
            }
            return num;
        }

and I want just to change the return value from return num; to return Math.Min(6,num); so the code must be like this

public static int GetZhuoyueAttributeCount(int excellenceInfo)
        {
            if (excellenceInfo <= 0)
            {
                return 0;
            }
            int num = 0;
            int num2 = 32;
            for (int i = 0; i < num2; i++)
            {
                if (Global.GetIntSomeBit(excellenceInfo, i) == 1)
                {
                    num++;
                }
            }
            return Math.Min(6, num);
        }

Was trying to find the right direction on how to make this done.

0 Answers0