invertika_game.Game.GameState.updateMap C# (CSharp) Method

updateMap() static private method

static private updateMap ( MapComposite map ) : void
map MapComposite
return void
        static void updateMap(MapComposite map)
        {
            // 1. update object status.
            List< Thing  > things = map.getEverything(); //TODO das könnte man auch weiter unten benutzen?

            foreach(Thing thing in things)
            {
                thing.update();
            }

            // 2. run scripts.
            Script s = map.getScript();
            if(s != null)
            {
                s.update();
            }

            // 3. perform actions.
            if(map.mContent!=null)
            {
            foreach(Thing thing in map.mContent.things)
            {
                if(thing is Being)
                {
                    Being being = (Being)thing;
                    being.perform();
                }
            }
            }

            //Alter Code
            // for (BeingIterator i(map.getWholeMapIterator()); i; ++i)
            // {
            //     (*i).perform();
            // }

            // 4. move objects around and update zones.
            foreach(Thing thing in map.mContent.things)
            {
                if(thing is Being)
                {
                    Being being = (Being)thing;
                    being.move();
                }
            }

            // Alter Code
            //for (BeingIterator i(map.getWholeMapIterator()); i; ++i)
            //{
            //    (*i).move();
            //}

            map.update();
        }