本文整理汇总了C#中TargetType类的典型用法代码示例。如果您正苦于以下问题:C# TargetType类的具体用法?C# TargetType怎么用?C# TargetType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TargetType类属于命名空间,在下文中一共展示了TargetType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NativeFieldInfo
public NativeFieldInfo(TargetType type, string name, int index,
bool has_const_value, int const_value)
: base(type, name, index, false, TargetMemberAccessibility.Public,
0, 0, has_const_value)
{
this.const_value = const_value;
}
示例2: TargetAuraMinTimeLeftCondition
public TargetAuraMinTimeLeftCondition(TargetType target, int auraId, TimeSpan minTimeLeft)
{
Target = target;
AuraId = auraId;
CreatorGuid = StyxWoW.Me.Guid;
MinTimeLeft = minTimeLeft;
}
示例3: WithDest
public Network WithDest(string dest)
{
_destType = GetTargetType(dest);
_dest = dest;
return this;
}
示例4: DtsTask
public DtsTask(SourceType sourceType, string sourceName, TargetType targetType, ITarget target)
{
SourceType = sourceType;
SourceName = sourceName;
TargetType = targetType;
Target = target;
}
示例5: clear
private void clear()
{
targetType = TargetType.Type_Null;
targetArrived = null;
goTarget = null;
}
示例6: CMakeTarget
public CMakeTarget(TargetType type, bool isImported)
{
Type = type;
IMPORTED = isImported;
sources = new HashSet<FileInfo>();
properties = new CMakeTargetPropertyCollection();
}
示例7: TargetAuraMaxTimeLeftCondition
public TargetAuraMaxTimeLeftCondition(TargetType target, int auraId, WoWGuid creatorGuid, TimeSpan maxTimeLeft)
{
Target = target;
AuraId = auraId;
CreatorGuid = creatorGuid;
MaxTimeLeft = maxTimeLeft;
}
示例8: Item
public Item(string name, string desc, ItemType type, TargetType targetType)
{
_name = name;
_desc = desc;
_type = type;
_targetType = targetType;
}
示例9: Initialize
public void Initialize (Transform targ, TargetType targType, float maxTTL, float expRadius, float dmg ) {
target = targ;
targetType = targType;
maxTimeToLive = maxTTL;
explosionRadius = expRadius;
damage = dmg;
}
示例10: TargetInfo
public TargetInfo(string name, string target, TargetType type, bool safe)
{
this.name = name;
this.target = target;
this.type = type;
this.safe = safe;
}
示例11: GetBestTarget
public static Obj_AI_Hero GetBestTarget(TargetType type, float range)
{
var List = HeroManager.Enemies.Where(x => !x.IsDead && x.Distance(Player.Position) <= range);
if (type == TargetType.LowestHealth)
{
return List.OrderBy(x => x.Health).FirstOrDefault();
}
if (type == TargetType.MaxHealth)
{
return List.OrderBy(x => x.MaxHealth).FirstOrDefault();
}
if (type == TargetType.BestDamage)
{
return List.OrderBy(x => x.TotalMagicalDamage + x.TotalAttackDamage ).LastOrDefault();
}
if (type == TargetType.Closest)
{
return List.OrderBy(x => x.Distance(Player.Position)).FirstOrDefault();
}
if (type == TargetType.Tankiest)
{
return List.OrderBy(x => x.Armor + x.FlatMagicReduction).FirstOrDefault();
}
if (type == TargetType.MostHealth)
{
return List.OrderBy(x => x.Health).LastOrDefault();
}
else return TargetSelector.GetTarget(range, TargetSelector.DamageType.Physical);
}
示例12: MonoVariable
public MonoVariable(string name, TargetType type, bool is_local, bool is_byref,
Method method, VariableInfo info, int start_scope_offset,
int end_scope_offset)
: this(name, type, is_local, is_byref, method, info)
{
if (is_local) {
start_scope = method.StartAddress + start_scope_offset;
end_scope = method.StartAddress + end_scope_offset;
} else if (method.HasMethodBounds) {
start_scope = method.MethodStartAddress;
end_scope = method.MethodEndAddress;
} else {
start_scope = method.StartAddress;
end_scope = method.EndAddress;
}
if (has_liveness_info) {
if (start_liveness < start_scope)
start_liveness = start_scope;
if (end_liveness > end_scope)
end_liveness = end_scope;
} else {
start_liveness = start_scope;
end_liveness = end_scope;
has_liveness_info = true;
}
}
示例13: IsValidTarget
public static bool IsValidTarget(TargetType targetType, GameObject target, GameObject me)
{
Team targetTeam = target.GetComponent<Team>();
Team myTeam = me.GetComponent<Team>();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
switch (targetType) {
case TargetType.Self:
if(target == me) {
return true;
}
break;
case TargetType.Ally:
if(myTeam.m_teamNumber == targetTeam.m_teamNumber) {
return true;
}
break;
case TargetType.Enemy:
if(myTeam.m_teamNumber != targetTeam.m_teamNumber) {
return true;
}
break;
case TargetType.All:
return true;
default:
return false;
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
return false;
}
示例14: CategoriesToTreeNodes
/// <summary>
/// 将分类类别转换为TreeNodes
/// </summary>
/// <param name="categoryService">扩展类:CategoryService</param>
/// <param name="categories">要转换成节点分类集合</param>
/// <param name="targetType">点击分类时打开新页还是在本页打开</param>
/// <param name="idPrefix">节点ID前缀</param>
/// <param name="checkedCategoryId">当前选中的CategoryId</param>
/// <param name="openLevel">默认打开的层级</param>
/// <returns>TreeNodes列表</returns>
public static IList<TreeNode> CategoriesToTreeNodes(this CategoryService<Category> categoryService, IList<Category> categories, TargetType targetType, string idPrefix, long? checkedCategoryId, int? openLevel)
{
//本方法将分类转换成TreeNodes,其中,哪些节点展开还是闭合的逻辑较为复杂,如下:
//关于哪些节点展开哪些节点闭合,逻辑实现如下:
//1 首先,若checkedCategoryId有值,则这个分类的所有父级分类展开,其他分类全部折叠;
//2 其次,若checkedCategoryId无值,openLevel有着,则深度小于等于openLevel的分类展开,其他分类折叠;
//3 若若checkedCategoryId和openLevel都没有值,则所有分类折叠。
IList<TreeNode> nodes = new List<TreeNode>();
if (categories != null && categories.Count > 0)
{
//若当前有选中的分类,则获取其所有的父级分类Id集合
List<long> checkedCategoryIds = new List<long>();
if (checkedCategoryId.HasValue && checkedCategoryId.Value > 0)
GetParentCategoryIDs(categoryService, checkedCategoryId.Value, checkedCategoryIds);
//通过Category组装TreeNode
foreach (Category category in categories)
{
TreeNode node = new TreeNode();
node.Id = idPrefix + category.CategoryId.ToString();
node.IsChecked = (checkedCategoryId == category.CategoryId);
node.IsOpened = IsOpenedNode(category, checkedCategoryIds, openLevel);
node.IsParent = category.ChildCount > 0;
node.Name = category.CategoryName;
node.ParentId = idPrefix + category.ParentId.ToString();
node.Target = targetType;
node.Url = string.Empty;
nodes.Add(node);
}
}
return nodes;
}
示例15: TargetHasAuraMinStacksCondition
public TargetHasAuraMinStacksCondition(TargetType target, int auraId, int minStackCount)
{
Target = target;
AuraId = auraId;
MinStackCount = minStackCount;
CreatorGuid = StyxWoW.Me.Guid;
}