コード例 #1
0
        /// <summary>
        /// Creates a new referenced behaviour. The behaviour which will be referenced is read from the Reference attribute.
        /// </summary>
        public ReferencedBehavior() : base(null, _theBackgroundBrush, _theDraggedBackgroundBrush, string.Empty, true, Resources.ReferencedBehaviorDesc)
        {
            _genericChildrenLocal = new ConnectorMultiple(_children, string.Empty, "GenericChildren", 1, int.MaxValue);
            _genericChildren      = _genericChildrenLocal;

            // when this node is saved, the children won't as they belong to another behaviour
            _saveChildren = false;

            _referencedBehavior = null;
        }
コード例 #2
0
        /// <summary>
        /// Creates a new referenced behaviour.
        /// </summary>
        /// <param name="rootBehavior">The behaviour this node belongs not. NOT the one is references.</param>
        /// <param name="referencedBehavior">The behaviour you want to reference.</param>
        public ReferencedBehavior(BehaviorNode rootBehavior, BehaviorNode referencedBehavior) : base(null, _theBackgroundBrush, _theDraggedBackgroundBrush, ((Node)referencedBehavior).Label, true, Resources.ReferencedBehaviorDesc)
        {
            _genericChildrenLocal = new ConnectorMultiple(_children, string.Empty, "GenericChildren", 1, int.MaxValue);
            _genericChildren      = _genericChildrenLocal;

            // when this node is saved, the children won't as they belong to another behaviour
            _saveChildren = false;

            _referencedBehavior = referencedBehavior;
            _referenceFilename  = _referencedBehavior.FileManager.Filename;

            ((Node)_referencedBehavior).WasModified += new WasModifiedEventDelegate(referencedBehavior_WasModified);
        }
コード例 #3
0
        /// <summary>
        /// Creates a new instance of a referenced behaviour node for a sub-reference graph.
        /// </summary>
        /// <param name="impulse">The original non-sub-reference graph referenced behaviour node.</param>
        public ReferencedBehavior(ReferencedBehavior referencedBehavior) : base(null, _theBackgroundBrush, _theDraggedBackgroundBrush, referencedBehavior.BaseLabel, false, referencedBehavior.Description)
        {
            _genericChildrenLocal = new ConnectorMultiple(_children, string.Empty, "GenericChildren", 1, int.MaxValue);
            _genericChildren      = _genericChildrenLocal;

            // when this node is saved, the children won't as they belong to another behaviour
            _saveChildren = false;

            _referencedBehavior = null;

            referencedBehavior.CloneProperties(this);

            OnPropertyValueChanged(false);

            CopyEventHandlers(referencedBehavior);

#if DEBUG
            _debugIsSubreferencedGraphNode = true;
#endif
        }
コード例 #4
0
ファイル: Or.cs プロジェクト: nusus/behaviac
 public Or()
     : base(Resources.Or, Resources.OrDesc)
 {
     _conditions = new ConnectorCondition(_children, "Condition {0}", "Conditions", 2, int.MaxValue);
 }
コード例 #5
0
ファイル: CompoundAction.cs プロジェクト: 675492062/behaviac
        public CompoundAction()
            : base(Resources.CompoundAction, Resources.CompoundActionDesc)
		{
            _preconditions = new ConnectorCondition(_children, "Precondition {0}", "Preconditions", 1, int.MaxValue);
			_methods= new ConnectorMultiple(_children, "Action {0}", "Actions", 1, int.MaxValue);
		}
コード例 #6
0
 public Or() : base(Resources.Or, Resources.OrDesc)
 {
     _conditions = new ConnectorCondition(_children, "Condition {0}", "Conditions", 2, int.MaxValue);
 }
コード例 #7
0
 public Method(string label) : base(label, false)
 {
     _preconditions   = new ConnectorPrecondition(_children, "Precondition {0}", "Preconditions", 1, int.MaxValue);
     _genericChildren = new ConnectorTask(_children, "Task {0}", "Tasks", 1, int.MaxValue);
 }
