public static void ShowEquipStrengthText(UILabel label, int equipID, int strengthLevel) { if (label == null) { return; } DEquipStreng strengthDB = ReadCfgEquipStreng.GetDataById(equipID); label.text = string.Empty; for (int i = 0; i < strengthDB.Propertys.Count; i++) { DStrengthValue data = strengthDB.Propertys[i]; if (data.Value <= 0 || data.Property == 0) { continue; } DProperty propertyDB = ReadCfgProperty.GetDataById(data.Property); string desc = GTTools.Format(propertyDB.Desc, data.Value); string v = string.Empty; if (data.UnlockLevel <= strengthLevel) { v = GTTools.Format("[00ff00]{0}[-]", desc); } else { v = GTTools.Format("[777777]{0} (强化至{1}级生效)[-]", desc, data.UnlockLevel); } label.Append(v); } }
public static void ShowEquipAdvanceText(UILabel label, int equipID, int advanceLevel) { if (label == null) { return; } DEquipAdvance advanceDB = ReadCfgEquipAdvance.GetDataById(equipID); label.text = string.Empty; for (int i = 0; i < advanceDB.Propertys.Count; i++) { KeyValuePair <EAttr, int> data = advanceDB.Propertys[i]; if (data.Value <= 0 || data.Key == 0) { continue; } DProperty propertyDB = ReadCfgProperty.GetDataById(data.Key); string desc = GTTools.Format(propertyDB.Desc, data.Value); string v = string.Empty; if (advanceLevel >= (i + 1)) { v = GTTools.Format("[00ff00]{0}[-]", desc); } else { v = GTTools.Format("[777777]{0} (进阶至{1}级生效)[-]", desc, i + 1); } label.Append(v); } }
private void ShowPropertys() { propertyTemplate.SetActive(false); XCharacter role = GTGlobal.Main; Dictionary <EAttr, int> propertys = GTAttrHelper.GetPropertys(role); Dictionary <EAttr, int> .Enumerator em = propertys.GetEnumerator(); while (em.MoveNext()) { EAttr e = em.Current.Key; if ((int)e > 10) { continue; } ItemProperty item; if (!mPropertyItems.ContainsKey(e)) { item = new ItemProperty(); GameObject go = NGUITools.AddChild(propertyGrid.gameObject, propertyTemplate); item.propertyNum = go.transform.Find("Num").GetComponent <UILabel>(); item.propertyName = go.transform.Find("Name").GetComponent <UILabel>(); go.SetActive(true); mPropertyItems.Add(e, item); } else { item = mPropertyItems[e]; } DProperty db = ReadCfgProperty.GetDataById(em.Current.Key); item.propertyName.text = db.Name; item.propertyNum.text = db.IsPercent == false?em.Current.Value.ToString() : (em.Current.Value / 100f).ToPercent(); } }
internal override Evaluation Analyze(Analyzer /*!*/ analyzer, ExInfoFromParent info) { base.Analyze(analyzer, info); property = analyzer.ResolveProperty(type, propertyName, position, true, analyzer.CurrentType, analyzer.CurrentRoutine, out runtimeVisibilityCheck); return(new Evaluation(this)); }
public override Evaluation Analyze(DirectStFldUse node, Analyzer analyzer, ExInfoFromParent info) { base.Analyze(node, analyzer, info); property = analyzer.ResolveProperty(type, node.PropertyName, node.Span, true, analyzer.CurrentType, analyzer.CurrentRoutine, out runtimeVisibilityCheck); return(new Evaluation(node)); }
/// <summary> /// 获取在用物业公司列表 /// </summary> /// <returns></returns> public IList <Property> GetProperty() { try { DProperty dp = new DProperty(); return(dp.SELECT_BY_ISUSED(true)); } catch { return(null); } }
public static int GetFightValue(Dictionary <EAttr, int> attrValues) { int value = 0; Dictionary <EAttr, int> .Enumerator em = attrValues.GetEnumerator(); while (em.MoveNext()) { DProperty db = ReadCfgProperty.GetDataById(em.Current.Key); value += db.Factor * em.Current.Value; } em.Dispose(); return(value); }
public void Analyze(NamedActualParam /*!*/ node, Analyzer /*!*/ analyzer, DType /*!*/ propertiesDeclarer) { // TODO: Named parameters can target the non-static, public, and read-write fields // or properties of the attribute class bool visibility_check; if (!propertiesDeclarer.IsUnknown) { property = analyzer.ResolveProperty(propertiesDeclarer, node.Name, node.Span, false, null, null, out visibility_check); } node.expression = node.Expression.Analyze(analyzer, ExInfoFromParent.DefaultExInfo).Literalize(); }
public static void ShowPropertyText(UILabel label, Dictionary <EAttr, int> dict, bool showAll = true) { if (dict == null) { return; } if (label == null) { return; } Dictionary <EAttr, int> .Enumerator em = dict.GetEnumerator(); label.text = string.Empty; while (em.MoveNext()) { EAttr e = em.Current.Key; int value = em.Current.Value; if (em.Current.Value <= 0 || ReadCfgProperty.ContainsKey(e) == false) { continue; } DProperty db = ReadCfgProperty.GetDataById(e); string s = GTTools.Format(db.Desc, value); switch (e) { case EAttr.AP: case EAttr.DF: case EAttr.HP: label.Append(s); break; case EAttr.CRIT: case EAttr.CRITDAMAGE: case EAttr.DODGE: case EAttr.HIT: case EAttr.SUCK: case EAttr.MP: if (showAll) { string str = GTTools.Format("[00ff00]装备:{0}[-]", s); label.Append(str); } break; } } }
public static void ShowGemPropertyText(UILabel label, int gemID, int level, bool showNext = false) { if (label.text == null) { return; } label.text = string.Empty; DGem gemDB = ReadCfgGem.GetDataById(gemID); DGemLevel db1 = ReadCfgGemLevel.GetDataById(gemDB.Quality * 1000 + level); DGemLevel db2 = ReadCfgGemLevel.GetDataById(gemDB.Quality * 1000 + level + 1); for (int i = 0; i < gemDB.Propertys.Count; i++) { DStrengthValue gp = gemDB.Propertys[i]; if (!ReadCfgProperty.ContainsKey(gp.Property)) { continue; } DProperty propertyDB = ReadCfgProperty.GetDataById(gp.Property); int ratio = level > 0 ? db1.PropertyRatio : 100; string s = GTTools.Format(propertyDB.Desc, (int)(gp.Value * ratio / 100f)); int add = (int)(gp.Value * (db2.PropertyRatio - ratio) / 100f); string str = string.Empty; if (level >= gp.UnlockLevel) { if (showNext) { str = GTTools.Format("[00ff00]{0}(+{1})[-]", s, add); } else { str = GTTools.Format("[00ff00]{0}[-]", s); } } else { str = GTTools.Format("[777777]{0} (宝石强化至{1}级生效)[-]", s, gp.UnlockLevel); } label.Append(str); } label.text = label.text.TrimEnd('\n'); }
private void ShowPropertyView(int id, int level) { DActor db = ReadCfgActor.GetDataById(id); currPropertyText1.text = string.Empty; currPropertyText2.text = string.Empty; mainPropertyText1.text = string.Empty; mainPropertyText2.text = string.Empty; DPetLevel levelDB = ReadCfgPetLevel.GetDataById(db.Quality * 1000 + level); for (int i = 0; i < levelDB.PropertyNums.Length; i++) { EAttr propertyID = (EAttr)(i + 1); DProperty propertyDB = ReadCfgProperty.GetDataById(propertyID); currPropertyText1.Append(propertyDB.Name); currPropertyText2.Append("+" + levelDB.PropertyNums[i].ToString()); mainPropertyText1.Append(propertyDB.Name); int extendNum = (int)(levelDB.PropertyNums[i] * levelDB.Ratio / 100f); mainPropertyText2.Append("+" + extendNum.ToString()); } }
private void DefineProperty(DObject O, string name, DObject desc) { if (desc == null || O == null || name == null) { Trace.Fail("TypeError"); } var getter = new DValue(); var setter = new DValue(); var value = new DValue(); var attributes = PropertyDescriptor.Attributes.NotEnumerable | PropertyDescriptor.Attributes.NotWritable | PropertyDescriptor.Attributes.NotConfigurable; attributes = PropertyDescriptor.Attributes.NotEnumerable | PropertyDescriptor.Attributes.NotWritable | PropertyDescriptor.Attributes.NotConfigurable; getter.SetUndefined(); setter.SetUndefined(); value.SetUndefined(); value = desc.HasProperty("value") ? desc.GetField("value") : value; if (desc.HasProperty("enumerable")) { attributes &= desc.GetField("enumerable").AsBoolean() ? ~PropertyDescriptor.Attributes.NotEnumerable : attributes; } if (desc.HasProperty("configurable")) { attributes &= desc.GetField("configurable").AsBoolean() ? ~PropertyDescriptor.Attributes.NotConfigurable : attributes; } if (desc.HasProperty("writable")) { attributes &= desc.GetField("writable").AsBoolean() ? ~PropertyDescriptor.Attributes.NotWritable : attributes; } if (desc.HasProperty("get")) { getter = desc.GetField("get"); if (!ValueTypesHelper.IsUndefined(getter.ValueType) && !ValueTypesHelper.IsFunction(getter.ValueType)) { Trace.Fail("TypeError"); } } if (desc.HasProperty("set")) { setter = desc.GetField("set"); if (!ValueTypesHelper.IsUndefined(setter.ValueType) && !ValueTypesHelper.IsFunction(setter.ValueType)) { Trace.Fail("TypeError"); } } Trace.Assert( !((desc.HasProperty("get") || desc.HasProperty("set")) && (desc.HasProperty("value") || desc.HasProperty("writable"))), "If either getter or setter needs to be defined, value or writable shouldn't be defined."); if (desc.HasProperty("value")) { O.DefineOwnProperty(name, ref value, attributes | PropertyDescriptor.Attributes.Data); } else { var property = new DProperty(); if (ValueTypesHelper.IsFunction(getter.ValueType)) { property.Getter = getter.AsDFunction(); } if (ValueTypesHelper.IsFunction(setter.ValueType)) { property.Setter = setter.AsDFunction(); } O.DefineOwnProperty(name, property, attributes | PropertyDescriptor.Attributes.Accessor); } }
private void ShowPropertyView() { DRelics db = ReadCfgRelics.GetDataById(centerID); XRelics relics = DataDBSRelics.GetDataById(centerID); for (int i = 0; i < 3; i++) { RelicsProperty tab1 = mNowPropertys[i]; RelicsProperty tab2 = mNexPropertys[i]; DProperty propertyDB = ReadCfgProperty.GetDataById(db.PropertyID[i]); tab1.propertyName.text = propertyDB.Name; tab2.propertyName.text = propertyDB.Name.ToString(); float ratio1 = 1; float ratio2 = ratio1 * (20 / 100f + 1); float num1 = 0; float num2 = 0; if (relics == null) { num1 = ratio1 * db.PropertyNum[i]; num2 = ratio2 * db.PropertyNum[i]; if (propertyDB.IsPercent) { tab1.propertyNum.text = "+" + (num1 / 100f).ToPercent(); tab2.propertyNum.text = "+" + (num2 / 100f).ToPercent(); } else { tab1.propertyNum.text = "+" + ((int)num1).ToString(); tab2.propertyNum.text = "+" + ((int)num2).ToString(); } } else { ratio1 = Mathf.Pow(20 / 100f + 1, relics.Level + 1); ratio2 = ratio1 * (20 / 100f + 1); num1 = (db.PropertyNum[i] * ratio1); num2 = (db.PropertyNum[i] * ratio2); if (relics.Level == db.LevelExp.Length) { if (propertyDB.IsPercent) { tab1.propertyNum.text = "+" + (num1 / 100f).ToPercent(); tab2.propertyNum.text = string.Empty; } else { tab1.propertyNum.text = "+" + ((int)num1).ToString(); tab2.propertyNum.text = string.Empty; } nowAttr.transform.localPosition = new Vector3(100, -50, 0); nexAttr.SetActive(false); attrRow.SetActive(false); } else { if (propertyDB.IsPercent) { tab1.propertyNum.text = "+" + (num1 / 100f).ToPercent(); tab2.propertyNum.text = "+" + (num2 / 100f).ToPercent(); } else { tab1.propertyNum.text = "+" + ((int)num1).ToString(); tab2.propertyNum.text = "+" + ((int)num2).ToString(); } nexAttr.SetActive(true); attrRow.SetActive(true); nowAttr.transform.localPosition = new Vector3(-20, -60, 0); nexAttr.transform.localPosition = new Vector3(200, -60, 0); } } } }
protected override void OnPropertyChanged(DProperty dp) => PropertyChanged?.Invoke(this, dp);
public Property GetOrgan(short id) { DProperty dor = new DProperty(); return(dor.SELECT_BY_ID(id)); }
/// <summary> /// Метод считывания свойства. /// Различает конструкцию N*X /// При выполнении расширяет текущий объект Props /// </summary> /// <param name="Name">Имя свойства</param> /// <param name="fileName"></param> public bool ReadDProperty(string Name, ref StreamReader sr) { DProperty prop = new DProperty(); prop.Name = Name; prop.Value = new double[NI, NJ, NK]; prop.Mult = new float[NI, NJ, NK]; prop.Add = new float[NI, NJ, NK]; prop.Maps = new Map[4]; for (int N = 0; N < 4; N++) { prop.Maps[N] = new Map(); prop.Maps[N].Value = new double[NI, NJ]; } int buffLen = 512 * 1024; char[] buffer = new char[buffLen]; int num = 0; bool done = false; double value = double.NaN; bool point = false; bool neg = false; int x = 0; int y = 0; int z = 0; int dimmer = 0; int mult = 1; bool skipLine = false; char ch; int j; int exp = 0; bool isExp = false; do { num = sr.ReadBlock(buffer, 0, buffLen); for (j = 0; j < num; j++) { ch = buffer[j]; switch (ch) { case '-': if ((j+1 == num ? sr.Peek() : buffer[j + 1]) == '-') skipLine = true; // comments else neg = true; // negative value flag break; case '\n': case '\r': skipLine = false; break; } if (skipLine) continue; switch (ch) { case '/': done = true; break; case '*': mult = Convert.ToInt32(value); value = 0; dimmer = 0; point = false; break; case '.': point = true; break; case 'E': case 'e': isExp = true; value = value * (neg ? -1 : 1); neg = false; break; case ' ': case '\t': case '\n': case '\r': if (double.IsNaN(value)) continue; #region write value value = value * Math.Pow(10, exp - dimmer) ; for (int i = 0; i < mult; i++) { prop.Value[x, y, z] = value ; x++; if (x == NI) { x = 0; y++; if (y == NJ) { y = 0; z++; BW_Reader.ReportProgress(z * 100 / NK / 2); } } } mult = 1; exp = 0; isExp = false; value = double.NaN; point = false; dimmer = 0; neg = false; #endregion break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (isExp) { exp = exp * 10 + (ch - 48) * (neg ? -1 : 1); break; } if (double.IsNaN(value)) value = 0; value = value * 10 + ch - 48; if (point) dimmer++; break; } if (done) break; } } while (!done); //---------------------------------------------------- if (x != 0 || y != 0 || z != NK) { MessageBox.Show("Error in " + Name); return false; } sr.BaseStream.Position = GetActualPosition(sr); sr.DiscardBufferedData(); if (Props == null) Props = new List<DProperty>(); Props.Capacity = Props.Capacity + 1; Props.Add(prop); RecalculateValues(); return true; }