public List <string> GetAttr(BoxingData box) { List <string> l = new List <string>(); for (int x = 0; x < box.levelData.attrArr.Length; x++) { float a = box.levelData.attrArr[x]; if (a > 0) { string s = GetAttrStr((Def.AttrId)x); s += a; l.Add(s); } a = 0; } for (int y = 0; y < box.levelData.attrArr.Length; y++) { float b = box.levelData.additionArr[y]; if (b > 0) { string ss = GetAttrStr((Def.AttrId)y + 4); ss += b; l.Add(ss); } b = 0; } return(l); }
public void InitBoxingData(C2sSprotoType.user u) { System.Collections.IDictionaryEnumerator enumerator = GameShared.Instance.boxingTable.GetEnumerator(); while (enumerator.MoveNext()) { BoxingViewData v = new BoxingViewData(); v.frag_num = 0; v.level = 0; BoxingData r = GameShared.Instance.boxingTable[enumerator.Key] as BoxingData; v.data = r; int id = (r.csv_id * 1000) + v.level; r.levelData = GameShared.Instance.GetBoxingLevelById(id); boxTable.Add(v.data.csv_id, v); } if (u.kungfu_list != null) { for (int i = 0; i < u.kungfu_list.Count; i++) { int id = (int)u.kungfu_list[i].csv_id; if (id != 0) { C2sSprotoType.kungfu_content c = u.kungfu_list[i]; if (UserManager.Instance.boxTable.Contains(id)) { BoxingViewData v = new BoxingViewData(); v.level = (int)c.k_level; v.frag_num = (int)c.k_sp_num; v.type = (int)c.k_type; v.data = GameShared.Instance.GetBoxingById((int)c.csv_id); int levelid = (1000 * v.data.csv_id) + v.level; v.data.levelData = GameShared.Instance.GetBoxingLevelById(levelid); UserManager.Instance.boxTable[v.data.csv_id] = v; } else { BoxingViewData v = new BoxingViewData(); v.level = (int)c.k_level; v.frag_num = (int)c.k_sp_num; v.type = (int)c.k_type; v.data = GameShared.Instance.GetBoxingById((int)c.csv_id); int levelid = (1000 * v.data.csv_id) + v.level; v.data.levelData = GameShared.Instance.GetBoxingLevelById(levelid); UserManager.Instance.boxTable.Add(id, v); } } } } else { Debug.Log("kungfu_listçİş"); } }
public Hashtable QueryBoxingTable() { InitDB(); SqliteDataReader sqReader = db.ReadFullTable("boxing"); Hashtable table = new Hashtable(); while (sqReader.Read()) { BoxingData item = new BoxingData(); item.csv_id = sqReader.GetInt32(sqReader.GetOrdinal("csv_id")); item.name = sqReader.GetString(sqReader.GetOrdinal("name")); item.comm = sqReader.GetInt32(sqReader.GetOrdinal("comm")); table.Add(item.csv_id, item); } return(table); }
private void InitGameData() { var gameData = ConfigurationManager.AppSettings[$"{SignKey}Data"]; var datas = gameData.Split('|'); foreach (var data in datas) { var boxingData = new BoxingData(); var data2Nums = data.Split('-'); boxingData.HitCount = data2Nums[0].ToInt32(); boxingData.Delay = data2Nums[1].ToInt32(); boxingData.Number = data2Nums[2].Split(',').Select(s => s.ToInt32()).ToList(); _boxingDatas.Add(boxingData); } _startButtonItem = ButtonItems[ButtonItems.Count - 1]; _checkButtonItems = ButtonItems.Take(8).ToList(); _isBreakThird = true; MainUI.BreakSecond += MainUI_BreakSecond; MainUI.UnbreakSecond += MainUI_UnbreakSecond; MainUI.BreakThird += MainUI_BreakThird; MainUI.UnbreakThird += MainUI_UnbreakThird; }