本文整理汇总了C#中SkillName.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# SkillName.ToString方法的具体用法?C# SkillName.ToString怎么用?C# SkillName.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkillName
的用法示例。
在下文中一共展示了SkillName.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryParse
public static bool TryParse( Mobile m, string toParse, ref SkillName skill )
{
try
{
skill = (SkillName)Enum.Parse( typeof( SkillName ), toParse, true );
}
catch
{
m.SendMessage( "{0} is an invalid skill name.", skill.ToString() );
return false;
}
return true;
}
示例2: FindSkillMobs
// Does search... returns ArrayList reference for mobiles that matched
public static ArrayList FindSkillMobs(SkillName skill, int elapsed)
{
if (elapsed == 0) elapsed = 2; // Default
//ArrayList MobStates = NetState.Instances;
List<NetState> MobStates = NetState.Instances;
ArrayList MobMatches = new ArrayList(NetState.Instances.Count);
LogHelper Logger = new LogHelper("findskill.log", false, true);
// Loop through active connections' mobiles and check conditions
for (int i = 0; i < MobStates.Count; ++i)
{
Mobile m = MobStates[i].Mobile;
// If m defined & PlayerMobile, get involved (not explicit)
if (m != null)
{
if (m is PlayerMobile)
{
PlayerMobile pm = (PlayerMobile)m;
SkillName LastSkill = pm.LastSkillUsed;
DateTime LastTime = pm.LastSkillTime;
// Check time & skill, display if match
if (LastSkill == skill && DateTime.Now <= (LastTime + TimeSpan.FromSeconds(elapsed * 60)))
MobMatches.Add(pm);
}
}
}
if (MobMatches.Count > 0)
{
// Loop through matches and log before returning
foreach (PlayerMobile pm in MobMatches)
Logger.Log(LogType.Mobile, pm, skill.ToString());
Logger.Finish();
}
return MobMatches;
}
示例3: ArmorOfCrafting
public ArmorOfCrafting( int bonus, int itemID, int skill ) : base( itemID )
{
i_SkillBonus = bonus;
i_Skill = skill;
Weight = 1;
PhysicalBonus = 2 + Utility.Random((int)(1.6*bonus));
FireBonus = 4 + Utility.Random((int)(1.6*bonus));
ColdBonus = 3 + Utility.Random((int)(1.6*bonus));
PoisonBonus = 3 + Utility.Random((int)(1.6*bonus));
EnergyBonus = 3 + Utility.Random((int)(1.6*bonus));
switch (i_Skill)
{
default: case 0: sn_SkillName = SkillName.Blacksmith; break;
case 1: sn_SkillName = SkillName.Mining; break;
case 2: sn_SkillName = SkillName.Tailoring; break;
case 3: sn_SkillName = SkillName.Carpentry; break;
case 4: sn_SkillName = SkillName.Lumberjacking; break;
}
string s_Type = "";
switch (itemID)
{
case 5062: default: ItemID = 5062; s_Type = "gloves"; break;
case 7609: ItemID = 7609; s_Type = "cap"; break;
case 5068: ItemID = 5068; s_Type = "tunic"; break;
case 5063: ItemID = 5063; s_Type = "gorget"; break;
case 5069: ItemID = 5069; s_Type = "arms"; break;
case 5067: ItemID = 5067; s_Type = "leggings"; break;
}
if (i_SkillBonus < 1)
Name = "Apprentices " + s_Type + " of " + sn_SkillName.ToString();
else if (i_SkillBonus <= 3)
Name = "Novices " + s_Type + " of " + sn_SkillName.ToString();
else
Name = "Masters " + s_Type + " of " + sn_SkillName.ToString();
this.Hue = CraftResources.GetHue( (CraftResource)Utility.RandomMinMax( (int)CraftResource.DullCopper, (int)CraftResource.Sunstone ) );
}