本文整理汇总了C#中Card.IsType方法的典型用法代码示例。如果您正苦于以下问题:C# Card.IsType方法的具体用法?C# Card.IsType怎么用?C# Card.IsType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Card
的用法示例。
在下文中一共展示了Card.IsType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCardType
public static string GetCardType(Card c)
{
string str = "???";
if (c.IsType(CardType.TYPE_MONSTER))
{//卡片类型和第1效果
if (c.IsType(CardType.TYPE_XYZ))
{
str = GetType(CardType.TYPE_XYZ);
}
else if (c.IsType(CardType.TYPE_TOKEN))
{
str = GetType(CardType.TYPE_TOKEN);
}
else if (c.IsType(CardType.TYPE_RITUAL))
{
str = GetType(CardType.TYPE_RITUAL);
}
else if (c.IsType(CardType.TYPE_FUSION))
{
str = GetType(CardType.TYPE_FUSION);
}
else if (c.IsType(CardType.TYPE_SYNCHRO))
{
str = GetType(CardType.TYPE_SYNCHRO);
}
else if (c.IsType(CardType.TYPE_EFFECT))
{
str = GetType(CardType.TYPE_EFFECT);
}
else
str = GetType(CardType.TYPE_NORMAL);
str += GetType(CardType.TYPE_MONSTER);
}
else if (c.IsType(CardType.TYPE_SPELL))
{
if (c.IsType(CardType.TYPE_EQUIP))
str = GetType(CardType.TYPE_EQUIP);
else if (c.IsType(CardType.TYPE_QUICKPLAY))
str = GetType(CardType.TYPE_QUICKPLAY);
else if (c.IsType(CardType.TYPE_FIELD))
str = GetType(CardType.TYPE_FIELD);
else if (c.IsType(CardType.TYPE_CONTINUOUS))
str = GetType(CardType.TYPE_CONTINUOUS);
else if (c.IsType(CardType.TYPE_RITUAL))
str = GetType(CardType.TYPE_RITUAL);
else
str = GetType(CardType.TYPE_NORMAL);
str += GetType(CardType.TYPE_SPELL);
}
else if (c.IsType(CardType.TYPE_TRAP))
{
if (c.IsType(CardType.TYPE_CONTINUOUS))
str = GetType(CardType.TYPE_CONTINUOUS);
else if (c.IsType(CardType.TYPE_COUNTER))
str = GetType(CardType.TYPE_COUNTER);
else
str = GetType(CardType.TYPE_NORMAL);
str += GetType(CardType.TYPE_TRAP);
}
return str.Replace(" ", "");
}
示例2: ReadCard
//解析卡片
public Card ReadCard(string content, out string img)
{
string tmp;
int itmp;
Card c = new Card();
c.ot = (int)CardRule.OCGTCG;
//卡名
c.name = GetValue(content, TAG_NAME);
tmp = GetValue(content, TAG_LEVEL);
//卡片种族
c.race = GetRaceInt(GetValue(content, TAG_TYPE1));
//卡片类型
c.type = GetCardType(GetValue(content, TAG_CARDTYPE), tmp,
GetValue(content, TAG_TYPE2),
GetValue(content, TAG_TYPE3),
GetValue(content, TAG_TYPE4));
long t = GetSpellTrapType(GetValue(content, TAG_LEVEL));
//不是魔法,陷阱卡片的星数
if (!(c.IsType(CardType.TYPE_SPELL)
|| c.IsType(CardType.TYPE_TRAP)) && t == 0)
c.level = GetValue(content, TAG_LEVEL).Length;
//属性
c.attribute = GetAttributeInt(GetValue(content, TAG_ATTRIBUTE));
//密码
long.TryParse(GetValue(content, TAG_CODE), out c.id);
//ATK
tmp = GetValue(content, TAG_ATK);
if (tmp == UNKNOWN_ATKDEF)
c.atk = UNKNOWN_ATKDEF_VALUE;
else
int.TryParse(tmp, out c.atk);
//DEF
tmp = GetValue(content, TAG_DEF);
if (tmp == UNKNOWN_ATKDEF)
c.def = UNKNOWN_ATKDEF_VALUE;
else
int.TryParse(tmp, out c.def);
//图片
img = GetValue(content, TAG_IMAGE);
//摇摆
if (c.IsType(CardType.TYPE_PENDULUM))
{//根据预设的模版,替换内容
tmp = cfg.temp_text.Replace(TAG_REP_TEXT,
GetMultiValue(content,TAG_TEXT));
tmp = tmp.Replace(TAG_REP_PTEXT,
GetMultiValue(content, TAG_PEND_TEXT));
c.desc = tmp;
}
else
c.desc = GetMultiValue(content,TAG_TEXT);
//摇摆刻度
int.TryParse(GetValue(content, TAG_PSCALE1), out itmp);
c.level += (itmp << 0x18);
int.TryParse(GetValue(content, TAG_PSCALE2), out itmp);
c.level += (itmp << 0x10);
return c;
}
示例3: GetSpellTrapSymbol
//获取魔法陷阱的类型符号
public string GetSpellTrapSymbol(Card c, bool isSpell)
{
string level;
if (c.IsType(CardType.TYPE_EQUIP))
level = MseSpellTrap.EQUIP;
else if (c.IsType(CardType.TYPE_QUICKPLAY))
level = MseSpellTrap.QUICKPLAY;
else if (c.IsType(CardType.TYPE_FIELD))
level = MseSpellTrap.FIELD;
else if (c.IsType(CardType.TYPE_CONTINUOUS))
level = MseSpellTrap.CONTINUOUS;
else if (c.IsType(CardType.TYPE_RITUAL))
level = MseSpellTrap.RITUAL;
else if (c.IsType(CardType.TYPE_COUNTER))
level = MseSpellTrap.COUNTER;
else if (cfg.str_spell == MSEConfig.TAG_REP && cfg.str_trap == MSEConfig.TAG_REP)
level = MseSpellTrap.NORMAL;//带文字的图片
else
level = "";
if (isSpell)
level = cfg.str_spell.Replace(MSEConfig.TAG_REP, level);
else
level = cfg.str_trap.Replace(MSEConfig.TAG_REP, level);
return level;
}
示例4: GetTypes
//获取卡片类型
public string[] GetTypes(Card c)
{
//卡片类型,效果1,效果2,效果3
string[] types = new string[] {
MseCardType.CARD_NORMAL, "", "", "" };
if (c.IsType(CardType.TYPE_MONSTER))
{//卡片类型和第1效果
if (c.IsType(CardType.TYPE_XYZ))
{
types[0] = MseCardType.CARD_XYZ;
types[1] = GetType(CardType.TYPE_XYZ);
}
else if (c.IsType(CardType.TYPE_TOKEN))
{
types[0] = (c.race == 0) ?
MseCardType.CARD_TOKEN2
: MseCardType.CARD_TOKEN;
types[1] = GetType(CardType.TYPE_TOKEN);
}
else if (c.IsType(CardType.TYPE_RITUAL))
{
types[0] = MseCardType.CARD_RITUAL;
types[1] = GetType(CardType.TYPE_RITUAL);
}
else if (c.IsType(CardType.TYPE_FUSION))
{
types[0] = MseCardType.CARD_FUSION;
types[1] = GetType(CardType.TYPE_FUSION);
}
else if (c.IsType(CardType.TYPE_SYNCHRO))
{
types[0] = MseCardType.CARD_SYNCHRO;
types[1] = GetType(CardType.TYPE_SYNCHRO);
}
else if (c.IsType(CardType.TYPE_EFFECT))
{
types[0] = MseCardType.CARD_EFFECT;
}
else
types[0] = MseCardType.CARD_NORMAL;
//同调
if (types[0] == MseCardType.CARD_SYNCHRO
|| types[0] == MseCardType.CARD_TOKEN)
{
if (c.IsType(CardType.TYPE_TUNER)
&& c.IsType(CardType.TYPE_EFFECT))
{//调整效果
types[2] = GetType(CardType.TYPE_TUNER);
types[3] = GetType(CardType.TYPE_EFFECT);
}
else if (c.IsType(CardType.TYPE_TUNER))
{
types[2] = GetType(CardType.TYPE_TUNER);
}
else if (c.IsType(CardType.TYPE_EFFECT))
{
types[2] = GetType(CardType.TYPE_EFFECT);
}
}
else if (types[0] == MseCardType.CARD_NORMAL)
{
if (c.IsType(CardType.TYPE_PENDULUM))//灵摆
types[1] = GetType(CardType.TYPE_PENDULUM);
else if (c.IsType(CardType.TYPE_TUNER))//调整
types[1] = GetType(CardType.TYPE_TUNER);
}
else if (types[0] != MseCardType.CARD_EFFECT)
{//效果
if (c.IsType(CardType.TYPE_EFFECT))
types[2] = GetType(CardType.TYPE_EFFECT);
}
else
{//效果怪兽
types[2] = GetType(CardType.TYPE_EFFECT);
if (c.IsType(CardType.TYPE_PENDULUM))
types[1] = GetType(CardType.TYPE_PENDULUM);
else if (c.IsType(CardType.TYPE_TUNER))
types[1] = GetType(CardType.TYPE_TUNER);
else if (c.IsType(CardType.TYPE_SPIRIT))
types[1] = GetType(CardType.TYPE_SPIRIT);
else if (c.IsType(CardType.TYPE_TOON))
types[1] = GetType(CardType.TYPE_TOON);
else if (c.IsType(CardType.TYPE_UNION))
types[1] = GetType(CardType.TYPE_UNION);
else if (c.IsType(CardType.TYPE_DUAL))
types[1] = GetType(CardType.TYPE_DUAL);
else if (c.IsType(CardType.TYPE_FLIP))
types[1] = GetType(CardType.TYPE_FLIP);
else
{
types[1] = GetType(CardType.TYPE_EFFECT);
types[2] = "";
}
}
}
if (c.race == 0)//如果没有种族
{
types[1] = "";
//.........这里部分代码省略.........
示例5: getImageCache
/// <summary>
/// 图片缓存
/// </summary>
/// <param name="img"></param>
/// <param name="card"></param>
/// <returns></returns>
public string getImageCache(string img,Card card)
{
if(!cfg.reimage){
//不需要调整
return img;
}
bool isPendulum = card.IsType(CardType.TYPE_PENDULUM);
if(isPendulum){
if(cfg.pwidth<=0 && cfg.pheight<=0)
return img;
}else{
if(cfg.width<=0 && cfg.height<=0)
return img;
}
string md5=MyUtils.GetMD5HashFromFile(img);
if(MyUtils.Md5isEmpty(md5)||cfg.imagecache==null){
//md5为空
return img;
}
string file = MyPath.Combine(cfg.imagecache, md5);
if(!File.Exists(file)){
//生成缓存
Bitmap bmp=MyBitmap.readImage(img);
//缩放
if(isPendulum){
bmp=MyBitmap.Zoom(bmp, cfg.pwidth,cfg.pheight);
}else{
bmp=MyBitmap.Zoom(bmp, cfg.width,cfg.height);
}
//保存文件
MyBitmap.SaveAsJPEG(bmp, file,100);
}
return file;
}