当前位置: 首页>>代码示例>>C#>>正文


C# GamePlayer.TryTranslateOrDefault方法代码示例

本文整理汇总了C#中GamePlayer.TryTranslateOrDefault方法的典型用法代码示例。如果您正苦于以下问题:C# GamePlayer.TryTranslateOrDefault方法的具体用法?C# GamePlayer.TryTranslateOrDefault怎么用?C# GamePlayer.TryTranslateOrDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GamePlayer的用法示例。


在下文中一共展示了GamePlayer.TryTranslateOrDefault方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetTitle

 public String GetTitle(GamePlayer player, int skillLevel)
 {
 	string profession = player.TryTranslateOrDefault("!Profession!", Profession);
     try
     {
     	return player.TryTranslateOrDefault("!None {0}!", GetTitleFormat(skillLevel), profession);
     }
     catch
     {
         return "<you may want to check your Crafting.txt language file>";
     }
 }
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:12,代码来源:AbstractProfession.cs

示例2: GetValue

		/// <summary>
		/// The title value, shown over player's head.
		/// </summary>
		/// <param name="source">The player looking.</param>
		/// <param name="player">The title owner.</param>
		/// <returns>The title value.</returns>
		public override string GetValue(GamePlayer source, GamePlayer player)
		{
			if (player.Champion && player.ChampionLevel > 0)
				return source.TryTranslateOrDefault(string.Format("!CL Title {0}!", player.ChampionLevel), string.Format("Titles.CL.Level{0}", player.ChampionLevel));
				
			return string.Empty;
		}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:13,代码来源:ChampionTitle.cs

示例3: GetValue

		/// <summary>
		/// The title value, shown over player's head.
		/// </summary>
		/// <param name="source">The player looking.</param>
		/// <param name="player">The title owner.</param>
		/// <returns>The title value.</returns>
		public override string GetValue(GamePlayer source, GamePlayer player)
		{
			if (player.CraftingPrimarySkill == eCraftingSkill.NoCrafting || !player.CraftingSkills.ContainsKey(player.CraftingPrimarySkill))
				return string.Format(source.TryTranslateOrDefault("!BasicCrafting!", "Crafting.Name.BasicCrafting"));
			
			var craftingSkill = CraftingMgr.getSkillbyEnum(player.CraftingPrimarySkill);
			var profession = craftingSkill as AbstractProfession;
			
			if (profession == null)
				return craftingSkill.Name;
			
			return profession.GetTitle(source, player.CraftingSkills[player.CraftingPrimarySkill]);
		}
开发者ID:mynew4,项目名称:DOLSharp,代码行数:19,代码来源:CraftTitle.cs

示例4: GetValue

		/// <summary>
		/// The title value, shown over player's head.
		/// </summary>
		/// <param name="source">The player looking.</param>
		/// <param name="player">The title owner.</param>
		/// <returns>The title value.</returns>
		public override string GetValue(GamePlayer source, GamePlayer player)
		{
			if (player.MLGranted && player.MLLevel > 0)
			{
				// try get player ML Number
				int mlline = GetPlayerMLLine(player);
				return source.TryTranslateOrDefault(string.Format("!ML Title {0}!", mlline), string.Format("Titles.ML.Line{0}", mlline));
			}
			
			return source.TryTranslateOrDefault("!None!", "DetailDisplayHandler.HandlePacket.None");
		}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:17,代码来源:MasterlevelTitle.cs

示例5: GetTitle

		public virtual string GetTitle(GamePlayer player, int level)
		{
			
			// Clamp level in 5 by 5 steps - 50 is the max available translation for now
			int clamplevel = Math.Min(50, (level / 5) * 5);
			
			string none = player.TryTranslateOrDefault("!None!", "PlayerClass.GetTitle.none");
			
			if (clamplevel > 0)
				return player.TryTranslateOrDefault(string.Format("!{0}!", m_name), string.Format("PlayerClass.{0}.GetTitle.{1}", m_name, clamplevel));

			return none;
		}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:13,代码来源:CharacterClassBase.cs

示例6: GetValue

		/// <summary>
		/// The title value, shown over player's head.
		/// </summary>
		/// <param name="source">The player looking.</param>
		/// <param name="player">The title owner.</param>
		/// <returns>The title value.</returns>
		public override string GetValue(GamePlayer source, GamePlayer player)
		{
			return source.TryTranslateOrDefault("!Level {0}!", "Titles.Level.Level20", player.Level);
		}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:10,代码来源:Level20Title.cs

示例7: GetDescription

		/// <summary>
		/// The title description, shown in "Titles" window.
		/// </summary>
		/// <param name="player">The title owner.</param>
		/// <returns>The title description.</returns>
		public override string GetDescription(GamePlayer player)
		{
			return player.TryTranslateOrDefault("!Level 20+!", "Titles.Level.Level20Info");
		}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:9,代码来源:Level20Title.cs

示例8: TryTranslate

		protected static string TryTranslate(string value, GamePlayer source)
		{
			return source.TryTranslateOrDefault(string.Format("!{0}!", value), value);
		}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:4,代码来源:GenericEventPlayerTitle.cs


注:本文中的GamePlayer.TryTranslateOrDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。