Exemplo n.º 1
0
        public Map(string mapID, float pixelsPerMeter, Actor[] gameObjects)
        {
            GameObjects = gameObjects.ToList<Actor>();
            DynamicObjects = new List<Actor>();
            LinkedObjects = new Dictionary<string, Actor>();
            PixelsPerMeter = pixelsPerMeter;
            ID = mapID;

            foreach (Actor actor in GameObjects)
            {
                if (actor is Actors.IDynamic)
                    DynamicObjects.Add(actor);
                if (actor is Actors.ILinked)
                    LinkedObjects.Add(
                        ((Actors.ILinked)actor).ID,
                        actor);
            }
        }
Exemplo n.º 2
0
 public Map(string mapID, Actor[] gameObjects)
 {
     GameObjects = gameObjects.ToList<Actor>();
     DynamicObjects = new List<Actor>();
     LinkedObjects = new Dictionary<string, Actor>();
     PixelsPerMeter = (float)Utilities.DefaultSettings.Settings["PixelsPerMeter"];
     ID = mapID;
     foreach (Actor actor in GameObjects)
     {
         if (actor is Actors.IDynamic)
             DynamicObjects.Add(actor);
         if (actor is Actors.ILinked)
             LinkedObjects.Add(
                 ((Actors.ILinked)actor).ID,
                 actor);
     }
 }