Beispiel #1
0
        public Cannibals getcan()
        {
            Cannibals c = st_can.Pop() as Cannibals;

            carringlist.Remove(c);
            return(c);
        }
Beispiel #2
0
        public void init(List <int[]> process)
        {
            count = 0;
            countstr.setstring("0");
            int[] startstate = process[0];
            for (int i = 0; i < startstate[0]; i++)
            {
                Missonary m = new Missonary();
                leftside.add(m);
            }
            for (int i = 0; i < startstate[1]; i++)
            {
                Cannibals c = new Cannibals();

                leftside.add(c);
            }

            leftside.addend();
            rightside.addend();


            for (int i = 0; i < process.Count - 1; i++)
            {
                Motion m = new Motion();
                m.settarget(boat);
                m.setmax(100);
                double v_x       = 230.0 / 100.0;
                int[]  state     = process[i];
                int[]  nextstate = process[i + 1];
                if (state[4] == 1)
                {
                    v_x = -v_x;
                }

                m.setmove(v_x, 0);
                m.setstart(() =>
                {
                    rideboat(state, nextstate);
                });
                m.setend(new Action(delegate()
                {
                    motionend(state);
                }));

                motionq.Enqueue(m);
            }
        }