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; }
//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); }
private HpGreaterEqual(int threshold, Behavior result, Behavior no) { this.threshold = threshold; this.result = result; this.no = no; }
private False(Behavior x) { this.x = x; }
public static CooldownExact Instance(int cooldown, Behavior behav = null) { var key = new Tuple<int, Behavior>(cooldown, behav); CooldownExact ret; if (!instances.TryGetValue(key, out ret)) ret = instances[key] = new CooldownExact(cooldown, behav); return ret; }
public static And Instance(Behavior x, Behavior y) { var key = Tuple.Create(x, y); And ret; if (!instances.TryGetValue(key, out ret)) ret = instances[key] = new And(x, y); return ret; }
public static True Instance(Behavior x) { True ret; if (!instances.TryGetValue(x, out ret)) ret = instances[x] = new True(x); return ret; }
public static Timed Instance(int time, Behavior behav) { var key = new Tuple<int, Behavior>(time, behav); Timed ret; if (!instances.TryGetValue(key, out ret)) ret = instances[key] = new Timed(time, behav); return ret; }
private IfGreater(int key, int value, Behavior result, Behavior no) { this.key = key; this.value = value; this.result = result; this.no = no; }
public static IfExist Instance(int key, Behavior result, Behavior no = null) { Tuple<int, Behavior, Behavior> k = new Tuple<int, Behavior, Behavior>(key, result, no); IfExist ret; if (!instances.TryGetValue(k, out ret)) ret = instances[k] = new IfExist(key, result, no); return ret; }
private IfExist(int key, Behavior result, Behavior no) { this.key = key; this.result = result; this.no = no; }
public static If Instance(Behavior cond, Behavior result, Behavior no = null) { Tuple<Behavior, Behavior, Behavior> 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; }
private If(Behavior cond, Behavior result, Behavior no) { this.cond = cond; this.result = result; this.no = no; }
public static HpLesserPercent Instance(float threshold, Behavior result, Behavior no = null) { Tuple<float, Behavior, Behavior> k = new Tuple<float, Behavior, Behavior>(threshold, result, no); HpLesserPercent ret; if (!instances.TryGetValue(k, out ret)) ret = instances[k] = new HpLesserPercent(threshold, result, no); return ret; }
private HpLesserPercent(float threshold, Behavior result, Behavior no) { this.threshold = threshold; this.result = result; this.no = no; }
public RemoveKey(Behavior behav) { this.key = behav.Key; }
private Timed(int time, Behavior behav) { this.time = time; this.behav = behav; }
public static IfGreater Instance(int key, int value, Behavior result, Behavior no = null) { Tuple<int, int, Behavior, Behavior> k = new Tuple<int, int, Behavior, Behavior>(key, value, result, no); IfGreater ret; if (!instances.TryGetValue(k, out ret)) ret = instances[k] = new IfGreater(key, value, result, no); return ret; }
private True(Behavior x) { this.x = x; }
private IfNot(Behavior cond, Behavior result) { this.cond = cond; this.result = result; }
private And(Behavior x, Behavior y) { this.x = x; this.y = y; }
public static IfNot Instance(Behavior cond, Behavior result) { Tuple<Behavior, Behavior> key = new Tuple<Behavior, Behavior>(cond, result); IfNot ret; if (!instances.TryGetValue(key, out ret)) ret = instances[key] = new IfNot(cond, result); return ret; }
private CooldownExact(int cooldown, Behavior behav) { this.cooldown = cooldown; this.behav = behav; }
private Not(Behavior x) { this.x = x; }
private DamageLesserEqual(int threshold, Behavior result, Behavior no) { this.threshold = threshold; this.result = result; this.no = no; }
public static Not Instance(Behavior x) { Not ret; if (!instances.TryGetValue(x, out ret)) ret = instances[x] = new Not(x); return ret; }
public static False Instance(Behavior x) { False ret; if (!instances.TryGetValue(x, out ret)) ret = instances[x] = new False(x); return ret; }
private Once(Behavior x) { this.x = x; }
public static HpGreaterEqual Instance(int threshold, Behavior result, Behavior no = null) { Tuple<int, Behavior, Behavior> k = new Tuple<int, Behavior, Behavior>(threshold, result, no); HpGreaterEqual ret; if (!instances.TryGetValue(k, out ret)) ret = instances[k] = new HpGreaterEqual(threshold, result, no); return ret; }
private Or(Behavior x, Behavior y) { this.x = x; this.y = y; }