Commit 84fa5b10 authored by wind2009's avatar wind2009 Committed by mercury233

Add ClientCard.HasSetCode (#99)

parent b7ed7c75
...@@ -247,6 +247,21 @@ namespace WindBot.Game ...@@ -247,6 +247,21 @@ namespace WindBot.Game
return (Attribute & (int)attribute) != 0; return (Attribute & (int)attribute) != 0;
} }
public bool HasSetcode(int setcode)
{
if (Data == null) return false;
long setcodes = Data.Setcode;
int settype = setcode & 0xfff;
int setsubtype = setcode & 0xf000;
while (setcodes > 0)
{
long check_setcode = setcodes & 0xffff;
setcodes >>= 16;
if ((check_setcode & 0xfff) == settype && (check_setcode & 0xf000 & setsubtype) == setsubtype) return true;
}
return false;
}
public bool IsMonster() public bool IsMonster()
{ {
return HasType(CardType.Monster); return HasType(CardType.Monster);
......
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