本文整理汇总了C#中wServer.logic.Behavior类的典型用法代码示例。如果您正苦于以下问题:C# Behavior类的具体用法?C# Behavior怎么用?C# Behavior使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Behavior类属于wServer.logic命名空间,在下文中一共展示了Behavior类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Instance
public static DoMultiple Instance(int doTimes, int cooldown, Behavior behavior)
{
var key = new Tuple<int, int, Behavior>(doTimes, cooldown, behavior);
DoMultiple ret;
if (!instances.TryGetValue(key, out ret))
ret = instances[key] = new DoMultiple(doTimes, cooldown, behavior);
return ret;
}
示例2: Instance
public static OrderEntity Instance(float radius, short objType, Behavior behav)
{
var key = new Tuple<float, short, Behavior>(radius, objType, behav);
OrderEntity ret;
if (!instances.TryGetValue(key, out ret))
ret = instances[key] = new OrderEntity(radius, objType, behav);
return ret;
}
示例3: Instance
public static OrderGroup Instance(float radius, string group, Behavior behav)
{
var key = new Tuple<float, string, Behavior>(radius, group, behav);
OrderGroup ret;
if (!instances.TryGetValue(key, out ret))
ret = instances[key] = new OrderGroup(radius, group, behav);
return ret;
}
示例4: Behaves
//Candies
static BehaviorDef Behaves(
string name,
Behavior movement = null,
Behavior attack = null,
Behavior reproduce = null,
LootBehavior loot = null,
params ConditionalBehavior[] condBehaviors)
{
if (loot != null)
{
Array.Resize(ref condBehaviors, condBehaviors.Length + 1);
condBehaviors[condBehaviors.Length - 1] = loot;
}
return new BehaviorDef(
movement ?? NullBehavior.Instance,
attack ?? NullBehavior.Instance,
reproduce ?? NullBehavior.Instance,
condBehaviors);
}
示例5: IfNot
private IfNot(Behavior cond, Behavior result)
{
this.cond = cond;
this.result = result;
}
示例6: False
private False(Behavior x)
{
this.x = x;
}
示例7: Instance
public static If Instance(Behavior cond, Behavior result, Behavior no = null)
{
var key = new Tuple<Behavior, Behavior, Behavior>(cond, result, no);
If ret;
if (!instances.TryGetValue(key, out ret))
ret = instances[key] = new If(cond, result, no);
return ret;
}
示例8: OrderGroup
private OrderGroup(float radius, string group, Behavior behav)
{
this.radius = radius;
this.group = group;
this.behav = behav;
}
示例9: And
private And(Behavior x, Behavior y)
{
this.x = x;
this.y = y;
}
示例10: RemoveKey
public RemoveKey(Behavior behav)
{
key = behav.Key;
}
示例11: Timed
private Timed(int time, Behavior behav)
{
this.time = time;
this.behav = behav;
}
示例12: Once
private Once(Behavior x)
{
this.x = x;
}
示例13: True
private True(Behavior x)
{
this.x = x;
}
示例14: RandomDelay2
private RandomDelay2(int min, int max, Behavior behav)
{
this.min = min;
this.max = max;
this.behav = behav;
}
示例15: IfExist
private IfExist(int key, Behavior result, Behavior no)
{
this.key = key;
this.result = result;
this.no = no;
}