コード例 #1
0
 public StatePropertyCommand(StateNode sn,
                             string property, P newValue, bool extendable)
     : base(sn.mState, property, newValue, extendable)
 {
     this.mSN    = sn;
     this.mLabel = "Set State Node ";
 }
コード例 #2
0
 public DGMulticastNode(MulticastDecisionGraphNode mcdgn,
                        StateNode state)
     : base(mcdgn, state)
 {
     this.mMcDgn        = mcdgn;
     this.mTargetAnchor = new AnchorPoint(this, 1, 0);
 }
コード例 #3
0
 public DGAnimNode(AnimationNode an, StateNode state, bool play)
     : base(an, state)
 {
     this.mAnimNode = an;
     this.mActor    = new RefToActor(state.Scene,
                                     an == null ? null : an.Actor);
     this.bPlay = play;
 }
コード例 #4
0
        public DGAcOpNode(ActorOperationNode aon, StateNode state)
            : base(aon, state)
        {
            this.mAcOpNode = aon ?? throw new ArgumentNullException("aon");
            this.mActor    = new RefToActor(this.mScene, aon.Actor);

            this.UpdateVisualization();
        }
コード例 #5
0
 public DGNode(DecisionGraphNode dgn, StateNode state)
     : base(state.Scene)
 {
     this.bInEditMode  = false;
     this.bVisible     = true;
     this.mDGN         = dgn;
     this.mState       = state;
     this.mScene       = state.Scene;
     this.mEntryAnchor = new AnchorPoint(this, -1, 0);
 }
コード例 #6
0
        public DGAcOpNode(ActorOperationNode aon, StateNode state)
            : base(aon, state)
        {
            if (aon == null)
            {
                throw new ArgumentNullException("aon");
            }
            this.mAcOpNode = aon;

            this.UpdateVisualization();
        }
コード例 #7
0
 public DGSnSnNode(NextStateNode nsn, StateNode state)
     : base(nsn, state)
 {
     if (nsn == null)
     {
         throw new ArgumentNullException("nsn");
     }
     this.mNextStateNode = nsn;
     this.mNextState     = new RefToState(this.mScene, nsn.NextState);
     this.UpdateVisualization();
 }
コード例 #8
0
        public DGStopNode(StopAnimationNode san, StateNode state)
            : base(san, state, false)
        {
            if (san == null)
            {
                throw new ArgumentNullException("san");
            }
            this.mStopNode = san;

            this.UpdateVisualization();
        }
コード例 #9
0
 public DGPropNode(CreatePropNode cpn, StateNode state)
     : base(cpn, state)
 {
     if (cpn == null)
     {
         throw new ArgumentNullException("cpn");
     }
     this.mPropNode  = cpn;
     this.mPropActor = new RefToActor(this.mScene, cpn.PropActor);
     this.mPropParam = new RefToParam(this.mScene, cpn.PropParam);
     this.UpdateVisualization();
 }
コード例 #10
0
        public DGPlayNode(PlayAnimationNode pan, StateNode state)
            : base(pan, state, true)
        {
            if (pan == null)
            {
                throw new ArgumentNullException("pan");
            }
            this.mPlayNode = pan;

            this.mSlotSetup = new SlotBuilder(this.mScene, pan.SlotSetup);

            this.UpdateVisualization();
        }
コード例 #11
0
        public DGRootNode(DecisionGraph dg, StateNode state)
            : base(null, state)
        {
            if (dg == null)
            {
                throw new ArgumentNullException("dg");
            }
            this.mDecisionGraph = dg;

            this.mEntryAnchor.SetPosition(sRad, 0);
            this.mEntryAnchor.SetDirection(1, 0);

            this.UpdateVisualization();
        }
コード例 #12
0
        public DGSoDnNode(SelectOnDestinationNode sodn, StateNode state)
            : base(sodn, state)
        {
            if (sodn == null)
            {
                throw new ArgumentNullException("sodn");
            }
            this.mSoDn = sodn;

            this.mCaseAnchors = new AnchorPoint[0];
            this.mCaseStrings = new string[0];
            this.mCaseCount   = 0;
            this.mMGH         = 7;

            this.UpdateVisualization();
        }
