本文整理汇总了C#中ITarget类的典型用法代码示例。如果您正苦于以下问题:C# ITarget类的具体用法?C# ITarget怎么用?C# ITarget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITarget类属于命名空间,在下文中一共展示了ITarget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HasVisited
public bool HasVisited(ITarget target)
{
if (Visited != null && Visited.Contains(target))
return true;
else
return false;
}
示例2: UnregisterTarget
public void UnregisterTarget(ITarget target) {
GetAppropriateListForTarget(target).Remove(target);
if (attackers.Count == 0 && attackersSpawners.TrueForAll(spawner => spawner.IsSpawnEnded())) {
StopRound();
GameManager.NextRound();
}
}
示例3: GetValue
/// <summary>
/// Gets the value to inject into the specified target.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="target">The target.</param>
/// <returns>The value to inject into the specified target.</returns>
public object GetValue(IContext context, ITarget target)
{
var parameter = context
.Parameters.OfType<IConstructorArgument>()
.SingleOrDefault(p => p.AppliesToTarget(context, target));
return parameter != null ? parameter.GetValue(context, target) : target.ResolveWithin(context);
}
示例4: GetPositionOfFuncConstructorArgument
/// <summary>
/// Gets the position of the specified <see cref="FuncConstructorArgument"/> relative to the
/// other <see cref="FuncConstructorArgument"/> of the same type in the specified context.
/// </summary>
/// <param name="argument">The argument for which the position is calculated.</param>
/// <param name="context">The context of the argument.</param>
/// <param name="target">The target.</param>
/// <returns>
/// -1 if the parameter does not exist in the context or if another constructor argument applies for the target.
/// Otherwise the position of the specified <see cref="FuncConstructorArgument"/> within the other <see cref="FuncConstructorArgument"/>
/// of the same type contained in context.Parameters.
/// </returns>
public int GetPositionOfFuncConstructorArgument(FuncConstructorArgument argument, IContext context, ITarget target)
{
int currentPosition = 0;
int position = -1;
foreach (var constructorArgumentParameter in context.Parameters.OfType<IConstructorArgument>())
{
var funcArgumentParameter = constructorArgumentParameter as FuncConstructorArgument;
if (funcArgumentParameter != null)
{
if (ReferenceEquals(argument, funcArgumentParameter))
{
position = currentPosition;
}
else
{
if (funcArgumentParameter.ArgumentType == target.Type)
{
currentPosition++;
}
}
}
else
{
if (constructorArgumentParameter.AppliesToTarget(context, target))
{
return -1;
}
}
}
return position;
}
示例5: Initialize
public void Initialize(IAttackableTarget sourceParam, ITarget targetParam, SpellData data) {
source = sourceParam;
target = targetParam;
baseData = data;
InitializeData(data);
InitView();
}
示例6: DtsTask
public DtsTask(SourceType sourceType, string sourceName, TargetType targetType, ITarget target)
{
SourceType = sourceType;
SourceName = sourceName;
TargetType = targetType;
Target = target;
}
示例7: Initialize
public virtual void Initialize(BaseBattleData dataParam, bool isDefenderParam, ITarget parentParam) {
data = dataParam;
isDefender = isDefenderParam;
parent = parentParam;
InitializeData();
BattleManager.RegisterTarget(parent);
}
示例8: CreateTree
public static IList<ITarget> CreateTree(ITarget target)
{
var final = new List<ITarget>();
final.AddRange(BuildDependancyTree(target.DependsOn));
final.Add(target);
return final;
}
示例9: Debugger
/// <summary>
/// Constructs the Debugger for the specified Target.
/// </summary>
/// <param name="target">The target to be debugged.</param>
public Debugger(ITarget target)
{
if (target == null) throw new ArgumentNullException();
Target = target;
Breakpoints = new BreakpointManager(this);
DebugInformation = new DebugInformation();
}
示例10: TargetViewModel
/// <summary>
/// Constructor</summary>
/// <param name="target">The ITarget whose information will be displayed</param>
/// <param name="protocol">The target's protocol</param>
public TargetViewModel(ITarget target, IProtocol protocol)
{
Requires.NotNull(target, "target");
Requires.NotNull(protocol, "protocol");
Target = target;
m_protocol = protocol;
}
示例11: SubmitActionRound
// When the player has entered the action they are using this turn
public void SubmitActionRound(IAction action, Player player, ITarget target)
{
if (action is Card) {
CastCard(action as Card, player, target);
}
PromptNextPlayer();
}
示例12: GetValue
/// <summary>
/// Gets the value to inject into the specified target.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="target">The target.</param>
/// <returns>The value to inject into the specified target.</returns>
public object GetValue(IContext context, ITarget target)
{
Ensure.ArgumentNotNull(context, "context");
Ensure.ArgumentNotNull(target, "target");
var parameter = context.Parameters.OfType<PropertyValue>().Where(p => p.Name == target.Name).SingleOrDefault();
return parameter != null ? parameter.GetValue(context) : target.ResolveWithin(context);
}
示例13: CastCard
protected void CastCard(Card card, Player origin, ITarget target)
{
card.CastOrigin = origin;
card.CastTarget = target;
CardStack.Push (card);
if (target is Player) {
AlertPlayerForResponse(target as Player, origin, card);
}
}
示例14: Argument
/*----------------------------------------------------------------------------------------*/
#region Constructors
/// <summary>
/// Creates a new Argument.
/// </summary>
/// <param name="target">The argument's injection point.</param>
/// <param name="resolver">The argument's dependency marker.</param>
/// <param name="optional">A value indicating whether the argument is optional.</param>
public Argument(ITarget target, IResolver resolver, bool optional)
{
Ensure.ArgumentNotNull(target, "target");
Ensure.ArgumentNotNull(resolver, "dependency");
Target = target;
Resolver = resolver;
Optional = optional;
}
示例15: SimpleProvider
public SimpleProvider (ITarget[] targets) {
this.targets = new Hashtable ();
if (targets == null)
return;
foreach (ITarget t in targets)
AddTarget (t);
}