本文整理汇总了C#中ISkill.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ISkill.GetType方法的具体用法?C# ISkill.GetType怎么用?C# ISkill.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISkill
的用法示例。
在下文中一共展示了ISkill.GetType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NotifyImpersonation
public void NotifyImpersonation(Player p, Hero impersonator, Hero impersonatedHero, ISkill acquiredSkill)
{
Application.Current.Dispatcher.Invoke((ThreadStart)delegate()
{
var view = playersMap[p];
var model = view.PlayerModel.GetHeroModel(impersonator);
Trace.Assert(model != null);
if (impersonatedHero == null)
{
model.ImpersonatedHeroName = string.Empty;
model.ImpersonatedSkill = string.Empty;
}
else
{
model.ImpersonatedHeroName = impersonatedHero.Name;
model.ImpersonatedSkill = acquiredSkill.GetType().Name;
}
view.UpdateImpersonateStatus(model == view.PlayerModel.Hero1Model);
});
}
示例2: NotifyImpersonation
public void NotifyImpersonation(Player p, Core.Heroes.Hero h, ISkill s)
{
Application.Current.Dispatcher.Invoke((ThreadStart)delegate()
{
var model = playersMap[p].PlayerModel;
if (h == null)
{
model.ImpersonatedHeroName = string.Empty;
model.ImpersonatedSkill = string.Empty;
}
else
{
model.ImpersonatedHeroName = h.Name;
model.ImpersonatedSkill = s.GetType().Name;
}
});
}
示例3: Translate
public static string Translate(ISkill skill)
{
if (skill == null) return string.Empty;
string key = string.Format("Skill.{0}.Name", skill.GetType().Name);
string name = Application.Current.TryFindResource(key) as string;
if (name == null) return string.Empty;
return name;
}
示例4: Translate
public static SkillItem Translate(ISkill skill)
{
SkillItem item = new SkillItem();
item.playerId = skill.Owner.Id;
item.name = skill.GetType().Name;
if (skill is IAdditionalTypedSkill)
{
item.additionalType = (skill as IAdditionalTypedSkill).AdditionalType.GetType();
}
return item;
}
示例5: SendCardUsage
public void SendCardUsage(ISkill skill, List<Card> cards, List<Player> players, ICardUsageVerifier verifier)
{
for (int i = 0; i < server.MaxClients; i++)
{
server.SendObject(i, 1);
if (skill != null)
{
server.SendObject(i, 1);
server.SendObject(i, skill);
}
else
{
server.SendObject(i, 0);
}
if (cards != null)
{
server.SendObject(i, cards.Count);
if (skill is ActiveSkill)
{
(skill as ActiveSkill).CardRevealPolicy(Game.CurrentGame.Players[i], cards, players);
}
foreach (Card c in cards)
{
if (!(skill is ActiveSkill) && !(skill != null && skill.GetType().Name.Contains("GuHuo")) && !(verifier.Helper.NoCardReveal))
{
if (c.Place.DeckType != DeckType.Equipment && c.Place.DeckType != DeckType.DelayedTools)
{
c.RevealOnce = true;
}
}
if (c.Place.DeckType == DeckType.Equipment || c.Place.DeckType == DeckType.DelayedTools)
{
c.RevealOnce = false;
}
server.SendObject(i, c);
}
}
else
{
server.SendObject(i, 0);
}
if (players != null)
{
server.SendObject(i, players.Count);
foreach (Player p in players)
{
server.SendObject(i, p);
}
}
else
{
server.SendObject(i, 0);
}
server.Flush(i);
}
}
示例6: EncodeSkill
public static SkillItem EncodeSkill(ISkill skill)
{
SkillItem item = new SkillItem();
item.playerId = skill.Owner.Id;
item.name = skill.GetType().Name;
item.skillId = Game.CurrentGame.Players[skill.Owner.Id].ActionableSkills.IndexOf(skill);
Trace.Assert(item.skillId >= 0);
if (skill is IAdditionalTypedSkill)
{
var type = (skill as IAdditionalTypedSkill).AdditionalType;
string horseName;
EncodeCardHandler(type, out item.additionalTypeName, out horseName);
}
return item;
}
示例7: Translate
public static SkillItem Translate(ISkill skill)
{
SkillItem item = new SkillItem();
item.playerId = skill.Owner.Id;
item.name = skill.GetType().Name;
item.skillId = Game.CurrentGame.Players[skill.Owner.Id].ActionableSkills.IndexOf(skill);
Trace.Assert(item.skillId >= 0);
if (skill is IAdditionalTypedSkill)
{
item.additionalType = (skill as IAdditionalTypedSkill).AdditionalType.GetType();
}
return item;
}