コード例 #13
0
        public DGRandNode(RandomNode rand, StateNode state)
            : base(rand, state)
        {
            if (rand == null)
            {
                throw new ArgumentNullException("rand");
            }
            this.mRandomNode = rand;
            this.mSlices     = new SliceList(this);

            this.mSliceAnchors = new AnchorPoint[0];
            this.mSliceStrings = new string[0];
            this.mSliceCount   = 0;
            this.mMGH          = 7;

            this.UpdateVisualization();
        }
コード例 #14
0
                public override void Undo()
                {
                    int                      i, j;
                    DGEdge                   edge;
                    List <DGEdge>            edges;
                    Digraph <DGNode, DGEdge> dg
                        = this.mNode.mState.DecisionGraph;

                    this.mSliceList.AddRange(this.mSlices);
                    Array.Copy(this.mAPs, 0, this.mNode.mSliceAnchors, 0,
                               this.mAPs.Length);
                    this.mNode.mSliceCount = this.mAPs.Length;
                    for (i = this.mAPs.Length - 1; i >= 0; i--)
                    {
                        this.mAPs[i].SetParent(this.mNode);
                    }
                    this.mNode.UpdateVisualization();

                    foreach (IEdgeAction action in this.mActions)
                    {
                        action.Undo();
                    }
                    for (i = this.mAPs.Length - 1; i >= 0; i--)
                    {
                        edges = this.mAPs[i].Edges;
                        for (j = edges.Count - 1; j >= 0; j--)
                        {
                            edge = edges[j];
                            edge.SetParent(this.mNode.mState);
                            dg.AddEdge(edge);
                        }
                    }
                    this.mNode.mState.RemoveRootDGEdges();

                    StateNode fState = this.mNode.mScene.FocusedState;

                    if (fState != null && fState.Equals(this.mNode.mState))
                    {
                        for (i = this.mSelectedEdges.Count - 1; i >= 0; i--)
                        {
                            edge = this.mSelectedEdges[i];
                            this.mNode.mScene.SelectDGEdge(edge, false);
                        }
                    }
                }
コード例 #15
0
                public override bool Execute()
                {
                    int                      i, j;
                    DGEdge                   edge;
                    List <DGEdge>            edges;
                    Digraph <DGNode, DGEdge> dg
                        = this.mNode.mState.DecisionGraph;
                    StateNode fState = this.mNode.mScene.FocusedState;

                    if (fState != null && fState.Equals(this.mNode.mState))
                    {
                        for (i = this.mSelectedEdges.Count - 1; i >= 0; i--)
                        {
                            edge = this.mSelectedEdges[i];
                            this.mNode.mScene.SelectDGEdge(edge, false);
                        }
                    }

                    for (i = this.mAPs.Length - 1; i >= 0; i--)
                    {
                        edges = this.mAPs[i].Edges;
                        for (j = edges.Count - 1; j >= 0; j--)
                        {
                            edge = edges[j];
                            dg.RemoveEdge(edge.SrcNode, edge.DstNode);
                            edge.SetParent(null);
                        }
                    }
                    foreach (IEdgeAction action in this.mActions)
                    {
                        action.Redo();
                    }
                    this.mNode.mState.AddRootDGEdges();

                    this.mSliceList.Clear();
                    Array.Clear(this.mNode.mSliceAnchors, 0,
                                this.mNode.mSliceCount);
                    this.mNode.mSliceCount = 0;
                    for (i = this.mAPs.Length - 1; i >= 0; i--)
                    {
                        this.mAPs[i].SetParent(null);
                    }
                    this.mNode.UpdateVisualization();
                    return(true);
                }
コード例 #16
0
        public DGSoPnNode(SelectOnParameterNode sopn, StateNode state)
            : base(sopn, state)
        {
            if (sopn == null)
            {
                throw new ArgumentNullException("sopn");
            }
            this.mSoPn  = sopn;
            this.mParam = new RefToParam(this.mScene, sopn.Parameter);

            this.mCaseAnchors = new AnchorPoint[0];
            this.mCaseStrings = new string[0];
            this.mCaseCount   = 0;
            this.mHeadMGH     = 7;
            this.mBodyMGH     = 7;

            this.UpdateVisualization();
        }
