Exemplo n.º 1
0
    public void _60_1_AutoWithLength10By5Update()
    {
        int frame    = 0;
        var context0 = PlayerContext.Copy(dummyContext);

        /*
         *
         *              ・0を一回回す
         *              ・2で、1,2の2回回す
         *              ・3で、3,4の2回回す
         *              ・4で、5,6の2回回す
         *              ・5で、7,8の2回回す
         *
         *              とやってしまうと、なるほど足りてない。0を1回、2を4回回したことになるだけ。
         *              比較して、
         *
         *              10回回す場合は、
         *              ・0を1回回す
         *              ・1を1回回す
         *              ・2を1回回す
         *              ・3を1回回す
         *              ・4を1回回す
         *              ・5を1回回す
         *              ・6を1回回す
         *              ・7を1回回す
         *              ・8を1回回す
         *              ・9を1回回す
         *
         *              なので、2倍で回したければ、こう渡すのが正しい。
         *              ・0で、0,1を2回回す <- 初期化時の最初の値は0でも、最初に回すパラメータが1。 = 倍速で回したい場合のパラメータから1引いた値を使う。引き継ぎ値の特例がある。
         *              ・2で、2,3の2回回す
         *              ・3で、4,5の2回回す
         *              ・4で、6,7の2回回す
         *              ・5で、8,9の2回回す
         */
        var auto0 = new AutoForTest60_10 <PlayerContext, Dictionary <string, PlayerContext> >(frame, context0);

        frame = auto0.NextFrame(2);// 2ずつ進めたいので、0,1の2つのframe分の処理を回す意味で、0はすでに入っているので、1を入れる。というのが帰って来れば、あとあと使えそう。

        for (var i = 0; i < 5; i++)
        {
            auto0.Update(frame, new Dictionary <string, PlayerContext>());
            frame = auto0.NextFrame(2);
        }

        if (auto0.ShouldFalldown(frame))
        {
            return;
        }

        Debug.LogError("failed.");
    }
Exemplo n.º 2
0
    public void _60_0_AutoWithLength10By10Update()
    {
        int frame    = 0;
        var context0 = PlayerContext.Copy(dummyContext);

        /*
         *              0で開始して、10で終わる予定のautoを、2 x 5で回す。
         */
        var auto0 = new AutoForTest60_10 <PlayerContext, Dictionary <string, PlayerContext> >(frame, context0);

        for (var i = 0; i < 10; i++)
        {
            auto0.Update(frame, new Dictionary <string, PlayerContext>());
            frame++;
        }

        if (auto0.ShouldFalldown(frame))
        {
            return;
        }

        Debug.LogError("failed.");
    }