public SortieManager(int area_id) { this._area_id = area_id; Dictionary <int, Mst_mapinfo> mst_mapinfo = Mst_DataManager.Instance.Mst_mapinfo; Api_Result <Dictionary <int, User_MapinfoFmt> > api_Result = new Api_get_Member().Mapinfo(); Dictionary <int, User_MapinfoFmt> dictionary; if (api_Result.state == Api_Result_State.Success) { dictionary = api_Result.data; } else { dictionary = new Dictionary <int, User_MapinfoFmt>(); } this._maps = new List <MapModel>(); using (Dictionary <int, User_MapinfoFmt> .ValueCollection.Enumerator enumerator = dictionary.get_Values().GetEnumerator()) { while (enumerator.MoveNext()) { User_MapinfoFmt current = enumerator.get_Current(); Mst_mapinfo mst_mapinfo2 = mst_mapinfo.get_Item(current.Id); if (mst_mapinfo2.Maparea_id == area_id) { MapModel mapModel = new MapModel(mst_mapinfo2, current); this._maps.Add(mapModel); } } } this._maps.Sort((MapModel x, MapModel y) => (x.MstId <= y.MstId) ? -1 : 1); }
public Api_Result <Dictionary <int, User_MapinfoFmt> > Mapinfo() { Api_Result <Dictionary <int, User_MapinfoFmt> > api_Result = new Api_Result <Dictionary <int, User_MapinfoFmt> >(); api_Result.data = new Dictionary <int, User_MapinfoFmt>(); using (Dictionary <int, Mst_mapinfo> .Enumerator enumerator = Mst_DataManager.Instance.Mst_mapinfo.GetEnumerator()) { while (enumerator.MoveNext()) { KeyValuePair <int, Mst_mapinfo> current = enumerator.get_Current(); User_MapinfoFmt user_MapinfoFmt = current.get_Value().GetUser_MapinfoData(); if (user_MapinfoFmt != null) { api_Result.data.Add(user_MapinfoFmt.Id, user_MapinfoFmt); } else if (current.get_Value().IsOpenMapSys()) { user_MapinfoFmt = new User_MapinfoFmt(); user_MapinfoFmt.Id = current.get_Value().Id; api_Result.data.Add(user_MapinfoFmt.Id, user_MapinfoFmt); } } } return(api_Result); }
public MapModel(Mst_mapinfo mst_map, User_MapinfoFmt mem_map) { _mst_map_data = mst_map; _mem_map_data = mem_map; _mapHP = new MapHPModel(_mst_map_data, _mem_map_data); if (_mapHP.MaxValue == 0) { _mapHP = null; } }
public static Dictionary <int, Mst_mapinfo> GetActiveMap() { Dictionary <int, Mst_mapinfo> dictionary = new Dictionary <int, Mst_mapinfo>(); foreach (Mst_mapinfo value in Mst_DataManager.Instance.Mst_mapinfo.Values) { User_MapinfoFmt user_MapinfoData = value.GetUser_MapinfoData(); if (user_MapinfoData != null && user_MapinfoData.IsGo) { dictionary.Add(value.Id, value); } } return(dictionary); }
public static Dictionary <int, Mst_mapinfo> GetActiveMap() { Dictionary <int, Mst_mapinfo> dictionary = new Dictionary <int, Mst_mapinfo>(); using (Dictionary <int, Mst_mapinfo> .ValueCollection.Enumerator enumerator = Mst_DataManager.Instance.Mst_mapinfo.get_Values().GetEnumerator()) { while (enumerator.MoveNext()) { Mst_mapinfo current = enumerator.get_Current(); User_MapinfoFmt user_MapinfoData = current.GetUser_MapinfoData(); if (user_MapinfoData != null && user_MapinfoData.IsGo) { dictionary.Add(current.Id, current); } } } return(dictionary); }
public Api_Result <Dictionary <int, User_MapinfoFmt> > Mapinfo() { Api_Result <Dictionary <int, User_MapinfoFmt> > api_Result = new Api_Result <Dictionary <int, User_MapinfoFmt> >(); api_Result.data = new Dictionary <int, User_MapinfoFmt>(); foreach (KeyValuePair <int, Mst_mapinfo> item in Mst_DataManager.Instance.Mst_mapinfo) { User_MapinfoFmt user_MapinfoData = item.Value.GetUser_MapinfoData(); if (user_MapinfoData != null) { api_Result.data.Add(user_MapinfoData.Id, user_MapinfoData); } else if (item.Value.IsOpenMapSys()) { user_MapinfoData = new User_MapinfoFmt(); user_MapinfoData.Id = item.Value.Id; api_Result.data.Add(user_MapinfoData.Id, user_MapinfoData); } } return(api_Result); }
public MapHPModel(Mst_mapinfo mst, User_MapinfoFmt mem) { this._mapID = mst.Id; if (mem != null) { this._type = mem.Boss_type; if (this._type == User_MapinfoFmt.enumExBossType.MapHp) { this._max_value = mem.Eventmap.Event_maxhp; this._now_value = mem.Eventmap.Event_hp; } else if (this._type == User_MapinfoFmt.enumExBossType.Defeat) { this._max_value = 0; this._now_value = Math.Max(this._max_value - mem.Defeat_count, 0); } } else { this._type = User_MapinfoFmt.enumExBossType.Normal; this._max_value = (this._now_value = 0); } }
public User_MapinfoFmt GetUser_MapinfoData() { if (!this.IsOpenMapSys()) { return(null); } Dictionary <int, Mem_mapclear> user_mapclear = Comm_UserDatas.Instance.User_mapclear; Mem_mapclear mem_mapclear = null; Mem_mapclear mem_mapclear2 = null; int num = Mst_mapinfo.ConvertMapInfoId(this.Maparea_id, 1); if (user_mapclear.TryGetValue(num, ref mem_mapclear2) && mem_mapclear2.State == MapClearState.InvationClose) { return(null); } bool cleared = false; if (user_mapclear.TryGetValue(this.Id, ref mem_mapclear)) { if (mem_mapclear.State == MapClearState.InvationClose) { return(null); } cleared = (mem_mapclear.State == MapClearState.Cleard); } Mem_mapclear mem_mapclear3 = null; bool flag = false; if (this.No != 1) { int num2 = Mst_mapinfo.ConvertMapInfoId(this.Maparea_id, this.No - 1); user_mapclear.TryGetValue(num2, ref mem_mapclear3); if (mem_mapclear3 != null && mem_mapclear3.State != MapClearState.Cleard) { return(null); } if (mem_mapclear != null && mem_mapclear.State == MapClearState.InvationOpen) { flag = true; } } if (this.Required_ids.get_Count() != 0) { using (List <int> .Enumerator enumerator = this.Required_ids.GetEnumerator()) { while (enumerator.MoveNext()) { int current = enumerator.get_Current(); Mem_mapclear mem_mapclear4 = null; if (!user_mapclear.TryGetValue(current, ref mem_mapclear4)) { User_MapinfoFmt result = null; return(result); } if (!mem_mapclear4.Cleared) { User_MapinfoFmt result = null; return(result); } if (flag && mem_mapclear4.State != MapClearState.Cleard) { User_MapinfoFmt result = null; return(result); } } } } return(new User_MapinfoFmt { Id = this.Id, Cleared = cleared, IsGo = true }); }
public User_MapinfoFmt GetUser_MapinfoData() { if (!IsOpenMapSys()) { return(null); } Dictionary <int, Mem_mapclear> user_mapclear = Comm_UserDatas.Instance.User_mapclear; Mem_mapclear value = null; Mem_mapclear value2 = null; int key = ConvertMapInfoId(Maparea_id, 1); if (user_mapclear.TryGetValue(key, out value2) && value2.State == MapClearState.InvationClose) { return(null); } bool cleared = false; if (user_mapclear.TryGetValue(Id, out value)) { if (value.State == MapClearState.InvationClose) { return(null); } cleared = ((value.State == MapClearState.Cleard) ? true : false); } Mem_mapclear value3 = null; bool flag = false; if (No != 1) { int key2 = ConvertMapInfoId(Maparea_id, No - 1); user_mapclear.TryGetValue(key2, out value3); if (value3 != null && value3.State != 0) { return(null); } if (value != null && value.State == MapClearState.InvationOpen) { flag = true; } } if (Required_ids.Count != 0) { foreach (int required_id in Required_ids) { Mem_mapclear value4 = null; if (!user_mapclear.TryGetValue(required_id, out value4)) { return(null); } if (!value4.Cleared) { return(null); } if (flag && value4.State != 0) { return(null); } } } User_MapinfoFmt user_MapinfoFmt = new User_MapinfoFmt(); user_MapinfoFmt.Id = Id; user_MapinfoFmt.Cleared = cleared; user_MapinfoFmt.IsGo = true; return(user_MapinfoFmt); }