public void AddBehavior(IBehavior b, string behaviorName) { if (b is IVelocityModifier) { Par.VelocityModifiers.Add((IVelocityModifier)b); Par.UpdateXYVelocity(); } b.SetUnit(this, behaviorName); b.Init(); if (actions.ContainsKey(b.Name)) { actions[b.Name] = b; } else { actions.Add(b.Name, b); } act.Add(b); }
public void AppendBehavior(IBehavior behavior) { _behaviors.Add(behavior); behavior.Init(this); }