コード例 #17
0
                public override void Undo()
                {
                    int    i;
                    DGEdge edge;
                    Digraph <DGNode, DGEdge> dg
                        = this.mNode.mState.DecisionGraph;

                    this.mSliceList.Insert(this.mIndex, this.mSlice);
                    Array.Copy(
                        this.mNode.mSliceAnchors, this.mIndex,
                        this.mNode.mSliceAnchors, this.mIndex + 1,
                        this.mNode.mSliceCount - this.mIndex);
                    this.mNode.mSliceAnchors[this.mIndex] = this.mAP;
                    this.mNode.mSliceCount++;
                    this.mAP.SetParent(this.mNode);
                    this.mNode.UpdateVisualization();

                    for (i = 0; i < this.mCount; i++)
                    {
                        this.mActions[i].Undo();
                    }
                    for (i = this.mAP.Edges.Count - 1; i >= 0; i--)
                    {
                        edge = this.mAP.Edges[i];
                        edge.SetParent(this.mNode.mState);
                        dg.AddEdge(edge);
                    }
                    this.mNode.mState.RemoveRootDGEdges();

                    StateNode fState = this.mNode.mScene.FocusedState;

                    if (fState != null && fState.Equals(this.mNode.mState))
                    {
                        for (i = this.mSelectedEdges.Count - 1; i >= 0; i--)
                        {
                            edge = this.mSelectedEdges[i];
                            this.mNode.mScene.SelectDGEdge(edge, false);
                        }
                    }
                }
コード例 #18
0
                public override bool Execute()
                {
                    int       i;
                    DGEdge    edge;
                    StateNode fState = this.mNode.mScene.FocusedState;

                    if (fState != null && fState.Equals(this.mNode.mState))
                    {
                        for (i = this.mSelectedEdges.Count - 1; i >= 0; i--)
                        {
                            edge = this.mSelectedEdges[i];
                            this.mNode.mScene.SelectDGEdge(edge, false);
                        }
                    }
                    Digraph <DGNode, DGEdge> dg
                        = this.mNode.mState.DecisionGraph;

                    for (i = this.mAP.Edges.Count - 1; i >= 0; i--)
                    {
                        edge = this.mAP.Edges[i];
                        dg.RemoveEdge(edge.SrcNode, edge.DstNode);
                        edge.SetParent(null);
                    }
                    for (i = 0; i < this.mCount; i++)
                    {
                        this.mActions[i].Redo();
                    }
                    this.mNode.mState.AddRootDGEdges();

                    this.mSliceList.RemoveAt(this.mIndex);
                    this.mNode.mSliceCount--;
                    Array.Copy(
                        this.mNode.mSliceAnchors, this.mIndex + 1,
                        this.mNode.mSliceAnchors, this.mIndex,
                        this.mNode.mSliceCount - this.mIndex);
                    this.mAP.SetParent(null);
                    this.mNode.UpdateVisualization();
                    return(true);
                }
コード例 #19
0
 public NameCommand(StateNode sn,
                    string newValue, bool extendable)
     : base(sn, "Name", newValue, extendable)
 {
     this.mLabel = this.mLabel + "Name";
 }
コード例 #20
0
 public FlagsCommand(StateNode sn,
                     JazzState.Flags newValue, bool extendable)
     : base(sn, "Flags", newValue, extendable)
 {
     this.mLabel = this.mLabel + "Flags";
 }
コード例 #21
0
 public DGNCluster(StateNode owner)
 {
     this.mOwner = owner;
 }
コード例 #22
0
 public AwarenessCommand(StateNode sn,
                         JazzChunk.AwarenessLevel newValue, bool extendable)
     : base(sn, "AwarenessOverlayLevel", newValue, extendable)
 {
     this.mLabel = this.mLabel + "Awareness Overlay Level";
 }