コード例 #1
0
 public void RemoveSteering(SteeringType Type)
 {
     if (Behaviours.ContainsKey(Type))
     {
         Behaviours.Remove(Type);
     }
 }
コード例 #2
0
        private void OnBehaviourRemoved(Behaviour behaviour)
        {
            Behaviours.Remove(behaviour);
            behaviour.Removed -= OnBehaviourRemoved;

            BehaviourRemoved?.Invoke(behaviour);
            AnyBehaviourRemoved?.Invoke(behaviour);
        }
コード例 #3
0
ファイル: Bot.cs プロジェクト: JeffCost/opensim
        public bool RemoveBehaviour(string abbreviatedName)
        {
            lock (Behaviours)
            {
                IBehaviour behaviour;

                if (!Behaviours.TryGetValue(abbreviatedName, out behaviour))
                {
                    return(false);
                }

                behaviour.Close();
                Behaviours.Remove(abbreviatedName);

                return(true);
            }
        }
コード例 #4
0
ファイル: Button.cs プロジェクト: BenitoJedai/avlib
        public void InitProperties()
        {
            AddValidatedProperty("Gradient", false);
            AddValidatedProperty("Flat", false);
            AddValidatedProperty("CornerRadius", 0);
            AddValidatedProperty("Text", "");
            AddValidatedProperty("TextColor", Color.Navy);
            AddValidatedProperty("MouseIsDown", false);
            AddValidatedProperty("ControlKeyPressed", false);
            Property["Switch", false]
            .Changed += () =>
            {
                if (Switch)
                {
                    Behaviours.Add(Core.Behaviours.Checked(), "checked");
                }
                else
                {
                    Behaviours.Remove("checked");
                }
                Invalidate();
            };
            Value["Down"] = new Func <object>(() => { return(MouseIsDown || Checked || Value["ControlKeyPressed"].AsBoolean()); });

            AddValidatedProperty("Font", new Font("Arial", 8));
            TextAlignment      = StringAlignment.Center;
            DrawFocus          = true;
            Value["FlatIsNow"] = new Func <object>(() => { return(Flat && !MouseIsOver && !Down); });
            Property["Checked", false].Changed += () =>
            {
                Invalidate();
                if (CheckedChanged != null)
                {
                    CheckedChanged(this, new EventArgs());
                }
            };
        }
コード例 #5
0
ファイル: BehaviourManager.cs プロジェクト: sachgits/Myre
 /// <summary>
 /// Removes a behaviour from this manager.
 /// </summary>
 /// <param name="behaviour">The behaviour this manager should stop managing.</param>
 /// <returns>
 ///     <c>true</c> if the behaviour was removed; else <c>false</c>.
 /// </returns>
 public virtual bool Remove(T behaviour)
 {
     return(Behaviours.Remove(behaviour));
 }
コード例 #6
0
 public void RemoveBehaviour(BaseBehaviour behaviour) => Behaviours.Remove(behaviour);