コード例 #8
0
 public CompoundTask() : base("Compound Task", "Calls fitting methods.")
 {
     _preconditions      = new ConnectorPrecondition(_children, "Precondition {0}", "Preconditions", 1, int.MaxValue);
     _methods            = new ConnectorMultiple(_children, "Method {0}", "Methods", 1, int.MaxValue);
     _methods.IsReadOnly = true;
 }
コード例 #9
0
ファイル: Selector.cs プロジェクト: KeyleXiao/behaviac
 public Selector(string label, string description)
     : base(label, description)
 {
     _acceptsEvents = true;
     _genericChildren = new ConnectorMultiple(_children, "", "GenericChildren", 2, int.MaxValue);
 }
コード例 #10
0
		/// <summary>
		/// Creates a new referenced behaviour.
		/// </summary>
		/// <param name="rootBehavior">The behaviour this node belongs not. NOT the one is references.</param>
		/// <param name="referencedBehavior">The behaviour you want to reference.</param>
		public ReferencedBehavior(BehaviorNode rootBehavior, BehaviorNode referencedBehavior) : base(null, _theBackgroundBrush, _theDraggedBackgroundBrush, ((Node)referencedBehavior).Label, true, Resources.ReferencedBehaviorDesc)
		{
			_genericChildrenLocal= new ConnectorMultiple(_children, string.Empty, "GenericChildren", 1, int.MaxValue);
			_genericChildren= _genericChildrenLocal;

			// when this node is saved, the children won't as they belong to another behaviour
			_saveChildren= false;

			_referencedBehavior= referencedBehavior;
			_referenceFilename= _referencedBehavior.FileManager.Filename;

			((Node)_referencedBehavior).WasModified+= new WasModifiedEventDelegate(referencedBehavior_WasModified);
		}
コード例 #11
0
ファイル: Sequence.cs プロジェクト: KeyleXiao/behaviac
 public Sequence(string label, string description)
     : base(label, description)
 {
     _genericChildren = new ConnectorMultiple(_children, "", "GenericChildren", 2, int.MaxValue);
 }
コード例 #12
0
ファイル: Any.cs プロジェクト: sailor008/Brainiac-Designer
 public Any() : base(Resources.OperatorAny, Resources.OperatorAnyDesc)
 {
     _tasks = new ConnectorTask(_children, "Task {0}", "Tasks", 2, int.MaxValue);
 }
コード例 #13
0
ファイル: Selector.cs プロジェクト: raptoravis/behaviac1
 public Selector(string label, string description)
     : base(label, description)
 {
     _acceptsEvents   = true;
     _genericChildren = new ConnectorMultiple(_children, "", "GenericChildren", 2, int.MaxValue);
 }
コード例 #14
0
 public Selector(string label, string description) : base(null, _theBackgroundBrush, _theDraggedBackgroundBrush, label, true, description)
 {
     _genericChildren = new ConnectorMultiple(_children, "{0}", "GenericChildren", 2, int.MaxValue);            //modified for text adventure
 }
コード例 #15
0
		/// <summary>
		/// Creates a new referenced behaviour. The behaviour which will be referenced is read from the Reference attribute.
		/// </summary>
		public ReferencedBehavior() : base(null, _theBackgroundBrush, _theDraggedBackgroundBrush, string.Empty, true, Resources.ReferencedBehaviorDesc)
		{
			_genericChildrenLocal= new ConnectorMultiple(_children, string.Empty, "GenericChildren", 1, int.MaxValue);
			_genericChildren= _genericChildrenLocal;

			// when this node is saved, the children won't as they belong to another behaviour
			_saveChildren= false;

			_referencedBehavior= null;
		}
