private static string GetTemplatePath(EItemType Type, ITemplate Template) { string path = ""; switch (Type) { default: throw new Exception("Unknown EItemType! Can't setup TemplatePath"); case EItemType.Waffe: path = DirWeapon; break; case EItemType.Rüstung: path = DirArmor; break; case EItemType.Lapis: path = DirLapis; break; case EItemType.APItem: path = DirApItem; break; case EItemType.EtcItem: path = DirEtc; break; } path += Template.ToFilename(); return(path); }
public Vendor(string _vendorid, string[] _itemIds, EItemType _demandedType) { this._vendorid = _vendorid; this._itemIds = _itemIds.ToList(); this._demandedType = _demandedType; InitItems(); }
public override bool HaveItem(EItemType itemType) { if (itemType == EItemType.Carcass) { if (_hasCarcass) { return(true); } } if (itemType == EItemType.Battery) { if (_haveBattery) { return(true); } } if (itemType == EItemType.GreenBattery) { if (_haveGreenBattery) { return(true); } } return(false); }
public override bool HaveBudget(EItemType target) { if (target == EItemType.Battery) { if (_normalVehicle) { return(true); } return(HaveBudget(EWorldImpactType.ElecCarsCompanyV1)); } else if (target == EItemType.GreenBattery) { if (_greenVehicle) { return(true); } return(HaveBudget(EWorldImpactType.ElecCarsCompanyV2)); } else if (target == EItemType.Carcass) { if (_isCompanyActivated) { return(true); } return(HaveBudget(EWorldImpactType.CarsCompany)); } return(base.HaveBudget(target)); }
public static Sprite GetImageForItem(EItemType itemType, string spriteId) { Sprite cashedSprite; _cachedImages.TryGetValue(spriteId, out cashedSprite); var rescourcePath = ""; switch (itemType) { case EItemType.Consumable: { rescourcePath = kConsumablesPath; break; } case EItemType.Trap: case EItemType.Receipt: case EItemType.Generic: { rescourcePath = kGenericPath; break; } } if (cashedSprite == null) { var sprite = Resources.Load <Sprite> (rescourcePath + spriteId); _cachedImages.Add(spriteId, sprite); return(sprite); } return(cashedSprite); }
public Sprite GetItemFrame(EItemType type, int rare) { Sprite[] spriteArray; switch (type) { case EItemType.UnitPiece: case EItemType.ItemPiecePiece: spriteArray = this.ItemIcons.KakeraFrames; break; case EItemType.ArtifactPiece: spriteArray = this.ItemIcons.ArtifactKakeraFrames; break; default: spriteArray = this.ItemIcons.NormalFrames; break; } int index = Mathf.Clamp(rare, 0, spriteArray.Length - 1); if (0 <= index) { return(spriteArray[index]); } return((Sprite)null); }
public void UpdateInfo() { starFeedback.transform.position = stars[targetIndex].transform.position; stars[targetIndex].transform.localScale = new Vector3(1.25f, 1.25f, 1.25f); EItemType lEItem = pnj.neededItems[targetIndex]; Item lItem = ResourcesManager.Instance.ItemModels.Find(i => i.itemType == lEItem); int happinessPoint = 0; if (pnj.HaveItem(lEItem)) { happinessPoint++; itemMark.texture = lItem.icon.texture; } else { itemMark.texture = lItem.hiddenIcon.texture; } if (pnj.HaveBudget(lEItem)) { happinessPoint++; budgetMark.texture = MainLoader <Sprite> .Instance.GetResource("money_icon").texture; } else { budgetMark.texture = MainLoader <Sprite> .Instance.GetResource("money_icon_lock").texture; } smileyRenderer.texture = MainLoader <Sprite> .Instance.GetResource("happyness" + happinessPoint).texture; }
//--------------------------------------------------------------------------- public int TryAdd(EItemType type, int count) { ItemDesc item = ItemManager.Get().Find(type); if (!item.IsEmpty) { int remaining = count; int index = 0; do { index = GetFirstNonFullSlot(type); if (index >= 0) { if (m_Items[index] == null) { m_Items[index] = new InventorySlot(item); if (index == ActiveIndex) { if (index == ActiveIndex) { UpdateWeapon(); } } } remaining = m_Items[index].Add(remaining); } }while (remaining > 0 && index >= 0); return(remaining); } return(count); }
public bool SendMsgPlayerSystemGC2GMReqUseBagItemData(EItemType a_type, UInt32 a_itemIndex, CBMsgPlayerSystemGM2GCAckUseBagItemData cb) { CMsgPlayerSystemGC2GMReqUseBagItemData req = new CMsgPlayerSystemGC2GMReqUseBagItemData(a_type, a_itemIndex); CMsgPlayerSystemGM2GCAckUseBagItemData.cb = cb; return(CGameClient.Singleton.SendMsg(req)); }
protected void PutData(System.Data.SqlClient.SqlDataReader aReader) { if (aReader == null) { throw new Exception(); } this.ShopID = Convert.ToInt16(aReader["ShopID"]); this.HeadID = Convert.ToInt16(aReader["HeadID"]); this.IsCommend = Convert.ToByte(aReader["IsCommend"]); this.IsHot = Convert.ToByte(aReader["IsHot"]); this.IsNew = Convert.ToByte(aReader["IsNew"]); this.IsCanSellToShop = Convert.ToBoolean(aReader["IsCanSellToShop"]); this.SellToShopPrice = Convert.ToInt32(aReader["SellToShopPrice"]); this.IsBuyMustVip = Convert.ToBoolean(aReader["IsBuyMustVip"]); this.IsBind = Convert.ToBoolean(aReader["IsBind"]); this.ItemDesc = Convert.ToString(aReader["ItemDesc"]); this.itemid = Convert.ToInt16(aReader["ItemId"]); this.itemName = Convert.ToString(aReader["itemName"]); this.originalPrice = Convert.ToInt32(aReader["BuyoriginalPrice"]); this.ratePrice = Convert.ToInt32(aReader["BuyRatePrice"]); this.validDate = Convert.ToInt16(aReader["ValidDate"]); this.PriceType = (PriceType)Enum.Parse(typeof(PriceType), Convert.ToInt16(aReader["BuyPriceType"]).ToString(), true); this.IsHidden = Convert.ToBoolean(aReader["IsHidden"]); this.BelongSort = Convert.ToInt16(aReader["BelongSort"]); this.UnitName = Convert.ToString(aReader["UnitName"]); this.itemType = (EItemType )Enum.Parse(typeof(EItemType), Convert.ToInt16(aReader["itemType"]).ToString(), true); this._itemSort = (EItemSort)Enum.Parse(typeof(EItemSort), Convert.ToInt16(aReader["ItemSort"]).ToString(), true); this._DataForClientVersions = sDataVersionSplit + Convert.ToString(aReader["ForClientVersions"]) + sDataVersionSplit; }
private ItemOnFloor GenerateItem(EItemType itemType) { ItemOnFloor item = null; switch (itemType) { case EItemType.PARCHMENT: item = new ItemOnFloor(Content.Load <Texture2D>("Images/Parchment"), itemType); break; case EItemType.KEY_1: item = new ItemOnFloor(Content.Load <Texture2D>("Images/Key1"), itemType); break; case EItemType.KEY_2: item = new ItemOnFloor(Content.Load <Texture2D>("Images/Key2"), itemType); break; default: break; } if (item != null) { item.Position = map.GetRandomFreePosition(0, map.Width - 1, 0, map.Height - 1); item.IsActive = false; return(item); } return(null); }
private void DrawItemInformation(EItemType type, int buttonNumber) { if (_inventory == null) { Debug.Log("_inventory is null"); return; } _currentExplainItemType = type; _currentExplainItemNumber = buttonNumber; Text itemName = _itemExplainPanel.transform.Find("ItemName").GetComponent <Text>(); Text itemGrade = _itemExplainPanel.transform.Find("ItemGrade").GetComponent <Text>(); Text itemExplain = _itemExplainPanel.transform.Find("ItemExplain").GetComponent <Text>(); Image itemImage = _itemExplainPanel.transform.Find("Image").GetComponent <Image>(); if (type == EItemType.Equip) { itemName.text = _inventory.EquipItems[buttonNumber].ItemName; itemGrade.text = Item.CItemExplainText.ItemCodeToGrade(_inventory.EquipItems[buttonNumber].ItemCode); itemExplain.text = Item.CEquipExplainText.CreateExplainText(_inventory.EquipItems[buttonNumber]); itemImage.sprite = _inventory.EquipItems[buttonNumber].ItemImage; } else if (type == EItemType.Consumable) { itemName.text = _inventory.ConsumableItems[buttonNumber].consumable.ItemName; itemGrade.text = Item.CItemExplainText.ItemCodeToGrade(_inventory.ConsumableItems[buttonNumber].consumable.ItemCode); itemExplain.text = Item.CConsumableExplainText.CreateExplainText(_inventory.ConsumableItems[buttonNumber].consumable); itemImage.sprite = _inventory.ConsumableItems[buttonNumber].consumable.ItemImage; } }
static void AddStat(this GameSave gameSave, Level level, EItemType stat) { if (level.MainHero == null) { return; } var lunais = level.MainHero.AsDynamic(); switch (stat) { case EItemType.MaxHP: gameSave.CharacterStats.MaxHPFound++; lunais.RefreshCharacterStats(true); lunais.HP = lunais.MaxHP; break; case EItemType.MaxAura: gameSave.CharacterStats.MaxAuraFound++; lunais.RefreshCharacterStats(true); ((object)lunais._spellManager).AsDynamic().Aura = (float)lunais.MaxAura; break; case EItemType.MaxSand: gameSave.CharacterStats.MaxSandFound++; lunais.RefreshCharacterStats(true); lunais.MP = lunais.MaxMP; break; default: throw new ArgumentOutOfRangeException(nameof(stat), stat, null); } }
/// <summary> /// Intersect a ray with this object. /// </summary> public bool IntersectRay(Ray R, out float T) { T = float.MaxValue; float t; bool hit = false; EItemType ItemType = mAsset.mItemType; if (ItemType == EItemType.SAFE || ItemType == EItemType.DECO || ItemType == EItemType.REST || ItemType == EItemType.DESK || ItemType == EItemType.FOOD || ItemType == EItemType.DOOR) { if (mAsset.mPMAsset.mVectorModel.IntersectRay(R, _Gob.transform.GetChild(0).transform.worldToLocalMatrix, out t)) { if (t < T) { hit = true; T = t; } } } if (ItemType == EItemType.DESK) { if (mAsset.mSMAsset.mVectorModel.IntersectRay(R, _Gob.transform.GetChild(1).transform.worldToLocalMatrix, out t)) { if (t < T) { hit = true; T = t; } } } return(hit); }
public virtual void SetWeaponType(EItemKey weaponRKey, EItemKey weaponLKey) { if (weaponRKey != EItemKey.None && weaponLKey != EItemKey.None) { //TODO: setup dual animation } else { EItemType weaponType = ItemsConfig.Instance.GetItem(weaponRKey != EItemKey.None ? weaponRKey : weaponLKey).Type; switch (weaponType) { case EItemType.W_Gun: _animRun = EUnitAnimationState.Run_Gun; _animAttack = EUnitAnimationState.Strike_Gun; _weaponStanceOffset = _gunStanceOffset; break; case EItemType.W_Rifle: _animRun = EUnitAnimationState.Run_Rifle; _animAttack = EUnitAnimationState.Strike_Rifle; _weaponStanceOffset = _rifleStanceOffset; break; } } }
private ITemplate BuildTemplate() { ITemplate tpl = new ITemplate(); EItemType type = (EItemType)cmbType.SelectedIndex; tpl.txtName = txtName.Text; if (type == EItemType.Lapis) // Lapis name { Lapi l = (cmbLapi.SelectedItem as ImageComboItem).Tag as Lapi; tpl.txtName = l.Name; tpl.LapisType = l.Type; tpl.LapisLevel = l.Level; } else if (type == EItemType.Lapisa) // Lapisa name { tpl.txtName = ((ELapisa)cmbLapisa.SelectedIndex).ToString(); } tpl.cmbType = cmbType.SelectedIndex; tpl.cmbItemIcon = cmbItemIcon.SelectedIndex; tpl.cmbQuality = cmbQuality.SelectedIndex; tpl.cmbASPD = cmbASPD.SelectedIndex; tpl.numEnchant = numEnchant.Value; tpl.cmbLapisa = cmbLapisa.SelectedIndex; tpl.cmbSockel1 = cmbSockel1.SelectedIndex; tpl.cmbSockel2 = cmbSockel2.SelectedIndex; tpl.cmbSockel3 = cmbSockel3.SelectedIndex; tpl.cmbSockel4 = cmbSockel4.SelectedIndex; tpl.cmbSockel5 = cmbSockel5.SelectedIndex; tpl.cmbSockel6 = cmbSockel6.SelectedIndex; tpl.txtGold = txtGold.GoldAmount; tpl.txtANG1 = txtANG1.Text; tpl.txtANG2 = txtANG2.Text; tpl.txtHaltbarkeit = txtHaltbarkeit.Text; tpl.txtLP = txtLP.Text; tpl.txtMP = txtMP.Text; tpl.txtAP = txtAP.Text; tpl.txtGES = txtGES.Text; tpl.txtGLÜ = txtGLÜ.Text; tpl.txtSTR = txtSTR.Text; tpl.txtWEI = txtWEI.Text; tpl.txtINT = txtINT.Text; tpl.txtABW = txtABW.Text; tpl.txtLPEP4 = txtLPEP4.Text; tpl.txtMPEP4 = txtMPEP4.Text; tpl.txtAPEP4 = txtAPEP4.Text; tpl.txtGESEP4 = txtGESEP4.Text; tpl.txtGLÜEP4 = txtGLÜEP4.Text; tpl.txtSTREP4 = txtSTREP4.Text; tpl.txtWEIEP4 = txtWEIEP4.Text; tpl.txtINTEP4 = txtINTEP4.Text; tpl.txtABWEP4 = txtABWEP4.Text; tpl.txtResistenz = txtResistenz.Text; tpl.txtSeller = txtSeller.Text; return(tpl); }
private void AddFromType(EItemType pItem) { Item newItem = ResourcesManager.Instance.ItemModels.Find(i => i.itemType == pItem); if (newItem == null) { return; } if (!knowsItems.Contains(newItem)) { knowsItems.Add(newItem); itemsWornArray.Add(newItem); nbItems.Add(newItem.itemType, 1); } else { if (itemsWornArray.Contains(newItem)) { nbItems[newItem.itemType]++; } else { itemsWornArray.Add(newItem); nbItems[newItem.itemType]++; } } }
public CMsgPlayerSystemGC2GMReqUpdateBagItemData(EItemType a_type, UInt32 a_itemIndex, UInt32 a_itemCount) : base(CServerType.SRVTYPE_GAMESERVER, CFuncType.EFUNCTYPE_PLAYERSYSTEM, CPlayerSystemMsgNumID.EMSGNUMID_PLAYERSYSTEM_GC2GM_REQ_SOLDITEM_PACKAGEDATA) { m_type = a_type; m_itemIndex = a_itemIndex; m_itemCount = a_itemCount; }
public override Vector3? GetNextPositionOfItem(EItemType type) { Vector3? nextPos = null; switch (type) { case EItemType.LV1_GheXeBuyt: if (viTriGhe.Count > 0) { nextPos = viTriGhe[0]; viTriGhe.RemoveAt(0); } break; case EItemType.LV1_VoiCuuHoa: if (viTriVoiCuuHoa.Count > 0) { nextPos = viTriVoiCuuHoa[0]; viTriVoiCuuHoa.RemoveAt(0); } break; case EItemType.LV1_BotDienThoai: if (viTriBotDienThoai.Count > 0) { nextPos = viTriBotDienThoai[0]; viTriBotDienThoai.RemoveAt(0); } break; default: break; } return nextPos; }
public void ShowItemsFromData(EItemType type) { //数据库中所有的背包物品 var list = BagManager.Instance.items; if (list == null) { return; } if (slotsList == null) { slotsList = new List <GameObject>(); } if (itemInfoList == null) { itemInfoList = new List <ItemInfo>(); } int itemCount = 0; for (int i = 0; i < 30; i++) { //对象池中如果对象不够则生成对象,简单的对象池 GameObject itemObj = null; if (itemCount < slotsList.Count) { itemObj = slotsList[itemCount]; } else { itemObj = CreateItemFromTemplate(); itemObj.GetComponent <SlotDrop>().slotIndex = i; slotsList.Add(itemObj); itemInfoList.Add(new ItemInfo()); } //上面把所有格子都置为id为-1的空格子 //如果道具为空就不显示 //var bagItem = itemObj.GetComponentInChildren<BagItem>(); //itemObj.SetActive(true); //if (bagItem == null) //{ // itemObj.SetActive(false); //} //可以尝试在这儿加一个Button组件,然后用lambda表达式确定点击事件 //也可以使用本示例的Event Trigger添加事件 ++itemCount; } //对象池中多余的对象置为false //for (; itemCount < slotsList.Count; ++itemCount) //{ // slotsList[itemCount].SetActive(false); //}//这里格子数量固定为30个 //吧list中的物品加入到slotsList对象格子里 foreach (var item in list) { AddItemToSlot(item); } }
private void GiveItem(string npcName, EItemType itemType) { if (givedOject.ContainsKey(npcName)) { if (givedOject[npcName] != null) { if (givedOject[npcName].ContainsKey(itemType)) { givedOject[npcName][itemType]++; } } else { givedOject[npcName] = new Dictionary <EItemType, int> { { itemType, 1 } }; } } else { givedOject.Add(npcName, new Dictionary <EItemType, int>()); givedOject[npcName] = new Dictionary <EItemType, int> { { itemType, 1 } }; } }
//--------------------------------------------------------------------------- public ItemDesc Find(EItemType type) { if (m_Items.ContainsKey(type)) { return(m_Items[type]); } return(ItemDesc.Empty); }
public AItemBase(string itemId, string itemName, EItemType itemType) { Debug.Assert(!string.IsNullOrEmpty(itemId), GetType().ToString() + ":: no item ID was assigned"); SetAction(DisplayItem()); _name = itemName; _itemType = itemType; _itemID = itemId; }
public void Give(int index, string npcName) { EItemType eName = itemsWornArray[index].itemType; int nb = nbItems[eName] - 1; nbItems[eName] = nb; GiveItem(npcName, eName); }
public static void SaveTemplate( ITemplate Template, EItemType Type ) { string filePath = GetTemplatePath( Type, Template ) + ".tpl"; if( File.Exists( filePath ) ) File.Delete( filePath ); using( FileStream fs = File.OpenWrite( filePath ) ) mXml.Serialize( fs, Template ); }
public Item(EItemType _ItemType, string _ItemName, int _ItemCode, int _ItemCount, int _AmmoCount) { itemType = _ItemType; itemName = _ItemName; itemCode = _ItemCode; itemCount = _ItemCount; ammoCount = _AmmoCount; }
//--------------------------------------------------------------------------- public void Add(EItemType type, float probability) { if (!Types.ContainsKey(type)) { Types.Add(type, probability); m_MaxProbability += probability; } }
//--------------------------------------------------------------------------- public void Remove(EItemType type) { if (Types.ContainsKey(type)) { m_MaxProbability -= Types[type]; Types.Remove(type); } }
//--------------------------------------------------------------------------- public ItemDesc(string name, EItemType type, EItemRarity rarity, Sprite sprite, bool isStackable, bool isConsumable) : this() { Name = name; Type = type; Rarity = rarity; Sprite = sprite; IsStackable = isStackable; IsConsumable = isConsumable; }
public UnturnedItem(int itemId, string itemName, EItemType itemType, string itemDescription, byte amount, byte[] icon = null) { ItemId = itemId; ItemName = itemName; ItemType = itemType; ItemDescription = itemDescription; Amount = amount; Icon = icon; }
public Item(EItemType item_type, int item_code, int item_count, int ammo_count, int max_bullet, int bullet_count) { IT = item_type; itemCode = item_code; itemCount = item_count; ammoCount = ammo_count; maxBullet = max_bullet; bulletCount = bullet_count; }
public void SetFromItem(EItemType iType) { if (pnj.neededItems.Contains(iType)) { stars[targetIndex].transform.localScale = Vector3.one; targetIndex = pnj.neededItems.IndexOf(iType); UpdateInfo(); } }
public ITMItem getItemFromTypeAndID(EItemType aType,int aID) { switch(aType) { case(EItemType.Vitamin):return vitLibrary.itemByID(aID); case(EItemType.Recovery):return recoveryLibrary.itemByID(aID); case(EItemType.Bait):return baitsLibrary.itemByID(aID); case(EItemType.BattleBoost):return boostLibrary.itemByID(aID); case(EItemType.PlayerBoost):return playerBoostsLibrary.itemByID(aID); } return null; }
//Cài đặt object trước khi sử dụng public virtual void Setup(EItemType type, float velocity, BaseGenerator generator) { timerCounter = 0; this.type = type; this.velocity = velocity; this.generator = generator; generator.rootLevel.mainController.mainPlayer.OnPlayerDieEvent += player_OnLevelOver; this.gameObject.SetActive(true); if (rig != null) rig.velocity = Vector2.left * velocity; }
public bool HasItem(EItemType itemType) { bool has = false; if(dicItems.ContainsKey(itemType)){ Item item = dicItems[itemType]; if(item.num > 0){ has = true; } } return has; }
public Item(EItemType itemType) { this.itemType = itemType; this.num = 1; switch (itemType) { case EItemType.LandMine:{ this.describe = IText.Des_Item_Landmine; this.iconName = "INV_Misc_Bomb_09"; this.canUse = true; } break; default: break; } }
public abstract Vector3? GetNextPositionOfItem(EItemType type);
public ItemHud(EItemType itemType, Texture2D texture2D, Vector2 position, float rotation, Vector2 origin, Vector2 scale) { DrawableComponents.Add("RenderComponent", new RenderComponent(this, texture2D, position, rotation, origin, scale, 1.0f)); this.itemType = itemType; }
void UIPagControll() { // UICamera.selectedObject = if(!IsTouchDirInIntervalTime(0.06f)){ g_TimeLast_TouchDir = Time.time; GameObject gobjGrid = Tools.GetGameObjectInChildByPathSimple(gobj_UI_Items, "ListView/Grid"); int itemsCount = gobjGrid.transform.GetChildCount(); if(itemsCount > 0){ if(VCInput_Axis > 0){ if(g_Cur_UIItems_SelectedIndex < (itemsCount - 1)){ g_Cur_UIItems_SelectedIndex ++; SelectItemByIndex(g_Cur_UIItems_SelectedIndex); } }else if(VCInput_Axis < 0){ if(g_Cur_UIItems_SelectedIndex > 0){ g_Cur_UIItems_SelectedIndex --; SelectItemByIndex(g_Cur_UIItems_SelectedIndex); } }else if(VCInput_Ver_Axis > 0){ if(g_Cur_UIItems_SelectedIndex > 5){ g_Cur_UIItems_SelectedIndex -= 6; SelectItemByIndex(g_Cur_UIItems_SelectedIndex); } }else if(VCInput_Ver_Axis < 0){ if(g_Cur_UIItems_SelectedIndex + 6 < itemsCount){ g_Cur_UIItems_SelectedIndex += 6; SelectItemByIndex(g_Cur_UIItems_SelectedIndex); } }else if(VCInput_BtnA > 0){ GameObject gobjItem = gobjGrid.transform.GetChild(g_Cur_UIItems_SelectedIndex).gameObject; ItemIcon itemIcom = gobjItem.GetComponent<ItemIcon>(); Item item = itemIcom.item; if(item.canUse){ curChooseItemType = item.itemType; // show txu UISlicedSprite ss = Tools.GetComponentInChildByPath<UISlicedSprite>(gobj_UI_Panel,"BtnPag/Background"); ss.spriteName = item.iconName; // show num GameObject gobjNum = Tools.GetGameObjectInChildByPathSimple(gobj_UI_Panel, "BtnPag/num"); gobjNum.SetActive(true); UILabel txtNum = gobjNum.GetComponent<UILabel>(); txtNum.text = item.num.ToString(); } } } if(VCInput_BtnB > 0){ TogglePagOpenClose(); } } }
public BaseItem(EItemKey key, EItemType type, EUnitEqupmentSlot[] possibleSlots) { _key = key; _type = type; _possibleSlots = possibleSlots; }
public BetterList<InventoryItem> itemsOfType(EItemType aType) { BetterList<InventoryItem> ret = new BetterList<InventoryItem>(); for(int i = 0;i<_myItems.size;i++) { EItemType combined = _myItems[i].item.Type()&aType; if((int) combined>0) { ret.Add(_myItems[i]); } } return ret; }
private static string GetTemplatePath( EItemType Type, ITemplate Template ) { string path = ""; switch( Type ) { default: throw new Exception( "Unknown EItemType! Can't setup TemplatePath" ); case EItemType.Waffe: path = DirWeapon; break; case EItemType.Rüstung: path = DirArmor; break; case EItemType.Lapis: path = DirLapis; break; case EItemType.APItem: path = DirApItem; break; case EItemType.EtcItem: path = DirEtc; break; } path += Template.ToFilename(); return path; }
private Image GetTemplateItemImage( EItemType Type, int Index ) { switch( Type ) { case EItemType.Waffe: return listWeapon.Images[ Index ]; case EItemType.Rüstung: return listArmor.Images[ Index ]; case EItemType.Lapis: return listLapis.Images[ Index ]; case EItemType.Lapisa: return listLapisa.Images[ Index ]; case EItemType.APItem: return listAPItem.Images[ Index ]; case EItemType.EtcItem: return listEtcItem.Images[ Index ]; } return null; }
private void LoadAutoComplete( EItemType type ) { AutoCompleteStringCollection col = new AutoCompleteStringCollection(); ResultTable tpl; if( SQLHelper.SendQuery( "SELECT `name` FROM `shaiya_price_db` WHERE `type` = " + (int)type, out tpl ) == false || tpl == null ) return; for( int i = 0; i < tpl.Rows.Count; i++ ) col.Add( tpl[ i ][ "name" ].GetString() ); txtName.AutoCompleteCustomSource = col; }
private void cmbType_SelectedIndexChanged( object sender, EventArgs e ) { EItemType newType = (EItemType)cmbType.SelectedIndex; if( mCurrentType == newType ) return; mCurrentType = newType; MenuTemplatesSave.Enabled = ( mCurrentType != EItemType.Lapisa ); switch( mCurrentType ) { case EItemType.Waffe: LoadAutoComplete( mCurrentType ); SetTypeWeapon(); break; case EItemType.Rüstung: LoadAutoComplete( mCurrentType ); SetTypeArmor(); break; case EItemType.Lapis: SetTypeLapi(); break; case EItemType.Lapisa: SetTypeLapisa(); break; case EItemType.APItem: LoadAutoComplete( mCurrentType ); SetTypeAP(); break; case EItemType.EtcItem: LoadAutoComplete( mCurrentType ); SetTypeEtc(); break; } }
public static bool IsRechargeable(EItemType pType) { return pType == EItemType.Star || pType == EItemType.Bullet; }
protected void PutData(System.Data.SqlClient.SqlDataReader aReader) { if (aReader == null) throw new Exception(); this.ShopID = Convert.ToInt16(aReader["ShopID"]); this.HeadID = Convert.ToInt16(aReader["HeadID"]); this.IsCommend = Convert.ToByte(aReader["IsCommend"]); this.IsHot = Convert.ToByte(aReader["IsHot"]); this.IsNew = Convert.ToByte(aReader["IsNew"]); this.IsCanSellToShop = Convert.ToBoolean(aReader["IsCanSellToShop"]); this.SellToShopPrice = Convert.ToInt32(aReader["SellToShopPrice"]); this.IsBuyMustVip = Convert.ToBoolean(aReader["IsBuyMustVip"]); this.IsBind = Convert.ToBoolean(aReader["IsBind"]); this.ItemDesc = Convert.ToString(aReader["ItemDesc"]); this.itemid = Convert.ToInt16(aReader["ItemId"]); this.itemName = Convert.ToString(aReader["itemName"]); this.originalPrice = Convert.ToInt32(aReader["BuyoriginalPrice"]); this.ratePrice = Convert.ToInt32(aReader["BuyRatePrice"]); this.validDate = Convert.ToInt16(aReader["ValidDate"]); this.PriceType = (PriceType)Enum.Parse(typeof(PriceType), Convert.ToInt16(aReader["BuyPriceType"]).ToString(), true); this.IsHidden = Convert.ToBoolean(aReader["IsHidden"]); this.BelongSort = Convert.ToInt16(aReader["BelongSort"]); this.UnitName = Convert.ToString(aReader["UnitName"]); this.itemType = (EItemType )Enum.Parse(typeof(EItemType), Convert.ToInt16(aReader["itemType"]).ToString(), true); this._itemSort = (EItemSort)Enum.Parse(typeof(EItemSort), Convert.ToInt16(aReader["ItemSort"]).ToString(), true); this._DataForClientVersions = sDataVersionSplit + Convert.ToString(aReader["ForClientVersions"]) + sDataVersionSplit; }