本文整理匯總了C#中WorldServer.player.Player.setRunEnergyLoad方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.setRunEnergyLoad方法的具體用法?C# Player.setRunEnergyLoad怎麽用?C# Player.setRunEnergyLoad使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WorldServer.player.Player
的用法示例。
在下文中一共展示了Player.setRunEnergyLoad方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: loadPlayer
//.........這裏部分代碼省略.........
if (!int.TryParse(element.InnerText, out temp)) {
createdPlayer.setLocation(Constants.HOME_SPAWN_LOCATION);
break;
}
location.setX(temp);
break;
case "Y":
if (!int.TryParse(element.InnerText, out temp)) {
createdPlayer.setLocation(Constants.HOME_SPAWN_LOCATION);
break;
}
location.setY(temp);
break;
case "Z":
if (!int.TryParse(element.InnerText, out temp))
temp = 0;
location.setZ(temp);
break;
}
}
createdPlayer.setLocation(location);
if (Location.atDuelArena(createdPlayer.getLocation()))
DuelSession.teleportDuelArenaHome(createdPlayer);
}
xmlNode = xmlDocument.SelectSingleNode("/Player/Settings/RunEnergy");
if (xmlNode == null)
{
temp = 100;
} else {
if (!int.TryParse(xmlNode.InnerText, out temp))
temp = 100;
}
createdPlayer.setRunEnergyLoad(temp);
loginElement = xmlDocument.SelectSingleNode("/Player/Settings/PrivacySettings");
if (loginElement != null && loginElement.HasChildNodes)
{
XmlNodeList childs = loginElement.ChildNodes;
Friends.STATUS publicStatus = Friends.STATUS.ON, privateStatus = Friends.STATUS.ON, tradeStatus = Friends.STATUS.ON;
foreach (XmlElement element in childs)
{
switch (element.Name)
{
case "Public":
publicStatus = (Friends.STATUS)Enum.Parse(typeof(Friends.STATUS), element.InnerText, true);
break;
case "Private":
privateStatus = (Friends.STATUS)Enum.Parse(typeof(Friends.STATUS), element.InnerText, true);
break;
case "Trade":
tradeStatus = (Friends.STATUS) Enum.Parse(typeof(Friends.STATUS), element.InnerText, true);
break;
}
}
createdPlayer.getFriends().setPrivacyOptions(publicStatus, privateStatus, tradeStatus);
}
loginElement = xmlDocument.SelectSingleNode("/Player/Friends");
if (loginElement != null && loginElement.HasChildNodes)
{
XmlNodeList childs = loginElement.ChildNodes; //number of Friends
foreach (XmlElement element in childs)
{