/// <summary> /// 品目の作成 /// </summary> /// <remarks> /// 指定した事業所の品目を作成する /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='parameters'> /// 品目の作成 /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ItemsCreateResponse> CreateAsync(this IItems operations, CreateItemParams parameters = default(CreateItemParams), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateWithHttpMessagesAsync(parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public void UnequipItem(IItems item) { if (item == null) { Console.WriteLine("Sorry. Item not found!!!"); } else { if (item is Weapon) { var weapon = (Weapon)item; this.EquippedWeapon = null; weapon.Equipped = false; } else if (item is Armor) { var armor = (Armor)item; this.EquippedArmor = null; armor.Equipped = false; } else if (item is Shield) { var shield = (Shield)item; this.EquippedShield = null; shield.Equipped = false; } Console.WriteLine($"{item.Name} Successfully Unequipped!!!"); } }
public ItemCompuesto(IItems item1, IItems item2) { Ataque = item1.Ataque + item2.Ataque; Defensa = item1.Defensa + item2.Defensa; Curacion = item1.Curacion + item2.Curacion; EsMagico = item1.EsMagico || item2.EsMagico; }
public NightmareEnemyItemCollisionResponse(INightmareEnemy n, IItems i, CollisionSide c, Game1 g) { Rectangle intersection = Rectangle.Intersect(n.Position, i.Position); switch (c) { case CollisionSide.Top: n.BounceY(-intersection.Height); if (!n.IsKilled) { n.Land(); } break; case CollisionSide.Left: n.TurnRight(); n.BounceX(intersection.Width); break; case CollisionSide.Right: n.BounceX(-intersection.Width); n.TurnLeft(); break; case CollisionSide.None: n.Fall(); break; } }
public BombSprite(IItems item, Texture2D texture) { this.texture = texture; this.item = item; this.bombDestWidth *= item.Size; this.bombDestHeight *= item.Size; }
private void MarioItemCollision() { IItems largestItem = null; int largestArea = 0; CollisionSide largestCollision = CollisionSide.None; bool isFalling = true; for (int i = 0; i < items.Count; i++) { IItems item = items[i]; Rectangle block = item.Position; Rectangle mario = g.Character.Position; CollisionSide type = CollisionDetector.Detect(mario, block); if (type != CollisionSide.None) { if (largestItem == null) { Rectangle intersectRect = Rectangle.Intersect(mario, block); largestItem = item; largestArea = intersectRect.Width * intersectRect.Height; largestCollision = type; } else { Rectangle testRect = Rectangle.Intersect(mario, block); if (largestArea < (testRect.Width * testRect.Height)) { largestItem = item; largestArea = testRect.Width * testRect.Height; largestCollision = type; } } } mario.Offset(0, 1); CollisionSide bound = CollisionDetector.Detect(mario, block); if (bound == CollisionSide.Top) { isFalling = false; if (item is TransitionPipeItem && g.Character.Movement.IsCrouching) { g.CurrentState = new HiddenLevelState(g, g.CurrentState, items); } } } if (largestItem != null) { new MarioItemCollisionResponse(g.Character, largestItem, largestCollision, items, objects, g); } if (isFalling) { g.Character.Movement.Fall(); } }
public ProjectileItemCollisionResponse(IProjectile p, IItems i, CollisionSide cs, List <IItems> items) { Rectangle intersection = Rectangle.Intersect(p.Position, i.Position); switch (cs) { case CollisionSide.Top: p.BounceY(-intersection.Height * 2); p.TurnY(); break; case CollisionSide.Bottom: p.BounceY(intersection.Height * 2); p.TurnY(); break; case CollisionSide.Left: p.BounceX(intersection.Width * 2); p.TurnX(); break; case CollisionSide.Right: p.BounceX(-intersection.Width * 2); p.TurnX(); break; } }
public ArrowSprite(IItems item, Texture2D texture) { this.texture = texture; this.item = item; this.arrowDestWidth *= item.Size; this.arrowDestHeight *= item.Size; }
private void EquipItem() { var userInput = ""; IItems itemToEquip = null; var items = (from item in Hero.ItemsBag where (item is Weapon && ((Weapon)item).Equipped == false) || (item is Armor && ((Armor)item).Equipped == false) || (item is Shield && ((Shield)item).Equipped == false) select item).ToList(); if (!items.Any()) { Console.WriteLine("Sorry. No item to equip!!!"); } else { foreach (var item in items) { Console.WriteLine(item.DisplayInfo()); } Console.Write("Please enter the Item's ID to equip: "); userInput = Console.ReadLine(); foreach (var item in items) { if (item.ID.ToLower() == userInput.ToLower()) { itemToEquip = item; } } Hero.EquipItem(itemToEquip); } }
public void SellItem(IItems item) { if (item == null) { Console.WriteLine("Sorry. Item not found!!!"); } else { var userInput = ""; Console.Write($"{item.Name} selling price is {Convert.ToInt32(item.Price * 0.75)} Golds. Are you sure you want to sell this item?[Type Y to sell item...]"); userInput = Console.ReadLine(); if (userInput == "Y" || userInput == "y") { var soldPrice = Convert.ToInt32(item.Price * 0.75); this.Golds += soldPrice; this.ItemsBag.Remove(item); Console.WriteLine($"Item sold. {soldPrice} golds received "); } else { Console.WriteLine($"Selling Item cancelled."); } } }
public void EquipItem(IItems item) { if (item == null) { Console.WriteLine("Sorry. Item not found!!!"); } else { if (item is Weapon && this.EquippedWeapon == null) { var weapon = (Weapon)item; this.EquippedWeapon = weapon; weapon.Equipped = true; Console.WriteLine($"{item.Name} Successfully Equipped!!!"); } else if (item is Armor && this.EquippedArmor == null) { var armor = (Armor)item; this.EquippedArmor = armor; armor.Equipped = true; Console.WriteLine($"{item.Name} Successfully Equipped!!!"); } else if (item is Shield && this.EquippedShield == null) { var shield = (Shield)item; this.EquippedShield = shield; shield.Equipped = true; Console.WriteLine($"{item.Name} Successfully Equipped!!!"); } else { Console.WriteLine("Equip Failed. You need to an Unequipped first"); } } }
public MapSprite(IItems item, Texture2D texture) { this.texture = texture; this.item = item; this.MapDestWidth *= item.Size; this.MapDestHeight *= item.Size; }
public BoomerangSprite(IItems item, Texture2D texture) { this.texture = texture; this.item = item; this.BoomerangDestWidth *= item.Size; this.BoomerangDestHeight *= item.Size; }
public SwordSprite(IItems item, Texture2D texture) { this.texture = texture; this.item = item; this.SwordDestWidth *= item.Size; this.SwordDestHeight *= item.Size; }
private void UnequipItem() { if (Hero.EquippedArmor == null && Hero.EquippedWeapon == null && Hero.EquippedShield == null) { Console.WriteLine("You are not equipped with any item!!!"); } else { var userInput = ""; IItems itemToUnequip = null; var equippedItems = (from item in Hero.ItemsBag where (item is Weapon && ((Weapon)item).Equipped == true) || (item is Armor && ((Armor)item).Equipped == true) || (item is Shield && ((Shield)item).Equipped == true) select item).ToList(); Console.WriteLine("Equipped Items"); foreach (var item in equippedItems) { Console.WriteLine(item.DisplayInfo()); } Console.Write("Please enter the Item's ID to unequip: "); userInput = Console.ReadLine(); foreach (var item in equippedItems) { if (item.ID.ToLower() == userInput.ToLower()) { itemToUnequip = item; } } Hero.UnequipItem(itemToUnequip); } }
public HeartSprite(IItems item, Texture2D texture) { this.texture = texture; this.item = item; this.HeartDestWidth *= item.Size; this.HeartDestHeight *= item.Size; }
public ClockSprite(IItems item, Texture2D texture) { this.texture = texture; this.item = item; this.ClockDestWidth *= item.Size; this.ClockDestHeight *= item.Size; }
public FlashingRupeeSprite(IItems item, Texture2D texture) { this.texture = texture; this.item = item; this.RupeeDestWidth *= item.Size; this.RupeeDestHeight *= item.Size; }
/// <summary> /// 品目一覧の取得 /// </summary> /// <remarks> /// 指定した事業所の品目一覧を取得する /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='companyId'> /// 事業所ID /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ItemsIndexResponse> ListAsync(this IItems operations, int companyId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(companyId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public override bool CanStep(IItems item) { if (item is FireItem) { return(true); } return(base.CanStep(item)); }
public ComboBox() { data = new Items(); ElementName = "comboBox"; Id = new ElementId(); imageVisible = false; maxLength = 7; comboBoxSize = maxLength; }
public DropDow() { data = new Items(); ElementName = "dropDown"; Id = new ElementId(); controls = new Controls(); imageVisible = false; dropDownSize = 7; }
public ComboBox() { data = new Items(); ElementName = "comboBox"; Id = new ElementId(); imageVisible = false; maxLength = 7; comboBoxSize = maxLength; }
public DropDow() { data = new Items(); ElementName = "dropDown"; Id = new ElementId(); controls = new Controls(); imageVisible = false; dropDownSize = 7; }
/// <summary> /// Create a new item /// </summary> /// <param name="sap">SAP connection</param> /// <param name="code">Item code</param> /// <param name="name">Item name</param> /// <returns>Retrieve new object key</returns> public string Create(SAPConnection sap, string code, string name) { IItems partner = sap.Company.GetBusinessObject(BoObjectTypes.oItems); partner.ItemCode = code; partner.ItemName = name; sap.CheckResponse(partner.Add()); return(sap.Company.GetNewObjectKey()); }
public void AgregarObjetos(IItems item) { if (item.EsMagico) { listaItemsMagicos.Add(item); } else { listaItemsNoMagicos.Add(item); } }
/// <summary> /// Delete SAP record if exist /// </summary> /// <param name="sap">SAP connection</param> /// <param name="key">Key to delete</param> /// <returns></returns> public bool Delete(SAPConnection sap, string key) { IItems partner = sap.Company.GetBusinessObject(BoObjectTypes.oItems); if (partner.GetByKey(key)) { sap.CheckResponse(partner.Remove()); return(true); } return(false); }
private void ItemUpdateAndRemoval(List <IItems> items, GameTime gt) { for (int i = 0; i < items.Count; i++) { IItems block = (IItems)items[i]; block.Update(gt); if (block.isUsed) { items.Remove(block); } } }
/// <summary> /// Implement this to create custom saving /// </summary> public virtual void Load() //ByDefault - JsonImplRead { if (File.Exists(path)) { using (System.IO.StreamReader file = new System.IO.StreamReader(path)) { string s = file.ReadToEnd(); items = JsonUtility.FromJson <IItems <T> >(s); } Debug.Log($"Success {path}"); } }
public GalleryUnsize() { data = new Items(); ElementName = "gallery"; Id = new ElementId(); controls = new Controls(); imageVisible = false; gallerySize = 7; itemHeight = 0; itemWidth = 0; rows = -1; cols = -1; }
public GalleryUnsize() { data = new Items(); ElementName = "gallery"; Id = new ElementId(); controls = new Controls(); imageVisible = false; gallerySize = 7; itemHeight = 0; itemWidth = 0; rows = -1; cols = -1; }
//custom adding of items to inventory with Name, Description, Damage, Attributes, and Durability public static void NuAdd(IItems Item) { if (nextSlot > maxInventory) { Console.WriteLine("Inventory is Full"); Console.WriteLine(); } else { Character.Inventory2.Add(Item); nextSlot++; Story.ColorChanger(ConsoleColor.Blue, $"{Item.Name} added to inventory"); } }
public RealSpaceEngineers( IObserver observer, ICharacterController controller, ISessionController sessionController, IItems items, IDefinitions definitions ) { Observer = observer; Character = controller; Session = sessionController; Items = items; Definitions = definitions; }
void XmppServices_OnParticipantsLoadedEvent(IItems items) { foreach (KeyValuePair<string,Jid> partisipant in items.JidList) { } }
private void CreateOrUpdateTask(GithubIssue issue, TaskItem outlookTaskItem, IItems items) { if (outlookTaskItem != null) { UpdateAdapter(issue, outlookTaskItem); } else using (var newItem = ((TaskItem)items.Add(OlItemType.olTaskItem)).WithComCleanupProxy()) { UpdateAdapter(issue, newItem); } }
/// <summary> /// Agrego las salas al treeview /// ejemplo: /// /// conference.santana (server) /// amigos(room) /// empleados(room) /// </summary> /// <param name="chatRooms"></param> void XmppServices_OnRoomsLoadedEvent(IItems chatRooms) { if (InvokeRequired) { BeginInvoke(new OnItemsLoadedHandler(XmppServices_OnRoomsLoadedEvent), new object[] { chatRooms }); return; } TreeNode serverNode = Util.GetNodeByName(treeGC.Nodes, chatRooms.Servername); foreach (KeyValuePair<string, Jid> item in chatRooms.JidList) { TreeNode n = new TreeNode(item.Key); n.Tag = item.Value; n.ImageIndex = n.SelectedImageIndex = Util.IMAGE_CHATROOM; serverNode.Nodes.Add(n); } serverNode.ExpandAll(); }