Exemplo n.º 1
0
        public AegisWarp MatchWarp()
        {
            var an = new AegisWarp();

            Match(TokenType.warp);

            an.MapName = MatchString();
            an.name    = MatchString();
            an.x       = MatchNumber();
            an.y       = MatchNumber();
            an.spanx   = MatchNumber();
            an.spany   = MatchNumber();

            PushNode(an);

            MatchNewline();

            while (tk.Type == TokenType.Label)
            {
                MatchNewline();
                curNode.Items.Add(MatchLabel());
                MatchNewline();
            }

            an = (AegisWarp)PopNode();
            return(an);
        }
Exemplo n.º 2
0
        private void GenWarp(AegisWarp aw)
        {
            AegisLabel ontouch = null;

            foreach (AegisLabel al in aw.Items)
            {
                if (al.Name == "OnTouch")
                {
                    ontouch = al;
                    break;
                }
            }

            if (ontouch == null)
            {
                return;
            }

            AegisFunc moveto = null;

            foreach (AegisFunc af in ontouch.Items)
            {
                if (af.Name == "moveto")
                {
                    moveto = af;
                    break;
                }
            }

            if (moveto == null)
            {
                return;
            }

            curArgs = moveto.Items;

            WriteNewLine("{0},{1},{2},{3}\twarp\t{4}\t{5},{6},{7},{8},{9}\n", aw.MapName, aw.x, aw.y, "0", aw.name,
                         aw.spanx, aw.spany, FindArg(0).Substring(1, FindArg(0).Length - 2), FindArg(1), FindArg(2));
        }