コード例 #1
0
        public static List <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > > MakeRandomBodies(int bodyCount)
        {
            List <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > > randomBodies = new nil <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > >();

            for (int i = 0; i < bodyCount; i++)
            {
                var currentBodies = new __opColonColon <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > >();
                currentBodies.__arg0 = MakeRandomBody();
                currentBodies.__arg1 = randomBodies;
                randomBodies         = currentBodies;
            }
            return(randomBodies);
        }
コード例 #2
0
        public void Run()
        {
            int __ruleIndex = 0;

            __res          = new __MetaCnvResult <List <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > > >();
            __res.Value    = default(List <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > >);
            __res.HasValue = false;

            switch (__ruleIndex)
            {
            case 0:
            {
                float dt = default(float);
                if (!(__arg0 is nil <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > >))
                {
                    goto case 1;
                }
                List <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > > __tmp0 = (nil <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > >)__arg0;
                nil <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > >  __tmp1 = new nil <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > >();
                dt             = __arg1;
                __res.HasValue = true;
                __res.Value    = __tmp1;
                break;
            }

            case 1:
            {
                Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > >         x  = default(Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > >);
                List <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > > xs = default(List <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > >);
                float dt = default(float);
                Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > >         x1  = default(Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > >);
                List <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > > xs1 = default(List <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > >);
                if (!(__arg0 is __opColonColon <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > >))
                {
                    goto default;
                }
                __opColonColon <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > > __tmp0 = (__opColonColon <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > >)__arg0;
                x  = __tmp0.__arg0;
                xs = __tmp0.__arg1;
                dt = __arg1;
                ElementUpdater2.update __tmp1 = new ElementUpdater2.update();
                __tmp1.__arg0 = x;
                __tmp1.__arg1 = dt;
                __tmp1.Run();
                if (!(__tmp1.__res.HasValue))
                {
                    goto default;
                }
                __MetaCnvResult <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > > __tmp2 = __tmp1.__res;
                x1 = __tmp2.Value;
                update __tmp3 = new update();
                __tmp3.__arg0 = xs;
                __tmp3.__arg1 = dt;
                __tmp3.Run();
                if (!(__tmp3.__res.HasValue))
                {
                    goto default;
                }
                __MetaCnvResult <List <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > > > __tmp4 = __tmp3.__res;
                xs1 = __tmp4.Value;
                __opColonColon <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > > __tmp5 = new __opColonColon <Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Tuple <Tuple <float, float>, Unit> > > >();
                __tmp5.__arg0  = x1;
                __tmp5.__arg1  = xs1;
                __res.HasValue = true;
                __res.Value    = __tmp5;
                break;
            }

            default:
                break;
            }
        }