public static void ExecutionPart(Queue <Statement> queue, ScopesManager sm)
 {
     foreach (Statement stat in queue)
     {
         stat.execute(sm);
         Console.WriteLine("{ " + stat + " }");
     }
 }
        public void execute(ScopesManager sm)
        {
            IComposite variable = sm.GetMyType(varType);

            if (variable != null)
            {
                var tmp = Prototype.CloneObject(variable) as IComposite;
                tmp.Name = name;
                sm.declareVar(name, tmp);
            }
            else
            {
                throw new RuntimeException("Nie ma takiego typu");
            }
        }
        public void execute(ScopesManager sm)
        {
            IComposite variable   = sm.GetMyType(varType);
            Composite  collection = new Composite(name);

            if (variable == null)
            {
                throw new RuntimeException("Nie ma takiego typu");
            }

            for (int i = 0; i < count; ++i)
            {
                IComposite tmp2 = Prototype.CloneObject(variable) as IComposite;
                tmp2.Position += new SFML.System.Vector2f(i * 30.0f, i * 30.0f);
                collection.Add(tmp2);
            }

            sm.declareVar(name, collection);
        }
        static void Main(string[] args)
        {
            RenderWindow app = new RenderWindow(new VideoMode(ProgramGlobals.RESOLUTION_X, ProgramGlobals.RESOLUTION_Y), "SFML Works!");

            app.Closed += new EventHandler(OnClose);

            Stopwatch sw = new Stopwatch();
            float     dT;

            Color windowColor = new Color(255, 255, 255);

            Parser            parser = new Parser("./testCode.txt");
            Queue <Statement> queue  = parser.Run();

            ScopesManager sm = new ScopesManager();

            ExecutionPart(queue, sm);

            sw.Start();
            long lastCheck = 0;

            while (app.IsOpen)
            {
                app.DispatchEvents();
                dT        = sw.ElapsedMilliseconds - lastCheck;
                lastCheck = sw.ElapsedMilliseconds;

                app.Clear(windowColor);

                sm.Update(dT);
                sm.Draw(app);

                app.Display();
            }
            Console.ReadKey();
        }
        public void execute(ScopesManager sm)
        {
            sm.NewScope();
            Statement stat;

            if (relationOp.eval(expr1, expr2))
            {
                while (statements.Count > 0)
                {
                    stat = statements.Dequeue();
                    stat.execute(sm);
                }
            }
            else
            {
                while (statements.Count > 0)
                {
                    stat = statements.Dequeue();
                    stat.execute(sm);
                }
            }

            //sm.DestroyScope();
        }
 public void execute(ScopesManager sm)
 {
 }