示例#1
0
        public void Init()
        {
            CharacterData = new CharacterData(GetPath(Path.Combine("Character", "CharacterConfig")));
            _log.Info("Loaded CharacterConfig...");

            ItemsData = new ItemsData(GetPath(Path.Combine("Game", "ItemList.bin")));
            _log.Info("Loaded {0} items.", ItemsData.Count);

            MnData = new MnData(GetPath(Path.Combine("Game", "MN.bin")));
            _log.Info("Loaded {0} monster names.", MnData.Count);

            NpcData = new NpcData(GetPath("Npcs", false));
            _log.Info("Loaded {0} npcs.", NpcData.Count);

            MobData = new MobData(GetPath("Mobs", false));
            _log.Info("Loaded {0} mobs.", MobData.Count);

            QuestData = new QuestData(GetPath(Path.Combine("Game", "Quest.bin")));
            _log.Info("Loaded {0} quests.", QuestData.Count);

            SkillData = new SkillDataData(GetPath(Path.Combine("Game", "SkillData.bin")));
            _log.Info("Loaded {0} skills.", SkillData.Count);

            using (var connection = DatabaseManager.Instance.GetConnection())
            {
                ConvertCoreData = new ConvertCoreData(connection);
                _log.Info("Loaded {0} core converts.", ConvertCoreData.Count);

                GearCoresData = new GearCoresData(connection);
                _log.Info("Loaded {0} core upgrades.", GearCoresData.Count);

                ExpData = new ExpData(connection);
                _log.Info("Loaded {0} levels.", ExpData.Count);

                PranExpData = new ExpData(connection, true);
                _log.Info("Loaded {0} pran levels.", PranExpData.Count);

                MakeItemsData = new MakeItemsData(connection);
                _log.Info("Loaded {0} make items.", MakeItemsData.Count);

                MapsData = new MapsData(connection);
                _log.Info("Loaded {0} maps.", MapsData.Count);

                RecipesData = new RecipesData(connection);
                _log.Info("Loaded {0} recipes.", RecipesData.Count);

                ReinforceAData = new ReinforceAData(connection);
                ReinforceWData = new ReinforceWData(connection);
                _log.Info("Loaded {0} reinforce values.", ReinforceAData.Count + ReinforceWData.Count);

                SetsData = new SetsData(connection);
                _log.Info("Loaded {0} sets.", SetsData.Count);

                TitlesData = new TitlesData(connection);
                _log.Info("Loaded {0} titles.", TitlesData.Count);
            }
        }
示例#2
0
        private void SaveData(List <MapData> maps)
        {
            MapsData mapsData = new MapsData
            {
                Maps = maps.ToArray()
            };

            string path = Path.Combine(Application.streamingAssetsPath, OutputFile);
            string json = JsonUtility.ToJson(mapsData);

            File.WriteAllText(path, json);
        }
示例#3
0
        public static void Load()
        {
            XmlSerializer deserializer = new XmlSerializer(typeof(MapsData), new XmlRootAttribute("Maps"));
            XmlTextReader textReader   = new XmlTextReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("DungeonExplorer.data.maps.xml"));

            textReader.Normalization = false;
            MapsData = (MapsData)deserializer.Deserialize(textReader);
            textReader.Close();
            foreach (Map m in MapsData.Maps)
            {
                m.Blocked = m.BlockedMaps.Split(',').Select(n => int.Parse(n)).ToArray();
                m.Initalize();
            }
        }
示例#4
0
    private void InitTheCurrentLevel()
    {
        MapsData data = new MapsData();

        if(Application.loadedLevelName == "Map 1"){
            Map map = new Map(data.GetMap1Streets(), data.GetMap1Paths(), data.GetMap1Intersections(), data.GetMap1Lights(), data.GetMap1LightsGroups());

            /*public Level(	int anId,
             				Map aMap,
                            float theNormalVehicleSpeed,
                            List<int> theVehicleGroups,
                            List<int []> theInstantiationRateAndIntervals,
                            int theMinScore,
                            float theGameTime,
                            List<VehicleType> theLevelEvents,
                            List<int> theEventsNumbers,
                            List<EventTimes> theEventTimes,
                            List<List <GamePath>>theEventsPaths)
                */

            currentLevel = new Level(	1,
                                        map,
                                        Map1_Data.NormalVehicleSpeed,
                                        Map1_Data.VehiclesGroups(),
                                        Map1_Data.InistantiationRatesIntervals(),
                                        Map1_Data.MinScore,
                                        Map1_Data.GameTime,
                                        null,
                                        null,
                                        null,
                                        null);
            vehiclesShouldGenerated = currentLevel.VehicleGroups[0];
            currentRateIndex = 0;
            gameTime = currentLevel.GameTime;
        }
        else if(Application.loadedLevelName == "Map 2"){
            Map map = new Map(data.GetMap2Streets(), data.GetMap2Paths(), data.GetMap2Intersections(), data.GetMap2Lights(), data.GetMap2LightsGroups());

            currentLevel = new Level(	2,
                                        map,
                                        Map2_Data.NormalVehicleSpeed,
                                        Map2_Data.VehiclesGroups(),
                                        Map2_Data.InistantiationRatesIntervals(),
                                        Map2_Data.MinScore,
                                        Map2_Data.GameTime,
                                        null,
                                        null,
                                        null,
                                        null);

            vehiclesShouldGenerated = currentLevel.VehicleGroups[0];
            currentRateIndex = 0;
            gameTime = currentLevel.GameTime;
        }
    }
示例#5
0
        // POST api/maps
        public MapsData GetByVersionAndLevel(string version, int level)
        {
            MapsData mapsData = null;

            return(mapsData);
        }
示例#6
0
        // GET api/maps/5
        public MapsData GetByVersion(string version)
        {
            MapsData mapsData = null;

            return(mapsData);
        }
示例#7
0
        // GET api/maps
        public MapsData GetLatestVersion()
        {
            MapsData mapsData = null;

            return(mapsData);
        }