Commit 74e1072e authored by mercury233's avatar mercury233

fix getSetName

parent 2b482758
...@@ -461,16 +461,19 @@ public class GameStringHelper ...@@ -461,16 +461,19 @@ public class GameStringHelper
public static string getSetName(long Setcode) public static string getSetName(long Setcode)
{ {
var setcodes = new int[4];
for(var j = 0; j < 4; j++)
{
setcodes[j] = (int)((Setcode >> j * 16) & 0xffff);
}
var returnValue = new List<string>(); var returnValue = new List<string>();
var lastBaseType = 0xfff;
for (var i = 0; i < GameStringManager.xilies.Count; i++) for (var i = 0; i < GameStringManager.xilies.Count; i++)
{ {
var currentHash = GameStringManager.xilies[i].hashCode; var currentHash = GameStringManager.xilies[i].hashCode;
if (CardsManager.IfSetCard(currentHash, Setcode)) for(var j = 0; j < 4; j++)
{
if (currentHash == setcodes[j])
{ {
if ((lastBaseType & currentHash) == lastBaseType)
returnValue.RemoveAt(returnValue.Count - 1);
lastBaseType = currentHash & 0xfff;
var setArray = GameStringManager.xilies[i].content.Split('\t'); var setArray = GameStringManager.xilies[i].content.Split('\t');
var setString = setArray[0]; var setString = setArray[0];
//if (setArray.Length > 1) //if (setArray.Length > 1)
...@@ -480,7 +483,7 @@ public class GameStringHelper ...@@ -480,7 +483,7 @@ public class GameStringHelper
returnValue.Add(setString); returnValue.Add(setString);
} }
} }
}
return string.Join("|", returnValue.ToArray()); return String.Join("|", returnValue.ToArray());
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment