Beispiel #1
0
        public Map(Map map)
        {
            Width = map.Width;
            Height = map.Height;
            UpdateManager = new UpdateManager();
            Init(false);

            // Incomplete: doesn't attempt to copy the map contents, should only used in CopyAndFlip...
        }
Beispiel #2
0
        public Map(int width, int height)
        {
            //Trace.Assert(Width % 2 == 1, "Map width must be an odd number.");
            //Trace.Assert(Height % 2 == 1, "Map height must be an odd number.");

            Width = width;
            Height = height;
            UpdateManager = new UpdateManager();

            Init(true);
        }
Beispiel #3
0
        public Map(int width, int height, List<List<Entity>> rows)
        {
            Width = width;
            Height = height;
            Rows = rows;

            var entities = new List<Entity>();
            for (var y = 0; y < Height; y++)
            {
                for (var x = 0; x < Width; x++)
                {
                    var entity = GetEntity(x, y);

                    if (entity == null) continue;

                    entities.Add(entity);
                }
            }

            UpdateManager = new UpdateManager(entities);
        }