Пример #1
0
        public Screen(string filepath, Map parent)
        {
            this.Map = parent;
            Tileset = parent.Tileset;

            Name = System.IO.Path.GetFileNameWithoutExtension(filepath);

            string[] lines = File.ReadAllLines(filepath);
            string[] firstline = lines[0].Split(' ');
            int width = int.Parse(firstline[0]);
            int height = int.Parse(firstline[1]);
            tiles = new int[height][];
            for (int y = 0; y < height; y++)
            {
                tiles[y] = new int[width];
                string[] line = lines[y + 1].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                for (int x = 0; x < width; x++)
                {
                    int id = int.Parse(line[x]);
                    tiles[y][x] = id;
                }
            }

            EnemyInfo = new List<EntityPlacement>();
            BlockPatternInfo = new List<BlockPatternInfo>();
            Teleports = new List<TeleportInfo>();
        }
Пример #2
0
        public Screen(int width, int height, Map parent)
        {
            this.Map = parent;

            EnemyInfo = new List<EntityPlacement>();
            BlockPatternInfo = new List<BlockPatternInfo>();
            Teleports = new List<TeleportInfo>();
            Tileset = parent.Tileset;

            Resize(width, height);
        }
Пример #3
0
        public StageDocument(ProjectEditor project, string basepath, string filepath)
        {
            Project = project;
            map = new Map(FilePath.FromAbsolute(filepath, basepath));

            // wrap all map screens in screendocuments
            // this should be the only time MegaMan.Screen's are touched directly
            foreach (var pair in map.Screens)
            {
                WrapScreen(pair.Value);
            }
        }
Пример #4
0
 public StageDocument(ProjectEditor project)
 {
     Project = project;
     map = new Map();
 }