public void Add(PropertyOperation data) { foreach (KeyValuePair <int, float> v in data.values) { this.AddPro(v.Key, v.Value); } }
public IHttpActionResult Delete(Int32 id) { PropertyOperation propertyOperation = new PropertyOperation(); var data = propertyOperation.DeleteProperty(id); return(Ok(data)); }
//基础属性 public static void BuildBaseProperty(PlayerData mainData, PropertyOperation operation) { operation.Clear(); PlayerTableItem player_res = DataManager.PlayerTable[mainData.resId] as PlayerTableItem; if (player_res == null) { return; } LevelTableItem levelRes = DataManager.LevelTable[mainData.level] as LevelTableItem; if (levelRes == null) { return; } operation.AddPro((int)PropertyTypeEnum.PropertyTypeHP, levelRes.maxhp); operation.AddPro((int)PropertyTypeEnum.PropertyTypeMaxHP, levelRes.maxhp); operation.AddPro((int)PropertyTypeEnum.PropertyTypeMana, levelRes.energy); operation.AddPro((int)PropertyTypeEnum.PropertyTypeMaxMana, levelRes.energy); operation.AddPro((int)PropertyTypeEnum.PropertyTypeDamage, levelRes.damage); operation.AddPro((int)PropertyTypeEnum.PropertyTypeCrticalLV, levelRes.crticalLV); operation.AddPro((int)PropertyTypeEnum.PropertyTypeDefance, levelRes.damageReduce); operation.AddPro((int)PropertyTypeEnum.PropertyTypeSpeed, player_res.speed); }
public void ApplyProperty(PropertyOperation data) { LevelTableItem levelRes = DataManager.LevelTable[mLevel] as LevelTableItem; if (levelRes == null) { GameDebug.LogError("level.txt 配置错误"); return; } mHpRegRate = levelRes.hpRegRate; mManaRegRate = levelRes.manaRegRate; foreach (KeyValuePair <int, float> v in data.values) { SetBaseProperty(v.Key, v.Value); } SetBaseProperty((int)PropertyTypeEnum.PropertyTypeHP, this.GetMaxHP()); // SetBaseProperty((int)PropertyTypeEnum.PropertyTypeMaxHP, levelRes.maxhp); // SetBaseProperty((int)PropertyTypeEnum.PropertyTypeMana, levelRes.energy); // SetBaseProperty((int)PropertyTypeEnum.PropertyTypeMaxMana, levelRes.energy); // SetBaseProperty((int)PropertyTypeEnum.PropertyTypeDamage, levelRes.damage); // SetBaseProperty((int)PropertyTypeEnum.PropertyTypeCrticalLV, levelRes.crticalLV); // SetBaseProperty((int)PropertyTypeEnum.PropertyTypeDefance, levelRes.damageReduce); // SetBaseProperty((int)PropertyTypeEnum.PropertyTypeSpeed, mRes.speed); }
private void txtOperation_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox comboBox = (ComboBox)sender; PropertyOperation propertyOperation = (PropertyOperation)comboBox.SelectedItem; LoadStates(propertyOperation.Id); }
override public bool BuildProperty(PropertyOperation operation) { DefenceTableItem itemdefence = GetDeRes(); operation.AddPro((int)PropertyTypeEnum.PropertyTypeMaxHP, prolifestren == -1 ? 0 : prolifestren + itemdefence.basePropertyLife); operation.AddPro((int)PropertyTypeEnum.PropertyTypeMaxHP, prolifestars == -1 ? 0 : prolifestars); operation.AddPro((int)PropertyTypeEnum.PropertyTypeDamage, prodamagestren == -1 ? 0 : prodamagestren + itemdefence.basePropertyDamage); operation.AddPro((int)PropertyTypeEnum.PropertyTypeDamage, prodamagestars == -1 ? 0 : prodamagestars); operation.AddPro((int)PropertyTypeEnum.PropertyTypeCrticalLV, procritstren == -1 ? 0 : procritstren + itemdefence.basePropertyCrit); operation.AddPro((int)PropertyTypeEnum.PropertyTypeCrticalLV, procritstars == -1 ? 0 : procritstars); operation.AddPro((int)PropertyTypeEnum.PropertyTypeDefance, prodefencestren == -1 ? 0 : prodefencestren + itemdefence.basePropertyDefence); operation.AddPro((int)PropertyTypeEnum.PropertyTypeDefance, prodefencestars == -1 ? 0 : prodefencestars); for (int i = 0; i < stoneinfo.Count; ++i) { StoneTableItem item = DataManager.StoneTable[stoneinfo[i].stoneid] as StoneTableItem; if (null == item) { continue; } operation.AddPro(item.proid, item.provalue); } return(false); }
private void UpdatePlayerData() { if (!DataManager.LevelTable.ContainsKey(mOtherData.level)) { return; } LevelTableItem levelRes = DataManager.LevelTable[mOtherData.level] as LevelTableItem; if (levelRes == null) { return; } PropertyOperation op = new PropertyOperation(); PropertyOperation pro = new PropertyOperation(); PropertyBuild.BuildBaseProperty(mOtherData, pro); op.Add(pro); PropertyBuild.BuildEquipProperty(mOtherData, pro); op.Add(pro); PropertyBuild.BuildWeaponProperty(mOtherData, pro); op.Add(pro); PropertyBuild.BuildWingProperty(mOtherData, pro); op.Add(pro); int hp = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeMaxHP); mHp.text = hp.ToString(); int mp = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeMaxMana); mMp.text = mp.ToString(); int damage = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeDamage); mDamage.text = damage.ToString(); int defence = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeDefance); mDefence.text = defence.ToString(); int crit = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeCrticalLV); mCritLv.text = crit.ToString(); uint grade = 0; for (int i = 0; i < mOtherData.mGrades.Grades.Length; ++i) { grade += mOtherData.mGrades[i]; } mZhanli1.text = grade.ToString(); mZhanli2.text = "战斗力:" + grade.ToString(); mExp.text = mOtherData.exp.ToString() + "/" + levelRes.exp.ToString(); mName.text = mOtherData.name; mRoleName.text = "Lv " + mOtherData.level.ToString() + "." + mOtherData.name; }
public string Visit(PropertyOperation operation) { Contract.RequiresNotNull(operation, "operation != null"); var column = _tableMap.Find(operation.Property); Contract.AssumeNotNull(column, "column != null"); return(_dialect.ColumnAlias(column)); }
override public bool BuildProperty(PropertyOperation operation) { PromoteTableItem item = GetPromoteRes(); if (null != item) { operation.AddPro((int)PropertyTypeEnum.PropertyTypeDamage, item.value); } return(true); }
//装备属性 public static void BuildEquipProperty(PlayerData mainData, PropertyOperation operation) { operation.Clear(); Dictionary <int, ItemObj> dic = mainData.mPack.getPackDic(PackageType.Pack_Equip); foreach (KeyValuePair <int, ItemObj> v in dic) { v.Value.BuildProperty(operation); } }
public IHttpActionResult GetPropertyById(Int32 id) { PropertyOperation propertyOperation = new PropertyOperation(); var data = propertyOperation.GetPropertyById(id); if (data == null) { return(Content(HttpStatusCode.NotFound, "Property not found")); } return(Ok(data)); }
private PropertyOperation GetPropertyOperation() { var measures = GetMeasures(); var updated = Cluster.Create(txtPropertyValue.Text, measures); var cluster = Cluster == null ? Operation <Cluster> .NewAdd(updated) : Operation <Cluster> .NewUpdate(Cluster, updated); var clusters = new List <Operation <Cluster> > { cluster }; return(PropertyOperation.Create(txtPropertyName.Text, txtPropertyDescription.Text, chkDeprecated.IsChecked.GetValueOrDefault(), Epoch.UtcNow, clusters)); }
//翅膀属性 public static void BuildWingProperty(PlayerData mainData, PropertyOperation operation) { operation.Clear(); for (int i = 0; i < mainData.mWingData.wingItems.Count; ++i) { operation.AddPro((int)PropertyTypeEnum.PropertyTypeMaxHP, mainData.mWingData.wingItems[i].life); operation.AddPro((int)PropertyTypeEnum.PropertyTypeDamage, mainData.mWingData.wingItems[i].attack); operation.AddPro((int)PropertyTypeEnum.PropertyTypeDefance, mainData.mWingData.wingItems[i].defence); operation.AddPro((int)PropertyTypeEnum.PropertyTypeCrticalLV, mainData.mWingData.wingItems[i].critical); operation.AddPro((int)PropertyTypeEnum.PropertyTypeMaxMana, mainData.mWingData.wingItems[i].power); } }
public void GetProperty(int resid, int starslv, ref float hp, ref float damage, ref float crits, ref float defence, ref float energy) { PlayerDataModule pmodule = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (null == pmodule) { return; } PlayerPropertyModule module = ModuleManager.Instance.FindModule <PlayerPropertyModule>(); if (null == module) { return; } PropertyOperation pro = module.GetPlayerProperty(); if (null == pro) { return; } CropsLevelTableItem itemlv = DataManager.CropsLevelTable[pmodule.GetLevel()] as CropsLevelTableItem; if (null == itemlv) { return; } CropsProRatioTableItem itempro = DataManager.CropsProRatioTable[resid] as CropsProRatioTableItem; if (null == itempro) { return; } //int starslv = pmodule.GetCropsStarsLv(resid) == -1 ? 1 : pmodule.GetCropsStarsLv(resid); //hp hp = (int)(pro.GetPro((int)PropertyTypeEnum.PropertyTypeMaxHP) * itempro.GetRatioPlayerByProId((int)PropertyTypeEnum.PropertyTypeMaxHP, starslv) + itemlv.life * itempro.GetRatioCropsByProId((int)PropertyTypeEnum.PropertyTypeMaxHP, starslv)); //damage damage = (int)(pro.GetPro((int)PropertyTypeEnum.PropertyTypeDamage) * itempro.GetRatioPlayerByProId((int)PropertyTypeEnum.PropertyTypeDamage, starslv) + itemlv.damage * itempro.GetRatioCropsByProId((int)PropertyTypeEnum.PropertyTypeDamage, starslv)); //crits crits = (int)(pro.GetPro((int)PropertyTypeEnum.PropertyTypeCrticalLV) * itempro.GetRatioPlayerByProId((int)PropertyTypeEnum.PropertyTypeCrticalLV, starslv) + itemlv.crits * itempro.GetRatioCropsByProId((int)PropertyTypeEnum.PropertyTypeCrticalLV, starslv)); //defence defence = (int)(pro.GetPro((int)PropertyTypeEnum.PropertyTypeDefance) * itempro.GetRatioPlayerByProId((int)PropertyTypeEnum.PropertyTypeDefance, starslv) + itemlv.defence * itempro.GetRatioCropsByProId((int)PropertyTypeEnum.PropertyTypeDefance, starslv)); //energy energy = (int)(pro.GetPro((int)PropertyTypeEnum.PropertyTypeMaxMana) * itempro.GetRatioPlayerByProId((int)PropertyTypeEnum.PropertyTypeMaxMana, starslv) + itemlv.energy * itempro.GetRatioCropsByProId((int)PropertyTypeEnum.PropertyTypeMaxMana, starslv)); }
public static PropertyOperation GetDeleteOperation(this Property property, HashSet <Measure> measures) { var removed = property.Clusters.FirstOrDefault(c => measures.SetEquals(c.Measures)); if (removed == null) { return(null); } var cluster = Operation <Cluster> .NewRemove(removed); var clusters = new List <Operation <Cluster> > { cluster }; return(PropertyOperation.Create(property.Key, property.Description, property.Deprecated, Epoch.UtcNow, clusters)); }
/// <summary> /// Convert the property operation type to a readable string /// </summary> /// <param name="operation"> /// The property operation to perform /// </param> public static string PropertyOperationToString(PropertyOperation operation) { switch (operation) { case PropertyOperation.IncrementCount: { return(" increase the counter "); } case PropertyOperation.DecrementCount: { return(" decrease the counter "); } case PropertyOperation.IncrementByValue: { return(@" increment by value of "); } case PropertyOperation.DecrementByValue: { return(" decrement by value of "); } case PropertyOperation.SetFlag: { return(" set the flag "); } case PropertyOperation.SetToValue: { return(" set to the value "); } case PropertyOperation.UnsetFlag: { return(" unset the flag "); } default: { return(""); } } }
private void UpdatePlayerData() { PlayerPropertyModule propertyModule = ModuleManager.Instance.FindModule <PlayerPropertyModule>(); PlayerDataModule dataModule = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (propertyModule == null || dataModule == null) { return; } PropertyOperation op = propertyModule.GetPlayerProperty(); int hp = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeMaxHP); mHp.text = hp.ToString(); int mp = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeMaxMana); mMp.text = mp.ToString(); int damage = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeDamage); mDamage.text = damage.ToString(); int defence = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeDefance); mDefence.text = defence.ToString(); int crit = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeCrticalLV); mCritLv.text = crit.ToString(); mZhanli1.text = dataModule.GetGrade().ToString(); mZhanli2.text = "战斗力:" + dataModule.GetGrade().ToString(); mExp.text = dataModule.GetExp().ToString() + "/" + dataModule.GetMaxExp().ToString(); mName.text = dataModule.GetName(); mRoleName.text = "Lv " + dataModule.GetLevel().ToString() + "." + dataModule.GetName(); SetCropsInfo(mMainCrops, mSubCrops); }
//时装属性 public static void BuildFashionProperty(PlayerData mainData, PropertyOperation operation) { operation.Clear(); for (int i = 0; i < mainData.mFashion.unlock_count; ++i) { FashionTableItem res = DataManager.FashionTable[mainData.mFashion.items[i].id] as FashionTableItem; if (res == null) { return; } var pro_res = DataManager.FashionPropTable[mainData.mFashion.items[i].starnum + res.propid] as FashionPropTableItem; if (pro_res == null) { return; } operation.AddPro((int)PropertyTypeEnum.PropertyTypeMaxHP, (pro_res.life > 0) ? pro_res.life: 0); operation.AddPro((int)PropertyTypeEnum.PropertyTypeDamage, (pro_res.fight > 0) ? pro_res.fight : 0); operation.AddPro((int)PropertyTypeEnum.PropertyTypeDefance, (pro_res.defence > 0) ? pro_res.defence : 0); operation.AddPro((int)PropertyTypeEnum.PropertyTypeCrticalLV, (pro_res.critical > 0) ? pro_res.critical : 0); operation.AddPro((int)PropertyTypeEnum.PropertyTypeMaxMana, (pro_res.power > 0) ? pro_res.power : 0); } }
private object LocatePropertyValue(DtsObject dtsObject, string propertyPath, PropertyOperation operation, object value) { propertyPath = propertyPath.Replace("\\", "."); object returnValue = null; string firstPart = propertyPath; string restOfString = string.Empty; if (propertyPath.Contains(".")) { // Can have periods in object names (like connection manager names) // Need to verify that period is not between an index marker int delimiterIndex = propertyPath.IndexOf("."); // while (delimiterIndex > propertyPath.IndexOf("[") && // delimiterIndex < propertyPath.IndexOf("]")) // { // delimiterIndex = propertyPath.IndexOf(".", delimiterIndex + 1 ); // } if (delimiterIndex > propertyPath.IndexOf("[") && delimiterIndex < propertyPath.IndexOf("]")) { delimiterIndex = propertyPath.IndexOf(".", propertyPath.IndexOf("]")); } if (delimiterIndex > -1) { firstPart = propertyPath.Substring(0, delimiterIndex); restOfString = propertyPath.Substring(delimiterIndex + 1, (propertyPath.Length - (delimiterIndex + 1))); if (firstPart.Length == 0) { return(LocatePropertyValue(dtsObject, restOfString, operation, value)); } } } if (firstPart.ToUpper().StartsWith("PACKAGE")) { if (!(dtsObject is Package)) { throw new ArgumentException("The initial object must be of type Package.", "dtsObject"); } return(LocatePropertyValue(dtsObject, restOfString, operation, value)); } // \Package.Variables[User::TestVar].Properties[Value] if (firstPart.ToUpper().StartsWith("VARIABLES")) { if (!(dtsObject is DtsContainer)) { throw new ArgumentException("Object must be of type DtsContainer to reference variables.", "dtsObject"); } Variables vars = null; string varName = GetSubStringBetween(firstPart, "[", "]"); DtsContainer cont = (DtsContainer)dtsObject; cont.VariableDispenser.LockOneForRead(varName, ref vars); returnValue = LocatePropertyValue(vars[varName], restOfString, operation, value); vars.Unlock(); return(returnValue); } // \Package.Properties[CreationDate] if (firstPart.ToUpper().StartsWith("PROPERTIES")) { if (!(dtsObject is IDTSPropertiesProvider)) { throw new ArgumentException("Object must be of type IDTSPropertiesProvider to reference properties.", "dtsObject"); } IDTSPropertiesProvider propProv = (IDTSPropertiesProvider)dtsObject; string propIndex = GetSubStringBetween(firstPart, "[", "]"); DtsProperty prop = propProv.Properties[propIndex]; if (operation == PropertyOperation.Set) { var variable = dtsObject as Variable; if (variable != null) { prop.SetValue(variable, Convert.ChangeType(value, variable.DataType)); } else { prop.SetValue(dtsObject, Convert.ChangeType(value, propProv.Properties[propIndex].Type)); } } return(prop.GetValue(dtsObject)); } // \Package.Connections[localhost.AdventureWorksDW2008].Properties[Description] if (firstPart.ToUpper().StartsWith("CONNECTIONS")) { if (!(dtsObject is Package)) { throw new ArgumentException("Object must be of type Package to reference Connections.", "dtsObject"); } string connIndex = GetSubStringBetween(firstPart, "[", "]"); Package pkg = (Package)dtsObject; return(LocatePropertyValue(pkg.Connections[connIndex], restOfString, operation, value)); } // \Package.EventHandlers[OnError].Properties[Description] if (firstPart.ToUpper().StartsWith("EVENTHANDLERS")) { if (!(dtsObject is EventsProvider)) { throw new ArgumentException("Object must be of type EventsProvider to reference events.", "dtsObject"); } EventsProvider eventProvider = (EventsProvider)dtsObject; string eventIndex = GetSubStringBetween(firstPart, "[", "]"); return(LocatePropertyValue(eventProvider.EventHandlers[eventIndex], restOfString, operation, value)); } // First Part of string is not one of the hard-coded values - it's either a task or container if (!(dtsObject is IDTSSequence)) { throw new ArgumentException("Object must be of type IDTSSequence to reference other tasks or containers.", "dtsObject"); } IDTSSequence seq = (IDTSSequence)dtsObject; if (seq.Executables.Contains(firstPart)) { return(LocatePropertyValue(seq.Executables[firstPart], restOfString, operation, value)); } // \Package\Sequence Container\Script Task.Properties[Description] // \Package\Sequence Container.Properties[Description] // \Package\Execute SQL Task.Properties[Description] // \Package.EventHandlers[OnError].Variables[System::Cancel].Properties[Value] // \Package.EventHandlers[OnError]\Script Task.Properties[Description] if (restOfString.Length > 0) { returnValue = LocatePropertyValue(dtsObject, restOfString, operation, value); } return(returnValue); }
virtual public bool BuildProperty(PropertyOperation operation) { return(false); }
//枪械属性 public static void BuildWeaponProperty(PlayerData mainData, PropertyOperation operation) { operation.Clear(); //主武器属性 WeaponObj obj = mainData.mPack.GetItemByID(mainData.main_weaponId, PackageType.Pack_Weapon) as WeaponObj; if (null != obj) { obj.BuildProperty(operation); } //强化属性 StrenTableItem item = DataManager.StrenTable[mainData.mStrenLv] as StrenTableItem; if (null == item) { GameDebug.LogError("没有此强化等级 lv = " + mainData.mStrenLv); return; } operation.AddPro((int)PropertyTypeEnum.PropertyTypeDamage, item.value); int starlv = (int)(mainData.mStrenLv / (int)STARS_RANK.MAX_STARS_RANK_NUMBER); if (starlv > 0 && (mainData.mStrenLv % (int)STARS_RANK.MAX_STARS_RANK_NUMBER) == 0) { starlv -= 1; } if (0 != starlv) { for (int i = 1; i <= starlv; ++i) { StrProTableItem itempro = DataManager.StrProTable[i] as StrProTableItem; if (null == itempro) { GameDebug.LogError("strenthpro.txt中不存在id = " + starlv); return; } if (itempro.life != uint.MaxValue) { operation.AddPro((int)PropertyTypeEnum.PropertyTypeMaxHP, itempro.life); } if (itempro.damage != uint.MaxValue) { operation.AddPro((int)PropertyTypeEnum.PropertyTypeDamage, itempro.damage); } if (itempro.crits != uint.MaxValue) { operation.AddPro((int)PropertyTypeEnum.PropertyTypeCrticalLV, itempro.crits); } if (itempro.defence != uint.MaxValue) { operation.AddPro((int)PropertyTypeEnum.PropertyTypeDefance, itempro.defence); } if (itempro.energy != uint.MaxValue) { operation.AddPro((int)PropertyTypeEnum.PropertyTypeMaxMana, itempro.energy); } } } //配件属性 FittingsData[] mFittings = mainData.mFittings; WeaponModule module = ModuleManager.Instance.FindModule <WeaponModule>(); if (null == module) { return; } for (int i = 0; i < (int)FittingsType.MAX_FITTGINS; ++i) { FittingsTableItem fittingsitem = DataManager.FittingsTable[mFittings[i].GetId()] as FittingsTableItem; if (null == fittingsitem) { break; } for (int j = 0; j < (int)FittingsType.MAX_PROPERTY; ++j) { int min = 0; int max = 1; if (!module.GetFittMinMax(mFittings[i].GetId(), mFittings[i].GetProIdByPos(j), ref min, ref max)) { continue; } operation.AddPro(mFittings[i].GetProIdByPos(j), mFittings[i].GetProValueByPos(j)); } } }
public PropertyViewModel AddNewProperty(PropertyViewModel newProperty) { PropertyOperation propertyOperation = new PropertyOperation(); return(propertyOperation.AddProperty(newProperty)); }
public IHttpActionResult GetPropertyList() { PropertyOperation propertyOperation = new PropertyOperation(); return(Ok(propertyOperation.GetPropertyList())); }