public static void WriteByteConfig() { FileInfo file_info = new FileInfo(CnfConst.data_byte_path); if (file_info.Exists) { file_info.Delete(); } FileStream file_stream = file_info.Create(); BinaryWriter bw = new BinaryWriter(file_stream); int length = 0; List <BuffCnf> tmp_buffcnf = new List <BuffCnf>(StaticCnf.FindMap <BuffCnf>().Values); length = tmp_buffcnf.Count; bw.Write(length); for (int i = 0; i < length; i++) { BuffCnf data = tmp_buffcnf[i]; data.ToByteWrite(bw); } List <BuffEffectCnf> tmp_buffeffectcnf = new List <BuffEffectCnf>(StaticCnf.FindMap <BuffEffectCnf>().Values); length = tmp_buffeffectcnf.Count; bw.Write(length); for (int i = 0; i < length; i++) { BuffEffectCnf data = tmp_buffeffectcnf[i]; data.ToByteWrite(bw); } List <HeroInfoCnf> tmp_heroinfocnf = new List <HeroInfoCnf>(StaticCnf.FindMap <HeroInfoCnf>().Values); length = tmp_heroinfocnf.Count; bw.Write(length); for (int i = 0; i < length; i++) { HeroInfoCnf data = tmp_heroinfocnf[i]; data.ToByteWrite(bw); } List <SpellInfoCnf> tmp_spellinfocnf = new List <SpellInfoCnf>(StaticCnf.FindMap <SpellInfoCnf>().Values); length = tmp_spellinfocnf.Count; bw.Write(length); for (int i = 0; i < length; i++) { SpellInfoCnf data = tmp_spellinfocnf[i]; data.ToByteWrite(bw); } file_stream.Flush(); file_stream.Close(); bw.Close(); file_stream.Dispose(); }
public static BuffCnf FindBuffById(int buffId) { if (_buff == null) { _buff = StaticCnf.FindMap <BuffCnf>(); } if (_buff.ContainsKey(buffId)) { return(_buff[buffId]); } return(null); }
public void _init_csv_sound() { _sound_map_id = StaticCnf.FindMap <SoundCnf>(); _sound_map_name = new Dictionary <string, SoundCnf>(); foreach (var info in _sound_map_id) { if (_sound_map_name.ContainsKey(info.Value.name)) { continue; } _sound_map_name.Add(info.Value.name, info.Value); } //_sound_type.Add(1, E_GameResType.MUSIC_BGM); //_sound_type.Add(3, E_GameResType.MUSIC_SOUND); //_sound_type.Add(2, E_GameResType.MUSIC_VOICE); }