/// <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);
     }
 }
Ejemplo n.º 2
0
 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!!!");
     }
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
        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;
            }
        }
Ejemplo n.º 5
0
 public BombSprite(IItems item, Texture2D texture)
 {
     this.texture         = texture;
     this.item            = item;
     this.bombDestWidth  *= item.Size;
     this.bombDestHeight *= item.Size;
 }
Ejemplo n.º 6
0
        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();
            }
        }
Ejemplo n.º 7
0
        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;
            }
        }
Ejemplo n.º 8
0
 public ArrowSprite(IItems item, Texture2D texture)
 {
     this.texture          = texture;
     this.item             = item;
     this.arrowDestWidth  *= item.Size;
     this.arrowDestHeight *= item.Size;
 }
Ejemplo n.º 9
0
        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);
            }
        }
Ejemplo n.º 10
0
        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.");
                }
            }
        }
Ejemplo n.º 11
0
 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");
         }
     }
 }
Ejemplo n.º 12
0
 public MapSprite(IItems item, Texture2D texture)
 {
     this.texture        = texture;
     this.item           = item;
     this.MapDestWidth  *= item.Size;
     this.MapDestHeight *= item.Size;
 }
Ejemplo n.º 13
0
 public BoomerangSprite(IItems item, Texture2D texture)
 {
     this.texture              = texture;
     this.item                 = item;
     this.BoomerangDestWidth  *= item.Size;
     this.BoomerangDestHeight *= item.Size;
 }
Ejemplo n.º 14
0
 public SwordSprite(IItems item, Texture2D texture)
 {
     this.texture          = texture;
     this.item             = item;
     this.SwordDestWidth  *= item.Size;
     this.SwordDestHeight *= item.Size;
 }
Ejemplo n.º 15
0
        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);
            }
        }
Ejemplo n.º 16
0
 public HeartSprite(IItems item, Texture2D texture)
 {
     this.texture          = texture;
     this.item             = item;
     this.HeartDestWidth  *= item.Size;
     this.HeartDestHeight *= item.Size;
 }
Ejemplo n.º 17
0
 public ClockSprite(IItems item, Texture2D texture)
 {
     this.texture          = texture;
     this.item             = item;
     this.ClockDestWidth  *= item.Size;
     this.ClockDestHeight *= item.Size;
 }
Ejemplo n.º 18
0
 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);
     }
 }
Ejemplo n.º 20
0
 public override bool CanStep(IItems item)
 {
     if (item is FireItem)
     {
         return(true);
     }
     return(base.CanStep(item));
 }
Ejemplo n.º 21
0
 public ComboBox()
 {
     data = new Items();
     ElementName = "comboBox";
     Id = new ElementId();
     imageVisible = false;
     maxLength = 7;
     comboBoxSize = maxLength;
 }
Ejemplo n.º 22
0
 public DropDow()
 {
     data = new Items();
     ElementName = "dropDown";
     Id = new ElementId();
     controls = new Controls();
     imageVisible = false;
     dropDownSize = 7;
 }
Ejemplo n.º 23
0
 public ComboBox()
 {
     data         = new Items();
     ElementName  = "comboBox";
     Id           = new ElementId();
     imageVisible = false;
     maxLength    = 7;
     comboBoxSize = maxLength;
 }
Ejemplo n.º 24
0
 public DropDow()
 {
     data         = new Items();
     ElementName  = "dropDown";
     Id           = new ElementId();
     controls     = new Controls();
     imageVisible = false;
     dropDownSize = 7;
 }
Ejemplo n.º 25
0
        /// <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());
        }
Ejemplo n.º 26
0
 public void AgregarObjetos(IItems item)
 {
     if (item.EsMagico)
     {
         listaItemsMagicos.Add(item);
     }
     else
     {
         listaItemsNoMagicos.Add(item);
     }
 }
Ejemplo n.º 27
0
        /// <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);
        }
Ejemplo n.º 28
0
        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);
                }
            }
        }
Ejemplo n.º 29
0
 /// <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}");
     }
 }
Ejemplo n.º 30
0
 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;
 }
Ejemplo n.º 31
0
 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;
 }
Ejemplo n.º 32
0
 //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");
     }
 }
Ejemplo n.º 33
0
 public RealSpaceEngineers(
     IObserver observer,
     ICharacterController controller,
     ISessionController sessionController,
     IItems items,
     IDefinitions definitions
     )
 {
     Observer    = observer;
     Character   = controller;
     Session     = sessionController;
     Items       = items;
     Definitions = definitions;
 }
Ejemplo n.º 34
0
        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);
     }
 }
Ejemplo n.º 36
0
        /// <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();
        }