コード例 #16
0
		/// <summary>
		/// Creates a new instance of a referenced behaviour node for a sub-reference graph.
		/// </summary>
		/// <param name="impulse">The original non-sub-reference graph referenced behaviour node.</param>
		public ReferencedBehavior(ReferencedBehavior referencedBehavior) : base(null, _theBackgroundBrush, _theDraggedBackgroundBrush, referencedBehavior.BaseLabel, false, referencedBehavior.Description)
		{
			_genericChildrenLocal= new ConnectorMultiple(_children, string.Empty, "GenericChildren", 1, int.MaxValue);
			_genericChildren= _genericChildrenLocal;

			// when this node is saved, the children won't as they belong to another behaviour
			_saveChildren= false;

			_referencedBehavior= null;

			referencedBehavior.CloneProperties(this);

			OnPropertyValueChanged(false);

			CopyEventHandlers(referencedBehavior);

#if DEBUG
			_debugIsSubreferencedGraphNode= true;
#endif
		}
コード例 #17
0
ファイル: Parallel.cs プロジェクト: yh821/Zombie
 public Parallel(string label, string description) : base(label, description)
 {
     _genericChildren = new ConnectorMultiple(_children, "And", "GenericChildren", 2, int.MaxValue);
 }
コード例 #18
0
 public Parallel(string label, string description) : base(null, _theBackgroundBrush, _theDraggedBackgroundBrush, label, true, description)
 {
     _genericChildren = new ConnectorMultiple(_children, "And", "GenericChildren", 2, int.MaxValue);
 }
コード例 #19
0
 public Selector(string label, string description) : base(label, description)
 {
     _genericChildren = new ConnectorMultiple(_children, "Try {0}", "GenericChildren", 2, int.MaxValue);
 }
コード例 #20
0
 public Sequence(string label, string description)
     : base(label, description)
 {
     CreateInterruptChild();
     _genericChildren = new ConnectorMultiple(_children, "", Connector.kGeneric, 2, int.MaxValue);
 }
コード例 #21
0
ファイル: Sequence.cs プロジェクト: XyzalZhang/behaviac
 public Sequence(string label, string description)
     : base(label, description) {
     CreateInterruptChild();
     _genericChildren = new ConnectorMultiple(_children, "", Connector.kGeneric, 2, int.MaxValue);
 }
コード例 #22
0
 public Or() : base(Resources.OperatorOr, Resources.OperatorOrDesc)
 {
     _preconditions = new ConnectorPrecondition(_children, "Precondition {0}", "Preconditions", 2, int.MaxValue);
 }
コード例 #23
0
ファイル: Selector.cs プロジェクト: yecaokinux/behaviac
 public Selector(string label, string description)
     : base(label, description)
 {
     _interruptChild = new ConnectorSingle(_children, "", Connector.kInterupt);
     _genericChildren = new ConnectorMultiple(_children, "", Connector.kGeneric, 2, int.MaxValue);
 }
コード例 #24
0
 public CompoundAction()
     : base(Resources.CompoundAction, Resources.CompoundActionDesc)
 {
     _preconditions = new ConnectorCondition(_children, "Precondition {0}", "Preconditions", 1, int.MaxValue);
     _methods       = new ConnectorMultiple(_children, "Action {0}", "Actions", 1, int.MaxValue);
 }
コード例 #25
0
ファイル: Selector.cs プロジェクト: drzo/opensim4opencog
		public Selector(string label, string description) : base(null, _theBackgroundBrush, _theDraggedBackgroundBrush, label, true, description)
		{
			_genericChildren= new ConnectorMultiple(_children, "Try {0}", "GenericChildren", 2, int.MaxValue);
		}
コード例 #26
0
ファイル: Selector.cs プロジェクト: qipa/behaviac-1
 public Selector(string label, string description)
     : base(label, description)
 {
     _interruptChild  = new ConnectorSingle(_children, "", Connector.kInterupt);
     _genericChildren = new ConnectorMultiple(_children, "", Connector.kGeneric, 2, int.MaxValue);
 }
コード例 #27
0
ファイル: If.cs プロジェクト: sailor008/Brainiac-Designer
 public If() : base(Resources.OperatorIf, Resources.OperatorIfDesc)
 {
     _preconditions = new ConnectorPrecondition(_children, "Precondition {0}", "Preconditions", 1, int.MaxValue);
     _tasks         = new ConnectorTask(_children, "Task {0}", "Tasks", 1, int.MaxValue);
 }