Пример #1
0
        public LevelRulesEditor(String filePath)
        {
            InitializeComponent();
            DoubleBuffered = true;

            String rootDir = Path.GetDirectoryName(filePath);

            byte[] fileBytes = File.ReadAllBytes(filePath);
            _levelRules.ParseFileBytes(fileBytes);

            foreach (LevelRulesFile.LevelRule levelRule in _levelRules.LevelRules)
            {
                if (levelRule.StaticRooms != null)
                {
                    _LoadRooms(levelRule.StaticRooms, rootDir);
                }
                else
                {
                    foreach (LevelRulesFile.Room[] levelRules in levelRule.Rules)
                    {
                        _LoadRooms(levelRules, rootDir);
                    }
                }
            }
        }
Пример #2
0
        public LevelRulesEditor(FileManager fileManager, PackFileEntry fileEntry)
        {
            InitializeComponent();
            DoubleBuffered = true;

            _fileManager = fileManager;
            byte[] fileBytes = fileManager.GetFileBytes(fileEntry);
            _levelRules = new LevelRulesFile(fileEntry.Path, null);
            _levelRules.ParseFileBytes(fileBytes);

            foreach (LevelRulesFile.LevelRule levelRule in _levelRules.LevelRules)
            {
                if (levelRule.StaticRooms != null)
                {
                    _LoadRooms(levelRule.StaticRooms, fileEntry.Path);
                }
                else
                {
                    foreach (LevelRulesFile.Room[] levelRules in levelRule.Rules)
                    {
                        _LoadRooms(levelRules, fileEntry.Path);
                    }
                }
            }
        }