public void AddOpenGather(COM_Gather gather) { for (int i = 0; i < OpenGatherItemList.Count; i++) { if (OpenGatherItemList[i].gatherId_ == gather.gatherId_) { OpenGatherItemList[i] = gather; GatherData gd = GatherData.GetGather((int)gather.gatherId_); if (gd != null && gd._Level >= 40) { PopText.Instance.Show(LanguageManager.instance.GetValue("useopenGatherbook").Replace("{n}", gd._Title)); } return; } } if (!OpenGatherItemList.Contains(gather)) { OpenGatherItemList.Add(gather); GatherData gd = GatherData.GetGather((int)gather.gatherId_); if (gd != null && gd._Level >= 40) { PopText.Instance.Show(LanguageManager.instance.GetValue("useopenGatherbook").Replace("{n}", gd._Title)); } } if (UpdateGatheEvent != null) { UpdateGatheEvent(gather); } }
/// <summary> /// ²É¼¯°´Å¥°´Ï /// </summary> public void OnOneBtn(ButtonScript obj, object args, int param1, int param2) { GatherData gd = GatherData.GetGather(_GatherId); COM_Gather gatherD = GatherSystem.instance.GetOpenGather(_GatherId); int maxNum = 0; GlobalValue.Get(Constant.C_GatherNumMax, out maxNum); if (gatherD != null) { if (gatherD.num_ >= maxNum) { PopText.Instance.Show(LanguageManager.instance.GetValue("EN_GatherTimesLess")); return; } } //if(BagSystem.instance.BagIsFull()) //{ // PopText.Instance.Show(LanguageManager.instance.GetValue("bagfull")); // return; //} if (_GatherId == 0) { PopText.Instance.Show(LanguageManager.instance.GetValue("qingxuanzhecaiji")); return; } //GatherData gd = GatherData.GetGather(_GatherId); GatherSystem.instance.Gather(_GatherId, 1); }
//public static Dictionary<int, GatherData> metaData; public static void ParseData(string content, string fileName) { //metaData = new Dictionary<int, GatherData> (); CSVParser parser = new CSVParser(); if (!parser.Parse(content)) { ClientLog.Instance.LogError("GatherData" + ConfigLoader.Instance.csvext + "解析错误"); return; } for (int i = 0, l = parser.GetRecordCounter(); i < l; ++i) { GatherData data = new GatherData(); data._Id = parser.GetInt(i, "Id"); data._Level = parser.GetInt(i, "Level"); data._Position = parser.GetInt(i, "Position"); data._Type = (int)Enum.Parse(typeof(MineType), parser.GetString(i, "Type")); string[] strshow = parser.GetString(i, "Show").Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); data._Show0 = int.Parse(strshow[0]); data._Show1 = int.Parse(strshow[1]); data._Money = parser.GetInt(i, "money"); data._Title = parser.GetString(i, "Title"); data._Icon = parser.GetString(i, "Icon"); data._AddMoney = parser.GetInt(i, "addvalue"); _Meta[data._Type].Add(data); } parser.Dispose(); parser = null; }
} // FinishWizard private AMainStrategyStepBase GatherData() { return(FindOrCreateStep(() => { var gatherData = new GatherData(this.context.Description, this.context.CustomerID); gatherData.CollectOutputValue += CollectStepOutputValue; return gatherData; })); } // GatherData
/// <summary> /// ·¥Ä¾ /// </summary> public void SelectFamu() { if (_mineType == MineType.MT_MuCai) { return; } //FlashGatherTimes(MineType.MT_MuCai); UpdateKindCurrent(GatherData.GetGatherList(MineType.MT_MuCai)); }
/// <summary> /// Ö¯²¼ /// </summary> public void SelectZhibu() { if (_mineType == MineType.MT_BuLiao) { return; } //FlashGatherTimes(MineType.MT_BuLiao); UpdateKindCurrent(GatherData.GetGatherList(MineType.MT_BuLiao)); }
/// <summary> /// ²É¼¯ /// </summary> public void SelectCaiKuang() { if (_mineType == MineType.MT_JinShu) { return; } //FlashGatherTimes(MineType.MT_JinShu); UpdateKindCurrent(GatherData.GetGatherList(MineType.MT_JinShu)); }
private void OnGetWay(ButtonScript obj, object args, int param1, int param2) { GatherData gData = GatherData.gatherItemId(item.id_); if (gData == null) { return; } // SkillViewUI.SwithShowMe (1,(int)gData._Type,item.id_); SkillViewUI.ShowMe(1, (int)gData._Type, item.id_); this.gameObject.SetActive(false); }
void UIDrawNotifier(BasePlayer player, GatherData data, bool destroy = true) { if (destroy && data.amount != data.TotalAmount) { core.DestroyUI(player, "GatherAdvanced", "notifier"); notifierLasthit[player] = Time + 2; } if (!itemsLoaclization.ContainsKey(data.shortname)) { Puts("Invalid item: " + data.shortname); } core.DrawUI(player, "GatherAdvanced", "notifier", data.amount, itemsLoaclization[data.shortname], data.TotalAmount, data.Time); }
public Form_FindData(GatherData pGatherData, StationCode pStationCode, GatherError pGatherError) { InitializeComponent(); mGatherData = pGatherData; mStationCode = pStationCode; mGatherError = pGatherError; mGetParaValue = new GetParaValue(pStationCode.Dictionary, pGatherData.Dictionary, pGatherError.Dictionary); this.labelTime.Text = DateTime.Now.ToString(); InitData(); Count++; }
private void OnTenBtn(ButtonScript obj, object args, int param1, int param2) { if (_GatherId == 0) { PopText.Instance.Show(LanguageManager.instance.GetValue("qingxuanzhecaiji")); return; } GatherData gd = GatherData.GetGather(_GatherId); COM_Gather gatherD = GatherSystem.instance.GetOpenGather(_GatherId); int maxNum = 0; GlobalValue.Get(Constant.C_GatherNumMax, out maxNum); if (gatherD != null) { if (maxNum - gatherD.num_ < 10) { PopText.Instance.Show(LanguageManager.instance.GetValue("gathertennoNum")); return; } if (gatherD.num_ >= maxNum) { PopText.Instance.Show(LanguageManager.instance.GetValue("EN_GatherTimesLess")); return; } } int tenMoney = 0; if (gatherD == null) { for (int i = 1; i <= 10; i++) { tenMoney += (0 + i - 1) / 5 * gd._AddMoney + gd._Money; } } else { for (int i = 1; i <= 10; i++) { tenMoney += ((int)gatherD.num_ + i - 1) / 5 * gd._AddMoney + gd._Money; } } if (tenMoney > GamePlayer.Instance.GetIprop(PropertyType.PT_Money)) { PopText.Instance.Show(LanguageManager.instance.GetValue("nomoney"), PopText.WarningType.WT_Tip); return; } MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("chouxiaohanjq").Replace("{n}", tenMoney.ToString()), () => { GatherSystem.instance.Gather(_GatherId, 10); }); }
// Start is called before the first frame update void Start() { //var dataAsString = GatherData.GetDataAsStringFromJsonFile(GatherData.GetFilePath()); //ItemInfos = GatherData.GetDeserializedData(dataAsString); ItemInfos = GatherData.GetDeserializedData(GatherData.GetTextAsset().text); NameOfItem.text = "this is the name of an item"; BackgroundInfo.text = "this is background info"; Address.text = "this is the address"; City.text = "this is the city"; State.text = "this is the state"; ZIP.text = "this is the zip"; Title.text = "This is what you are looking at!"; InfoCanvas.SetActive(false); Instructions.SetActive(true); }
public bool Gather(int id, int num) { GatherData gd = GatherData.GetGather(id); if (null == id) { return(true);//没有找到相对应ID } //if (_MingTimes[gd._Type] <= 0) // return false; //这个类型采集次数不够 if (gd._Level > GamePlayer.Instance.GetIprop(PropertyType.PT_Level)) { return(true); //等级不够 } NetConnection.Instance.mining(id, num); //--_MingTimes[gd._Type]; return(true); }
private void OnDispenserGather(ResourceDispenser dispenser, BaseEntity entity, Item item) { if (!entity.ToPlayer()) { return; } var player = entity.ToPlayer(); var gatherType = dispenser.gatherType.ToString("G"); if (gatherType == "Ore") { GatherData data; if (!gathers.TryGetValue(player, out data)) { gathers.Add(player, data = new GatherData()); } var lastAmount = data.TotalAmount; float del = 1; if (PermissionService.HasPermission(player, "gatherplus.vip")) { del = 1.66f; } else if (PermissionService.HasPermission(player, "gatherplus.premium")) { del = 1.33f; } var am = (int)(item.amount / del); data.TotalAmount += am; int bonusKey; if (GetBonus(lastAmount, data.TotalAmount, out bonusKey)) { GiveBonus(player, bonusKey); } data.amount = am; data.shortname = item.info.shortname; data.Time = START_TIME; UIDrawNotifier(player, data); } }
public string FindGatherData(List <GatherData> pGatherDatas) { try { command = new SqlCommand(); command.Connection = con; //command.CommandType = CommandType.Text; command.CommandText = "SELECT * FROM [dbo].[gather_currentdata]"; var abc = command.ExecuteNonQuery(); if (abc != -1) { return(""); } SqlDataReader dataReader = command.ExecuteReader(); string str = ""; pGatherDatas.Clear(); while (dataReader.Read()) { var gatherData = new GatherData(); foreach (var name in GatherData.ParaNames) { string temp = dataReader[name].ToString(); gatherData.Dictionary[name] = temp; str += temp + " "; } pGatherDatas.Add(gatherData); str += "\r\n"; } dataReader.Close(); return(str); } catch { throw; return("Error"); } }
void _SelectKind(GameObject obj, int id) { for (int i = 0; i < _KindItemSize; ++i) { if (_KindItems[i].gameObject == obj) { _KindItems[i]._Selected.Show(); } else { _KindItems[i]._Selected.Hide(); } } _GatherId = id; GatherData gd = GatherData.GetGather(_GatherId); COM_Gather gatherD = GatherSystem.instance.GetOpenGather(_GatherId); int maxNum = 0; GlobalValue.Get(Constant.C_GatherNumMax, out maxNum); if (gatherD == null) { if (gd._Level <= GamePlayer.Instance.GetIprop(PropertyType.PT_Level)) { gatherNunLab.gameObject.SetActive(true); gatherNunLab.text = LanguageManager.instance.GetValue("gatherCanNum").Replace("{n}", (maxNum - GatherSystem.instance.maxNum).ToString() + "/" + maxNum); } else { gatherNunLab.gameObject.SetActive(false); } } else { gatherNunLab.gameObject.SetActive(true); gatherNunLab.text = LanguageManager.instance.GetValue("gatherCanNum").Replace("{n}", (maxNum - GatherSystem.instance.maxNum).ToString() + "/" + maxNum); } if (gatherD == null) { oneNeedMoneyLab.text = (((int)(0 + 1 - 1)) / 5 * gd._AddMoney + gd._Money).ToString(); int tenMoney = 0; for (int i = 1; i <= 10; i++) { tenMoney += (0 + i - 1) / 5 * gd._AddMoney + gd._Money; } tenNeedMoneyLab.text = tenMoney.ToString(); } else { oneNeedMoneyLab.text = (((int)gatherD.num_ + 1 - 1) / 5 * gd._AddMoney + gd._Money).ToString(); int tenMoney1 = 0; for (int i = 1; i <= 10; i++) { tenMoney1 += ((int)gatherD.num_ + i - 1) / 5 * gd._AddMoney + gd._Money; } //for (size_t i = 0; i < times; ++i) //{ // needmoney += (pnewdate->num_+i -1)/5*pG->addmoney_+pG->money_; //} tenNeedMoneyLab.text = tenMoney1.ToString(); } // }
void UpdateItemList(List <COM_DropItem> items) { _ItemList.transform.DetachChildren(); foreach (GatherItemCell gkc in _Items) { gkc.gameObject.SetActive(false); //GameObject.Destroy(gkc.gameObject); } //_KindItems.Clear(); _ItemSize = 0; foreach (var g in items) { GatherItemCell gkc = null; if (_ItemSize >= _Items.Count) { gkc = GameObject.Instantiate(_ItemCellTmplate) as GatherItemCell; gkc.transform.localScale = Vector3.one; _Items.Add(gkc); } else { gkc = _Items[_ItemSize]; } gkc.Data = g; _ItemList.AddChild(gkc.transform); gkc.gameObject.SetActive(true); gkc.transform.localScale = Vector3.one; ++_ItemSize; } _ItemList.Reposition(); GatherData gd = GatherData.GetGather(_GatherId); COM_Gather gatherD = GatherSystem.instance.GetOpenGather(_GatherId); int maxNum = 0; GlobalValue.Get(Constant.C_GatherNumMax, out maxNum); if (gatherD == null) { gatherNunLab.gameObject.SetActive(true); gatherNunLab.text = LanguageManager.instance.GetValue("gatherCanNum").Replace("{n}", (maxNum - GatherSystem.instance.maxNum).ToString() + "/" + maxNum); } else { gatherNunLab.text = LanguageManager.instance.GetValue("gatherCanNum").Replace("{n}", (maxNum - GatherSystem.instance.maxNum).ToString() + "/" + maxNum); } if (gatherD == null) { oneNeedMoneyLab.text = (((int)(0 + 1 - 1)) / 5 * gd._AddMoney + gd._Money).ToString(); int tenMoney = 0; for (int i = 1; i <= 10; i++) { tenMoney += ((int)(0 + i - 1)) / 5 * gd._AddMoney + gd._Money; } tenNeedMoneyLab.text = tenMoney.ToString(); } else { oneNeedMoneyLab.text = (((int)gatherD.num_ + 1 - 1) / 5 * gd._AddMoney + gd._Money).ToString(); int tenMoney1 = 0; for (int i = 1; i <= 10; i++) { tenMoney1 += ((int)gatherD.num_ + i - 1) / 5 * gd._AddMoney + gd._Money; } tenNeedMoneyLab.text = tenMoney1.ToString(); } //FlashGatherTimes (_mineType); }
public void GenerateErrorReport() { GatherData.MoreInfo(_browser); }
public int GetGatherMoneyByType(MineType mt) { List <GatherData> tmp = GatherData.GetGatherList(mt); return(tmp[0]._Money); }