本文整理匯總了C#中System.Char.PackFromEquips方法的典型用法代碼示例。如果您正苦於以下問題:C# Char.PackFromEquips方法的具體用法?C# Char.PackFromEquips怎麽用?C# Char.PackFromEquips使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Char
的用法示例。
在下文中一共展示了Char.PackFromEquips方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CreateCharacter
public static Char CreateCharacter(short type, int chrId)
{
XElement cls = XmlDatas.TypeToElement[type];
if (cls == null) return null;
var ret = new Char
{
ObjectType = type,
CharacterId = chrId,
Level = 1,
Exp = 0,
CurrentFame = 0,
Backpack = 1,
_Equipment = cls.Element("Equipment").Value,
MaxHitPoints = int.Parse(cls.Element("MaxHitPoints").Value),
HitPoints = int.Parse(cls.Element("MaxHitPoints").Value),
MaxMagicPoints = int.Parse(cls.Element("MaxMagicPoints").Value),
MagicPoints = int.Parse(cls.Element("MaxMagicPoints").Value),
Attack = int.Parse(cls.Element("Attack").Value),
Defense = int.Parse(cls.Element("Defense").Value),
Speed = int.Parse(cls.Element("Speed").Value),
Dexterity = int.Parse(cls.Element("Dexterity").Value),
HpRegen = int.Parse(cls.Element("HpRegen").Value),
MpRegen = int.Parse(cls.Element("MpRegen").Value),
Tex1 = 0,
Tex2 = 0,
Dead = false,
PCStats = "",
FameStats = new FameStats(),
Pet = -1
};
ret.Backpacks = new Dictionary<int, short[]> { { 1, ret.PackFromEquips() } };
return ret;
}