예제 #1
0
        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);
        }
예제 #2
0
 public void AppendBehavior(IBehavior behavior)
 {
     _behaviors.Add(behavior);
     behavior.Init(this);
 }