本文整理汇总了C#中Item类的典型用法代码示例。如果您正苦于以下问题:C# Item类的具体用法?C# Item怎么用?C# Item使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Item类属于命名空间,在下文中一共展示了Item类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: LoadRepositoryXml
public static void LoadRepositoryXml(string filePath, ContentManager content)
{
XmlDocument document = new XmlDocument();
document.Load(filePath);
foreach (XmlNode itemNode in document.SelectNodes("ItemRepository/Item"))
{
Item item = new Item();
item.Name = XmlExtensions.GetAttributeValue(itemNode, "Name", null, true);
item.FriendlyName = itemNode.SelectSingleNode("FriendlyName").InnerText;
item.Description = itemNode.SelectSingleNode("Description").InnerText;
item.Weight = XmlExtensions.GetAttributeValue<float>(itemNode, "Weight", 0);
item.ItemType = (ItemType)Enum.Parse(typeof(ItemType), XmlExtensions.GetAttributeValue(itemNode, "ItemType", null, true));
foreach(XmlNode drawableSetNode in itemNode.SelectNodes("Drawables/Drawable"))
{
string src = XmlExtensions.GetAttributeValue(drawableSetNode, "src");
DrawableSet.LoadDrawableSetXml(item.Drawables, src, content);
}
if (itemNode.SelectSingleNode("Icon") != null)
item.Icon = content.Load<Texture2D>(XmlExtensions.GetAttributeValue(itemNode.SelectSingleNode("Icon"), "src"));
GameItems.Add(item.Name, item);
}
}
开发者ID:behindcurtain3,项目名称:TheArena,代码行数:27,代码来源:ItemRepository.cs
示例2: StartGift
/// <summary>
/// Starts a new session and calls Gift.
/// </summary>
/// <param name="target"></param>
/// <param name="creature"></param>
/// <param name="gift"></param>
public void StartGift(NPC target, Creature creature, Item gift)
{
if (!this.Start(target, creature))
return;
this.Script.GiftAsync(gift);
}
开发者ID:tkiapril,项目名称:aura,代码行数:13,代码来源:NpcSession.cs
示例3: Fuma
public Fuma() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "Fuma";
Body = 400;
Female = false;
SetStr( 536, 585 );
SetDex( 126, 145 );
SetInt( 281, 305 );
SetHits( 322, 351 );
SetDamage( 13, 16 );
SetDamageType( ResistanceType.Physical, 100 );
SetResistance( ResistanceType.Physical, 35, 45 );
SetResistance( ResistanceType.Fire, 30, 40 );
SetResistance( ResistanceType.Cold, 25, 35 );
SetResistance( ResistanceType.Poison, 30, 40 );
SetResistance( ResistanceType.Energy, 30, 40 );
SetSkill( SkillName.EvalInt, 85.1, 100.0 );
SetSkill( SkillName.Magery, 85.1, 100.0 );
SetSkill( SkillName.MagicResist, 80.2, 110.0 );
SetSkill( SkillName.Tactics, 60.1, 80.0 );
SetSkill( SkillName.Wrestling, 40.1, 50.0 );
Fame = 15000;
Karma = -15000;
VirtualArmor = 40;
Item hair = new Item( Utility.RandomList( 0x203B, 0x2049, 0x2048, 0x204A ) );
hair.Hue = Utility.RandomHairHue();
hair.Layer = Layer.Hair;
hair.Movable = false;
AddItem( hair );
NinjaTabi ninjatabi = new NinjaTabi();
ninjatabi.Hue = 0x1;
AddItem( ninjatabi );
LeatherNinjaPants ninjapants = new LeatherNinjaPants();
ninjapants.Hue = 1;
AddItem(ninjapants);
LeatherNinjaJacket ninjajacket = new LeatherNinjaJacket();
ninjajacket.Hue = 1;
AddItem(ninjajacket);
LeatherJingasa jingasa = new LeatherJingasa();
jingasa.Hue = 1;
AddItem(jingasa);
}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:60,代码来源:fuma.cs
示例4: Dueller
public Dueller()
: base("The DuelMaster")
{
InitStats(100, 100, 25);
Hue = Utility.RandomSkinHue();
Female = false;
Direction = Direction.Down;
Body = 0x190;
Name = NameList.RandomName("male");
Title = "The DuelMaster";
AddItem(new Tunic(0x48D));
AddItem(new LongPants(0x48D));
AddItem(new SkullCap(0x48D));
AddItem(new Boots());
Item hair = new Item(Utility.RandomList(0x203B, 0x203C, 0x203D, 0x2044, 0x2045, 0x2047, 0x2049, 0x204A));
hair.Hue = Utility.RandomHairHue();
hair.Layer = Layer.Hair;
hair.Movable = false;
AddItem(hair);
Locations = new Point3D[10];
DuelSystem.Duellers.Add(this);
}
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:27,代码来源:Dueller.cs
示例5: TryDropItem
public override bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage)
{
if (!this.CheckHold(from, dropped, sendFullMessage, true))
return false;
BaseHouse house = BaseHouse.FindHouseAt(this);
if (house != null && house.IsLockedDown(this))
{
if (dropped is VendorRentalContract || (dropped is Container && ((Container)dropped).FindItemByType(typeof(VendorRentalContract)) != null))
{
from.SendLocalizedMessage(1062492); // You cannot place a rental contract in a locked down container.
return false;
}
if (!house.LockDown(from, dropped, false))
return false;
}
List<Item> list = this.Items;
for (int i = 0; i < list.Count; ++i)
{
Item item = list[i];
if (!(item is Container) && item.StackWith(from, dropped, false))
return true;
}
this.DropItem(dropped);
ItemFlags.SetTaken(dropped, true);
return true;
}
开发者ID:jasegiffin,项目名称:JustUO,代码行数:35,代码来源:Container.cs
示例6: CheckItemUse
public override bool CheckItemUse(Mobile from, Item item)
{
if (this.IsDecoContainer && item is BaseBook)
return true;
return base.CheckItemUse(from, item);
}
开发者ID:jasegiffin,项目名称:JustUO,代码行数:7,代码来源:Container.cs
示例7: OnDragDropInto
public override bool OnDragDropInto( Mobile from, Item dropped, Point3D point )
{
BasePiece piece = dropped as BasePiece;
if ( piece != null && piece.Board == this && base.OnDragDropInto( from, dropped, point ) )
{
Packet p = new PlaySound( 0x127, GetWorldLocation() );
p.Acquire();
if ( RootParent == from )
{
from.Send( p );
}
else
{
foreach ( NetState state in this.GetClientsInRange( 2 ) )
state.Send( p );
}
p.Release();
return true;
}
else
{
return false;
}
}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:29,代码来源:BaseBoard.cs
示例8: OnMoveOver
public override bool OnMoveOver( Mobile m )
{
if ( m == null || m.Deleted || m.Backpack == null || m.Backpack.Deleted )
return true;
if ( Active && m_itemType != null )
{
if ( !Creatures && !m.Player )
return true;
m_item = m.Backpack.FindItemByType(m_itemType, true);
if ( m_item != null )
{
StartTeleport(m);
return false;
}
else
{
if ( m_Message != null && m != null)
m.SendMessage(m_Message);
}
}
return true;
}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:27,代码来源:CheckForItemTeleporter.cs
示例9: Inventory
public Inventory(int SCREEN_WIDTH, int SCREEN_HEIGHT, Pantheon gameReference)
{
locationBoxes = new List<Rectangle>();
equippedBoxes = new List<Rectangle>();
types = new List<int>();
infoBox = new Rectangle();
movingBox = new Rectangle();
trashBox = new Rectangle();
tempStorage = new Item();
this.SCREEN_WIDTH = SCREEN_WIDTH;
this.SCREEN_HEIGHT = SCREEN_HEIGHT;
SetBoxes();
selected = -1;
hoveredOver = -1;
color = new Color(34, 167, 222, 50);
trashColor = Color.White;
inventorySelector = gameReference.Content.Load<Texture2D>("Inventory/InvSelect");
trashCan = gameReference.Content.Load<Texture2D>("Inventory/TrashCan");
nullImage = new Texture2D(gameReference.GraphicsDevice, 1,1);
nullImage.SetData(new[] { new Color(0,0,0,0) });
}
开发者ID:Tangent128,项目名称:PantheonPrototype,代码行数:27,代码来源:Inventory.cs
示例10: ProcessCreate
// Process a new item that is being created
// Extracts the intent based on ItemType and extends as FieldValue on Item
// return true to indicate to sub-classes that processing is complete
public virtual bool ProcessCreate(Item item)
{
var intent = ExtractIntent(item);
if (intent != null)
CreateIntentFieldValue(item, intent);
return false;
}
开发者ID:ogazitt,项目名称:zaplify,代码行数:10,代码来源:ItemProcessor.cs
示例11: getDropdown
public List<Item> getDropdown(string type)
{
List<Item> list = new List<Item>();
string dropdownFirst = "";
dropDownType review;
if (!Enum.TryParse(type, out review))
{
//throw bad enum parse
}
switch (review)
{
case dropDownType.PROVINCE:
list = getProvinces(dropDownType.PROVINCE);
dropdownFirst = "เลือกจังหวัด";
break;
case dropDownType.PROVINCEGOID:
list = getProvinces(dropDownType.PROVINCEGOID);
dropdownFirst = "เลือกจังหวัด";
break;
}
Item firstList = new Item();
firstList.value = "0";
firstList.name = "-- " + dropdownFirst + " --";
list.Insert(0, firstList);
return list;
}
开发者ID:tanikul,项目名称:Questionaire,代码行数:28,代码来源:QuestionService.svc.cs
示例12: ResurrectEntry
public ResurrectEntry( Mobile mobile, Item item ) : base( 6195, ResurrectRange )
{
m_Mobile = mobile;
m_Item = item;
Enabled = !m_Mobile.Alive;
}
开发者ID:nathanvy,项目名称:runuo,代码行数:7,代码来源:Ankhs.cs
示例13: IsEqual
public virtual bool IsEqual(Item item)
{
if (type != item.type) { return false; }
if (name.CompareTo(item.name) != 0) { return false; }
if (tradeAs != item.tradeAs) { return false; }
if (fullGround != item.fullGround) { return false; }
if (isAnimation != item.isAnimation) { return false; }
if (alwaysOnTop != item.alwaysOnTop) { return false; }
if (alwaysOnTopOrder != item.alwaysOnTopOrder) { return false; }
if (isUnpassable != item.isUnpassable) { return false; }
if (blockPathfinder != item.blockPathfinder) { return false; }
if (blockMissiles != item.blockMissiles) { return false; }
if (groundSpeed != item.groundSpeed) { return false; }
if (hasElevation != item.hasElevation) { return false; }
if (multiUse != item.multiUse) { return false; }
if (isHangable != item.isHangable) { return false; }
if (isHorizontal != item.isHorizontal) { return false; }
if (isVertical != item.isVertical) { return false; }
if (isMoveable != item.isMoveable) { return false; }
if (isPickupable != item.isPickupable) { return false; }
if (isReadable != item.isReadable) { return false; }
if (isRotatable != item.isRotatable) { return false; }
if (isStackable != item.isStackable) { return false; }
if (lightColor != item.lightColor) { return false; }
if (lightLevel != item.lightLevel) { return false; }
if (ignoreLook != item.ignoreLook) { return false; }
if (maxReadChars != item.maxReadChars) { return false; }
if (maxReadWriteChars != item.maxReadWriteChars) { return false; }
if (minimapColor != item.minimapColor) { return false; }
return true;
}
开发者ID:CkyLua,项目名称:ItemEditor,代码行数:32,代码来源:Item.cs
示例14: GetItemPriceModel
/// <summary>
/// Gets the item price model.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="lowestPrice">The lowest price.</param>
/// <param name="tags">Additional tags for promotion evaluation</param>
/// <returns>price model</returns>
/// <exception cref="System.ArgumentNullException">item</exception>
public PriceModel GetItemPriceModel(Item item, Price lowestPrice, Hashtable tags)
{
if (item == null)
{
throw new ArgumentNullException("item");
}
if (lowestPrice == null)
{
return new PriceModel();
}
var price = lowestPrice.Sale ?? lowestPrice.List;
var discount = _client.GetItemDiscountPrice(item, lowestPrice, tags);
var priceModel = CreatePriceModel(price, price - discount, UserHelper.CustomerSession.Currency);
priceModel.ItemId = item.ItemId;
//If has any variations
/* performance too slow with this method, need to store value on indexing instead
if (CatalogHelper.CatalogClient.GetItemRelations(item.ItemId).Any())
{
priceModel.PriceTitle = "Starting from:".Localize();
}
* */
return priceModel;
}
开发者ID:karpinskiy,项目名称:vc-community,代码行数:33,代码来源:MarketingHelper.cs
示例15: Equip
//Equips the item you click
public static void Equip(Item item)
{
Item prevItem;
if(item.itemType == Item.ItemType.Armor)
{
if(CharacterWindow.itemHead == null)
{
CharacterWindow.itemHead = item;
}
else
{
prevItem = CharacterWindow.itemHead;
Inventory.AddItem(prevItem.itemID);
CharacterWindow.itemHead = item;
print ("" + CharacterWindow.itemHead.itemName);
}
}
if(item.itemType == Item.ItemType.Weapon)
{
if(CharacterWindow.itemWeapon == null)
{
CharacterWindow.itemWeapon = item;
}
else
{
prevItem = CharacterWindow.itemWeapon;
Inventory.AddItem(prevItem.itemID);
CharacterWindow.itemWeapon = item;
print ("" + CharacterWindow.itemWeapon.itemName);
}
}
}
开发者ID:reavel,项目名称:UnityGame,代码行数:33,代码来源:Equiping.cs
示例16: ItemsToFileJSon
private List<Item> ItemsToFileJSon(JsonData sourceData)
{
int LengthData = sourceData.Count;
List<Item> itemsToGetted = new List<Item>();
for (int i = 0; i < LengthData; i++)
{
Item itemGettedTmp = new Item()
{
Id = (int)sourceData[i]["Id"],
Name = sourceData[i]["Name"].ToString(),
Description = sourceData[i]["Description"].ToString(),
Intensity = (int)sourceData[i]["Intensity"],
TypeItem = (e_itemType)((int)sourceData[i]["Type"]),
ElementTarget = (e_element)((int)sourceData[i]["Element"]),
LevelRarity = (e_itemRarity)((int)sourceData[i]["Rarity"]),
IsStackable = (bool)sourceData[i]["Stackable"],
Sprite = Item.AssignResources(sourceData[i]["Sprite"].ToString())
};
itemsToGetted.Add(itemGettedTmp);
}
return itemsToGetted;
}
开发者ID:noctisyounis,项目名称:Playground2015_Project3,代码行数:25,代码来源:ItemManager.cs
示例17: UserItem
internal UserItem(uint Id, uint BaseItem, string ExtraData, uint Group, string SongCode)
{
this.Id = Id;
this.BaseItem = BaseItem;
this.ExtraData = ExtraData;
this.mBaseItem = this.GetBaseItem();
this.GroupId = Group;
using (IQueryAdapter queryreactor = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
{
queryreactor.setQuery("SELECT * FROM items_limited WHERE item_id=" + Id + " LIMIT 1");
DataRow row = queryreactor.getRow();
if (row != null)
{
this.LimitedNo = int.Parse(row[1].ToString());
this.LimitedTot = int.Parse(row[2].ToString());
}
else
{
this.LimitedNo = 0;
this.LimitedTot = 0;
}
}
this.isWallItem = (this.mBaseItem.Type == 'i');
this.SongCode = SongCode;
}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:25,代码来源:UserItem.cs
示例18: OnDrop
void OnDrop(GameObject go)
{
var item = go.GetComponent<Item>();
if (item == null || go.transform.parent.name == "Holder")
{
// We dragged non-item GameObject or non-dragged item
return;
}
// If we want to add or replace current Item
if (currentItem != item)
{
// Replacing current item with new
if (currentItem != null)
{
// Restore old hierarchy
currentItem.transform.SetParent(currentItem.Parent);
// Reset old position if possible
if (currentItem.Parent != null)
{
var grid = currentItem.Parent.GetComponent<UIGrid>();
grid.Reposition();
}
}
currentItem = item;
}
}
开发者ID:ggappleid,项目名称:TestTask,代码行数:30,代码来源:SelectedItem.cs
示例19: btnTesteInsercao_Click
protected void btnTesteInsercao_Click(object sender, EventArgs e)
{
//Simula a recepção dos objetos Colecao que serão associados ao novo Item
ColecaoControler cCol = new ColecaoControler();
Colecao c1 = cCol.ObterColecao(1);
Colecao c2 = cCol.ObterColecao(2);
//Cria o novo Item
ItemControler cItem = new ItemControler();
Item item = new Item
{
Nome = "Nome do novo item",
Descricao = "Descrição do novo item",
QtdVisualizacoes = 1,
DataCasdastro = DateTime.Now
};
//Associa as coleções ao item
item.Colecoes.Add(c1);
item.Colecoes.Add(c2);
//Tenta gravar no BD
if (cItem.Gravar(item) > 0)
ltMensagem.Text = "OK";
else
ltMensagem.Text = "Erro";
}
开发者ID:MoraesGil,项目名称:TERMO-5-2014,代码行数:26,代码来源:Default.aspx.cs
示例20: StoneGump
public StoneGump(Mobile from, Item deed)
:base(20, 15)
{
m_Mobile = from;
m_Deed = deed;
Closable = true;
Disposable = true;
Dragable = true;
Resizable = false;
AddPage(0);
AddBackground( 0, 0, 300, 400, 3000 );
AddBackground( 8, 8, 284, 384, 5120 );
AddLabel( 40, 12, 37, "PICK YOUR REWARD FOR VOTING!" );
AddButton(74, 111, 4023, 4024, 1, GumpButtonType.Reply, 0); //Shroud
AddButton(74, 140, 4023, 4024, 2, GumpButtonType.Reply, 1); //Earrings
AddButton(74, 169, 4023, 4024, 3, GumpButtonType.Reply, 2); //Sandals
AddButton(74, 198, 4023, 4024, 4, GumpButtonType.Reply, 3); //Sandals
AddButton( 12, 360, 4005, 4007, 0, GumpButtonType.Reply, 0 );
AddLabel( 52, 360, 37, "Close" );
AddLabel(113, 111, 0, @"Vote Shroud");
AddLabel(113, 140, 0, @"Vote Earrings");
AddLabel(113, 169, 0, @"Vote Sandals");
AddLabel(113, 198, 0, @"Vote Half Apron");
}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:25,代码来源:VoteStoneGump.cs
注:本文中的Item类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论