at.jku.ssw.Coco.State.DetachAction C# (CSharp) 메소드

DetachAction() 공개 메소드

public DetachAction ( Action act ) : void
act Action
리턴 void
        public void DetachAction(Action act)
        {
            Action lasta = null, a = firstAction;
            while (a != null && a != act) {lasta = a; a = a.next;}
            if (a != null)
            if (a == firstAction) firstAction = a.next; else lasta.next = a.next;
        }

Usage Example

예제 #1
0
        static void SplitActions(State state, Action a, Action b)
        {
            Action   c;
            BitArray seta, setb, setc;

            seta = a.Symbols();
            setb = b.Symbols();
            if (Sets.Equals(seta, setb))
            {
                a.AddTargets(b);
                state.DetachAction(b);
            }
            else if (Sets.Includes(seta, setb))
            {
                setc = (BitArray)seta.Clone();
                Sets.Subtract(setc, setb);
                b.AddTargets(a);
                a.ShiftWith(setc);
            }
            else if (Sets.Includes(setb, seta))
            {
                setc = (BitArray)setb.Clone();
                Sets.Subtract(setc, seta);
                a.AddTargets(b);
                b.ShiftWith(setc);
            }
            else
            {
                setc = (BitArray)seta.Clone();
                setc.And(setb);
                Sets.Subtract(seta, setc);
                Sets.Subtract(setb, setc);
                a.ShiftWith(seta);
                b.ShiftWith(setb);
                c = new Action(0, 0, Node.normalTrans); // typ and sym are set in ShiftWith
                c.AddTargets(a);
                c.AddTargets(b);
                c.ShiftWith(setc);
                state.AddAction(c);
            }
        }
All Usage Examples Of at.jku.ssw.Coco.State::DetachAction