public void ModifyLocalCollisionMap(bool Active)
    {
        for (int iX = 0; iX < mAsset.mWidth * 2; ++iX)
        {
            for (int iY = 0; iY < mAsset.mLength * 2; ++iY)
            {
                IntVec2        worldTile = CItem.GetWorldCollisionTile(iX, iY, mPosition, mRotation);
                CCollisionTile tile      = mWorld.mMap.mLocalCollisionTiles[mPlayerID][worldTile.X, worldTile.Y];

                if (Active)
                {
                    tile.mOccupied = mID;
                    tile.mSolid    = mAsset.mTiles[iX, iY].mSolid;
                }
                else
                {
                    tile.mOccupied = 0;
                    tile.mSolid    = false;
                }
            }
        }

        Rect mr = new Rect(mBounds.min.x * 2.0f, mBounds.min.z * 2.0f, mBounds.size.x * 2.0f, mBounds.size.z * 2.0f);

        mWorld.mMap.CollisionModified(mPlayerID, mr);
    }
Beispiel #2
0
        public List <CItem> Format(string input)
        {
            var items           = new List <CItem>();
            var regex           = new Regex(@"{""c"":( |)""(?<c>.+?)"",( |)""m"":( |)""(?<m>.+?)""}", RegexOptions.Singleline);
            var matchCollection = regex.Matches(input);

            foreach (Match m in matchCollection)
            {
                var item = new CItem();

                string c  = m.Groups["c"].Value;
                var    cs = c.Split(',');
                item.Time      = float.Parse(cs[0]);
                item.Color     = int.Parse(cs[1]);
                item.Mode      = int.Parse(cs[2]);
                item.Size      = int.Parse(cs[3]);
                item.UID       = 0;
                item.Timestamp = float.Parse(cs[5]);

                //转换unicode
                item.Message = Convert(m.Groups["m"].Value);
                //修复最后一个特殊弹幕出错
                if (item.Message.StartsWith("{") && !item.Message.EndsWith("}"))
                {
                    item.Message += "\"}";
                }

                items.Add(item);
            }
            return(items);
        }
Beispiel #3
0
        public ActionResult Import(int dataType = 0, string content = "")
        {
            if (string.IsNullOrEmpty(content))
            {
                return(View());
            }
            var   arry = content.Split('\r');
            CItem last = null;
            var   list = new List <Department>();

            foreach (var s in arry)
            {
                string name    = s.TrimEnd();
                int    length  = name.Length;
                int    length2 = name.Replace("\t", "").Length;
                int    level   = length - length2;
                CItem  c       = new CItem()
                {
                    Level = level, Name = name, Pre = last
                };
                last = c;
                Department Department = new Department();
                Department.DataType     = dataType;
                Department.Name         = name.Trim();
                Department.SequenceCode = c.Code;
                Department.ParentCode   = Department.SequenceCode.Substring(0, Department.SequenceCode.Length - 2);
                list.Add(Department);
            }
            CRL.Package.RoleAuthorize.DepartmentBusiness.Instance.BatchInsert(list);
            return(AutoBackResult("导入成功"));
        }
Beispiel #4
0
    private void loadEnemies(int aLevel)
    {
        ///Cargo el Niveles
        if (aLevel == 1)
        {
            CScorpion s = new CScorpion(CScorpion.TYPE_DONT_FALL);
            s.setXY(550, 300);
            CEnemyManager.inst().add(s);

            CItem item = new CItem(CItem.TYPE_DONT_FALL);
            item.setXY(700, 300);
            CItemManager.inst().add(item);

            CCoin coin = new CCoin(CCoin.TYPE_FALL);
            coin.setXY(800, 200);
            CItemManager.inst().add(coin);
        }
        else if (aLevel == 2)
        {
            CScorpion s = new CScorpion(CScorpion.TYPE_FALL);
            s.setXY(700, 300);
            CEnemyManager.inst().add(s);

            CItem item = new CItem(CItem.TYPE_DONT_FALL);
            item.setXY(400, 300);
            CItemManager.inst().add(item);

            CCoin coin = new CCoin(CCoin.TYPE_FALL);
            coin.setXY(550, 200);
            CItemManager.inst().add(coin);
        }
    }
Beispiel #5
0
 public void SetPickItem(int identity)
 {
     render.sprite       = CItemDataBase.spriteList[identity];
     shadowRender.sprite = CItemDataBase.spriteList[identity];
     id   = identity;
     item = CItemDataBase.items[id];
 }
Beispiel #6
0
    void ItemDataLoad()
    {
        itemList = new Dictionary <ITEM_TYPE, List <CItem> >();
        TextAsset textAsset = (TextAsset)Resources.Load("Json/ItemStat", typeof(TextAsset));

        Dictionary <string, List <CHealthItem> > tempItemHealth;

        tempItemHealth = JsonConvert.DeserializeObject <Dictionary <string, List <CHealthItem> > >(textAsset.text);

        List <CItem> tempItemData = new List <CItem>();


        for (int i = 0; i < tempItemHealth["HealthItem"].Count; ++i)
        {
            CItem temp = tempItemHealth["HealthItem"][i];
            tempItemData.Add(temp);
        }
        itemList.Add(ITEM_TYPE.Health, new List <CItem>(tempItemData));
        tempItemData.Clear();

        Dictionary <string, List <CHolyItem> > tempHolyItem;

        tempHolyItem = JsonConvert.DeserializeObject <Dictionary <string, List <CHolyItem> > >(textAsset.text);

        for (int i = 0; i < tempHolyItem["HolyItem"].Count; ++i)
        {
            CHolyItem temp = tempHolyItem["HolyItem"][i];
            tempItemData.Add(temp);
        }
        itemList.Add(ITEM_TYPE.Holy, new List <CItem>(tempItemData));
        tempHolyItem.Clear();


        Debug.Log(itemList[ITEM_TYPE.Health].Count);
    }
    IEnumerator MoveToPosition(CItem item, Vector3 targetPos)
    {
        if(item.Moving)
        {
            yield break;
        }

        item.Moving = true;

        Vector3 speed = (targetPos - item.Object.transform.localPosition) * 10;

        while(item.Object.transform.localPosition != targetPos)
        {
            Vector3 delta = speed * Time.deltaTime;

            if(Vector3.Distance(item.Object.transform.localPosition, targetPos) < Vector3.Distance(delta, Vector3.zero))
            {
                item.Object.transform.localPosition = targetPos;
            }
            else
            {
                item.Object.transform.localPosition += delta;
            }

            yield return null;
        }

        item.Object.GetComponent<ItemBehaviour>().SwitchTo(new Vector2(item.Colume, item.Row), targetPos);
        item.Moving = false;
    }
Beispiel #8
0
 public void OverAttack()
 {
     animator.SetBool("is_attack", false);
     animation_type = 0;
     inFuntionTime  = 0;
     invincible     = false;
     if (pickWeaponScript.UsingWeaponTillBroken())
     {
         weapon         = CItemDataBase.items[0];
         projectile_num = 0;
     }
     if (test)
     {
         tutorialRequest.DoneAttack();
     }
     Debug.Log("OverAttack");
     if (!p1charaType)
     {
         p1moveAble = true;
     }
     else
     {
         p2moveAble = true;
     }
     K_JoyY = 0;
     K_JoyX = 0;
 }
 // Use this for initialization
 void Start()
 {
     // アイテム数を設定する
     CItem.SetCount(ITEM_MAX);
     for (int i = 0; i < ITEM_MAX; i++)
     {
         // 出現座標
         Vector3 pos = new Vector3(
             Random.Range(-spawnX, spawnX),
             Random.Range(-spawnY, spawnY) + Camera.main.transform.position.y,
             0f);
         // 出現(prefItemを、posの場所に、回転させずに登場)
         Instantiate(prefItem, pos, Quaternion.identity);
     }
     for (int i = 0; i < ENEMY_MAX; i++)
     {
         // 出現座標
         Vector3 pos = new Vector3(
             Random.Range(-spawnX, spawnX),
             Random.Range(-spawnY, spawnY) + Camera.main.transform.position.y,
             0f);
         // 出現(prefItemを、posの場所に、回転させずに登場)
         Instantiate(prefEnemy, pos, Quaternion.identity);
     }
 }
Beispiel #10
0
    private void loadItem(CAssess assess)
    {
        if (dvAssessItemStyles.Count > 0)
        {
            for (int i = 0; i < dvAssessItemStyles.Count; i++)
            {
                if (Convert.ToInt32(dvAssessItemStyles.Table.Rows[i]["ID_Assess"]) == assess.id)
                {
                    CItem item = new CItem();
                    item.id            = Convert.ToInt32(dvAssessItemStyles.Table.Rows[i]["ID_Item"]);
                    item.assess_id     = Convert.ToInt32(dvAssessItemStyles.Table.Rows[i]["ID_Assess"]);
                    item.name          = dvAssessItemStyles.Table.Rows[i]["ItemName"].ToString();
                    item.sqlSchemeName = dvAssessItemStyles.Table.Rows[i]["SchemeName"].ToString();
                    item.contents      = new List <CContent>();

                    loadContent(item);

                    if (dvAssessItemStyles.Table.Rows[i]["ID_Group"].ToString() != "")
                    {
                        int id_group = Convert.ToInt32(dvAssessItemStyles.Table.Rows[i]["ID_Group"]);
                        loadGroup(item, id_group);
                    }

                    assess.items.Add(item);
                    items.Add(item);
                }
            }
        }
    }
Beispiel #11
0
 public EditItemForm(ref CPersonManager _personManager)
 {
     InitializeComponent();
     personManager = _personManager;
     editedItem    = new CItem();
     fillUIComponents();
 }
Beispiel #12
0
 public EditItemForm(ref CPersonManager _personManager)
 {
     InitializeComponent();
     personManager = _personManager;
     editedItem = new CItem();
     fillUIComponents();
 }
Beispiel #13
0
    /// <summary>
    /// Construct the item in the build order.
    /// </summary>
    public void BuildItem()
    {
        // TODO: Need to check if item can be built at this spot

        CItem blueprint = mWorld.GetEntity <CItem>(mOrder.mItemBlueprintID);

        blueprint.UpdatePlaceability();
        if (blueprint.mPlaceable)
        {
            Vector3 pos = CItem.CalculateBounds(blueprint.mPosition, blueprint.mItemRot, blueprint.mAsset.mWidth, blueprint.mAsset.mLength).center;
            pos.y = 0.0f;
            mWorld.AddTransientEventFOW(new Vector2(pos.x, pos.z)).SetEffect(pos);

            mWorld.PromoteBlueprintToItem(blueprint);

            // Dispose of the carried pickup.
            mWorld.DespawnEntity(mCarryingPickup);
            mCarryingPickup = null;
        }
        else
        {
            mWorld.DespawnEntity(blueprint);
            DropPickup();
        }

        // Tell order we are done with it.
        mOrder.OnCompleted();
        mOrder = null;
        //AdjustStamina(-CGame.Datastore.mGame.mBuildStamina);
    }
Beispiel #14
0
    void onEquipClick(UnityEngine.GameObject item)
    {
        for (int j = 0; j < m_nEquipments; j++)
        {
            if (item == m_Equips[j])
            {
                CHeroEntity pHero = CFightTeamMgr.Instance.m_pBattleHero;
                if (pHero == null)
                {
                    return;
                }

                CItem pItem = pHero.m_pEquipment.GetPos((Int16)j);
                if (pItem == null)
                {
                    return;
                }

                object[] _param = new object[3];
                _param[0] = j;
                _param[1] = 2;
                _param[2] = false;

                if (mShowEquip == null)
                {
                    return;
                }

                mCharacterEquip.gameObject.SetActive(false);
                mShowEquip.gameObject.SetActive(true);

                mShowEquip.SendMessage("OnOpenEquipShow", _param, SendMessageOptions.DontRequireReceiver);
            }
        }
    }
        /// <summary>
        /// 每10s进行以此trace
        /// </summary>
        /// <returns></returns>
        public async void SetTrackingLog(User user)
        {
            var list = _events.ToArray();

            _events.Clear();
            //转化

            var g = new G
            {
                PageId       = null,
                MasterUpdate = user.MasterUpdate,
                Token        = user.Token,
                SessionId    = user.SessionId,
                Version      = JpUtil.APP_VERSION
            };
            var body = new RequestBody {
                G = g
            };
            var c = new CItem
            {
                Method = Methods.SetTrackingLog,
                Option = list
            };
            var items = new List <CItem> {
                c
            };
            var cc = new Dictionary <string, object> {
                { "Management", items }
            };

            body.C = cc;
            var res = await ApiRequest(user, body);
        }
Beispiel #16
0
    /// ---------------------------------------------------------------------------
    /// <summary>
    /// 单击某个道具
    /// </summary>
    /// --------------------------------------------------------------------------
    void onItemClick(UnityEngine.GameObject item)
    {
        for (int i = 0; i < m_row; i++)
        {
            for (int j = 0; j < m_col; j++)
            {
                int idx = i * m_col + j;
                if (item == m_Items[idx])
                {
                    CItem pItem = CItemMgr.Inst.m_pPocket.GetPos((Int16)idx);
                    if (pItem == null)
                    {
                        return;
                    }

                    //if (ItemCreator.MIsEquipment(pItem.GetItemTypeID()))
                    //{
                    //    object[] _param = new object[3];
                    //    _param[0] = idx;
                    //    _param[1] = 1;
                    //    _param[2] = true;

                    //    if (mShowEquip == null)
                    //        return;

                    //    mCharacterEquip.gameObject.SetActive(false);
                    //    mShowEquip.gameObject.SetActive(true);
                    //    mShowEquip.SendMessage("OnOpenEquipShow", _param, SendMessageOptions.DontRequireReceiver);
                    //}
                }
            }
        }
    }
Beispiel #17
0
        public bool MoveItem(CItem item, Inventory inventory, ushort x, ushort y)
        {
            if (ReferenceEquals(item, null))
            {
                return(false);
            }

            if (!IsInThisInventory(item))
            {
                return(false);
            }

            if (ReferenceEquals(inventory, null))
            {
                return(false);
            }

            if (!inventory.IsPositionInInventory(x, y))
            {
                return(false);
            }

            if (inventory.IsSlotOccupied(x, y))
            {
                return(false);
            }

            TakeItem(item, true);
            inventory.GiveItem(item, x, y);

            return(true);
        }
Beispiel #18
0
 private void addAssessItemStyle(CItem item, int ID_Assess, int ID_Group, string SchemeNameType)
 {
     try
     {
         SqlDataSource sds = new SqlDataSource();
         sds.ConnectionString  = connectionString;
         sds.InsertCommand     = "dbo.addAssessItemStyle";
         sds.InsertCommandType = SqlDataSourceCommandType.StoredProcedure;
         sds.InsertParameters.Add(new Parameter("ID_Assess", DbType.Int32, ID_Assess.ToString()));
         if (ID_Group != 0)
         {
             sds.InsertParameters.Add(new Parameter("ID_Group", DbType.Int32, ID_Group.ToString()));
         }
         else
         {
             sds.InsertParameters.Add(new Parameter("ID_Group", DbType.Int32, null));
         }
         sds.InsertParameters.Add(new Parameter("ItemName", DbType.String, item.name));
         sds.InsertParameters.Add(new Parameter("SchemeNameType", DbType.String, SchemeNameType));
         sds.Insert();
     }
     catch (Exception ex)
     {
         message = ex.Message;
     }
 }
Beispiel #19
0
        public bool MoveItem(CItem item, ushort x, ushort y)
        {
            if (!IsInThisInventory(item))
            {
                return(false);
            }

            if (ReferenceEquals(item, null))
            {
                return(false);
            }

            if (!IsPositionInInventory(x, y))
            {
                return(false);
            }

            if (IsSlotOccupied(x, y))
            {
                return(false);
            }

            item.position.x = x;
            item.position.y = y;
            return(true);
        }
Beispiel #20
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="item"></param>
        /// <returns></returns>
        public static bool GetFileInfo(string fileName, ref CItem item)
        {
            if (!System.IO.File.Exists(fileName))
            {
                return(false);
            }
            string     fullPath = System.IO.Path.GetFullPath(fileName);
            SHFILEINFO shinfo   = new SHFILEINFO();

            SHGetFileInfo(
                fullPath,
                (uint)FILE.ATTRIBUTE_NORMAL,
                ref shinfo,
                (uint)Marshal.SizeOf(shinfo),
                (uint)(SHGFI.ICON |
                       SHGFI.LARGEICON |
                       SHGFI.TYPENAME |
                       SHGFI.DISPLAYNAME)
                );
            item.image = Imaging.CreateBitmapSourceFromHIcon(
                shinfo.hIcon,
                new Int32Rect(0, 0, 32, 32),
                BitmapSizeOptions.FromEmptyOptions()
                );
            item.type = shinfo.szTypeName;
            item.name = shinfo.szDisplayName;
            return(true);
        }
Beispiel #21
0
    void FillItemIcon(UnityEngine.GameObject obj, CItem pItem)
    {
        if (obj != null)
        {
            Transform pIcon = obj.transform.Find("Icon");
            if (pIcon != null)
            {
                UIAtlas tu = Resources.Load("GameIcon", typeof(UIAtlas)) as UIAtlas;
                UnityEngine.GameObject ctrl = pIcon.gameObject;
                ctrl.GetComponent <UISprite>().atlas      = tu;
                ctrl.GetComponent <UISprite>().spriteName = pItem.m_pProto.strIcon;
            }

            Transform pNum = obj.transform.Find("num");
            if (pNum != null)
            {
                UnityEngine.GameObject ctrl = pNum.gameObject;

                if (pItem.GetItemNum() > 1)
                {
                    ctrl.GetComponent <UILabel>().text = pItem.GetItemNum().ToString();
                }
                else
                {
                    ctrl.GetComponent <UILabel>().text = "";
                }
            }
        }
    }
Beispiel #22
0
    void OnCrafting()
    {
        if (craftC == null)
        {
            return;
        }
        ChangeSlot(true, 0);
        craftA = craftC;
        picking_item.SetInFree();

        if (craftC.id > 0)
        {
            handle.sprite = CItemDataBase.spriteList[craftA.id];
            handling_item.GetComponent <CPickItem>().SetPickItem(craftA.id);
            //if (!craft_records[craftA.id])
            //{
            //    craft_records[craftA.id] = true;
            //    //craftMenu.UpdateMenuInfo(craftA.id);
            //}
            if (test)
            {
                tutorialRequest.DoneCraft();
            }
        }
        else
        {
            handle.sprite = CItemDataBase.spriteList[items.Length - 1];
            handling_item.GetComponent <CPickItem>().SetPickItem(items.Length - 1);
        }
        craftC = null;
    }
Beispiel #23
0
 void Start()
 {
     pickUsed               = GameObject.Find("PickItemSystem").GetComponent <CPickItemSystem>().usedPickItemList;
     playerWeaponImg        = transform.parent.Find("Weapon").GetChild(0).GetComponent <SpriteRenderer>();
     playerWeaponImg.sprite = weaponSprite[0];
     holdWeapon             = CItemDataBase.items[0];
 }
Beispiel #24
0
 public ActionResult Import(int dataType = 0, string content = "")
 {
     if (string.IsNullOrEmpty(content))
     {
         return View();
     }
     var arry = content.Split('\r');
     CItem last = null;
     var list = new List<Department>();
     foreach (var s in arry)
     {
         string name = s.TrimEnd();
         int length = name.Length;
         int length2 = name.Replace("\t", "").Length;
         int level = length - length2;
         CItem c = new CItem() { Level = level, Name = name, Pre = last };
         last = c;
         Department Department = new Department();
         Department.DataType = dataType;
         Department.Name = name.Trim();
         Department.SequenceCode = c.Code;
         Department.ParentCode = Department.SequenceCode.Substring(0, Department.SequenceCode.Length - 2);
         list.Add(Department);
     }
     CRL.Package.RoleAuthorize.DepartmentBusiness.Instance.BatchInsert(list);
     return AutoBackResult("导入成功");
 }
Beispiel #25
0
        // Lösche ein Item aus der DB.
        // Das geschieht einfach dadurch, das alle nachfolgenden Items nachgerutsch werden
        // Richtig gelöscht werden nur private Items. DB-Items werden nur gelöscht markiert
        public void DeleteItem(CItem Item)
        {
            // Suche das Item in der DB
            int i = GetItemIndex(Item);

            DeleteItem(i);
        }
Beispiel #26
0
    public bool MoveNext()
    {
        int rgelt;
        int pceltFetched;

        if (this.m_IEnumItem.Next(1, out rgelt, out pceltFetched) != 0)
        {
            return(false);
        }
        if (rgelt != 0)
        {
            this.m_Current = new CItem();
            CItem   citem  = this.m_Current;
            IPStore PStore = this.m_IPStore;
            int     num    = (int)this.m_KeyType;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            Guid& guidType = @this.m_TypeGuid;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            Guid&  guidSubType = @this.m_SubTypeGuid;
            IntPtr ptr         = new IntPtr(rgelt);
            string szItemName  = this.CopyString(ptr);
            citem.Init(PStore, (PST_KEY)num, guidType, guidSubType, szItemName);
            ptr = new IntPtr(rgelt);
            Marshal.FreeCoTaskMem(ptr);
        }
        return(true);
    }
Beispiel #27
0
        public bool GiveItem(CItem item, ushort?x, ushort?y)
        {
            if (!HasFreeSlot)
            {
                return(false);
            }

            ushort[] freeSlot;
            if (x.HasValue && y.HasValue)
            {
                freeSlot = new ushort[2] {
                    x.Value, y.Value
                }
            }
            ;
            else
            {
                freeSlot = FindFreeSlot();
            }

            item.position.x = freeSlot[0];
            item.position.y = freeSlot[1];
            items.Add(item);
            return(true);
        }
Beispiel #28
0
        private void OnPress(object Sender, ButtonPressedEventArgs args)
        {
            if (Context.IsWorldReady)
            {
                foreach (SButton btn in Config.Buttons)
                {
                    if (!Helper.Input.IsDown(btn))
                    {
                        return;
                    }
                }

                Item ToDecraft = Game1.player.CurrentItem;

                foreach (CraftableItem CItem in Items)
                {
                    if (CItem.Equal(ToDecraft))
                    {
                        Monitor.Log("Decrafting " + ToDecraft.DisplayName + " (id " + ToDecraft.ParentSheetIndex + ").", LogLevel.Debug);

                        Game1.player.removeItemFromInventory(ToDecraft);

                        foreach (Item ing in CItem.Ingradients)
                        {
                            Game1.player.addItemToInventory(ItemFromID(ing.ParentSheetIndex, ing.Stack * ToDecraft.Stack / CItem.Item.Stack));
                        }

                        return;
                    }
                }
            }
        }
        /// <summary>
        /// 自动登录
        /// </summary>
        /// <returns></returns>
        public async Task <HttpRes> AutoLogin(User user)
        {
            var g = new G
            {
                PageId       = "SLI_MR001",
                MasterUpdate = user.MasterUpdate,
                Token        = user.Token,
                SessionId    = user.SessionId,
                Version      = JpUtil.APP_VERSION
            };
            var body = new RequestBody {
                G = g
            };
            var cc = new Dictionary <string, object>();
            var c  = new CItem
            {
                Method = Methods.AutoLogin,
                Option = new JObject {
                    { "uuid", user.Uuid }
                }
            };
            var list = new List <CItem> {
                c
            };

            cc.Add("Auth", list);
            body.C = cc;
            return(await ApiRequest(user, body));
        }
Beispiel #30
0
    public void OnPointerDown(PointerEventData eventData)
    {
        if (item != null)
        {
            if (_selectedItem.item != null)
            {
                CItem itemClone = new CItem(_selectedItem.item);

                Debug.Log(gameObject.transform.parent.name + "  Current Item : " + item.title + "  " + "Selected Item : " + itemClone.title);

                _selectedItem.UpdateItem(item);
                UpdateItem(itemClone);
            }
            else
            {
                Debug.Log(gameObject.transform.parent.name + "  Current Item : " + item.title + " Selected Item : Nothing");

                _selectedItem.UpdateItem(item);
                UpdateItem(null);
            }
        }
        else if (_selectedItem.item != null)
        {
            Debug.Log(gameObject.transform.parent.name + "  Current Item : Nothing  Selected Item : " + _selectedItem.item.title);

            UpdateItem(_selectedItem.item);
            _selectedItem.UpdateItem(null);
        }
        else
        {
            Debug.Log(gameObject.transform.name + "No Items");
        }
    }
        /// <summary>
        /// 批量修改
        /// </summary>
        /// <param name="user"></param>
        /// <param name="beans"></param>
        /// <returns></returns>
        public async Task <HttpRes> SetItems(User user, SaleBean[] beans)
        {
            var g = new G
            {
                PageId       = "SEL_EX001",
                SessionId    = user.SessionId,
                MasterUpdate = user.MasterUpdate,
                Token        = user.Token,
                Version      = JpUtil.APP_VERSION
            };
            var body = new RequestBody {
                G = g
            };
            var cc   = new Dictionary <string, object>();
            var list = new List <CItem> {
            };

            foreach (var saleBean in beans)
            {
                var itm = new CItem
                {
                    Method = Methods.SetItem2,
                    Option = saleBean
                };
                list.Add(itm);
            }

            cc.Add("Sales", list);
            body.C = cc;
            return(await ApiRequest(user, body));
        }
Beispiel #32
0
        private void GetItemCode()
        {
            string  strItemCode = string.Empty;
            CItemBO oitembo     = new CItemBO();
            CResult oresult     = new CResult();

            oresult = oitembo.ReadAllByCond(ddlGroupNAme.SelectedValue.ToString());
            ArrayList oitemlist = (ArrayList)oresult.Data;

            int maxitemrow = oitemlist.Count;

            if (maxitemrow == 0)
            {
                strItemCode = ((CItemGroup)ddlGroupNAme.SelectedItem).Catg_Code.ToString() + "00001";
            }
            else
            {
                CItem oitem2 = (CItem)oitemlist[maxitemrow - 1];
                strItemCode = ((CItemGroup)ddlGroupNAme.SelectedItem).Catg_Code.Substring(0, 4);
                string strCode = "" + Convert.ToString(Convert.ToInt32(oitem2.Item_Code.Substring(4)) + 1);
                for (int j = 5; j > (strCode.Length); j--)
                {
                    strItemCode += "0";
                }
                strItemCode += strCode;
            }

            txtItemCode.Text = strItemCode;
        }
Beispiel #33
0
        public void UpdateItem(int index, CItem Item)
        {
            int TempPos = Unit.xml_config.GetSlotPosition(Unit.xml_config.arItemSlots[Item.Position].strPosClass);

            string sql = "update items set";

            sql = sql + " name = " + Utils.QuotedStr(Item.Name, '\'');
            sql = sql + ", nameoriginal = " + Utils.QuotedStr(Item.NameOriginal, '\'');
            sql = sql + ", origin = " + Utils.QuotedStr(Item.Origin, '\'');
            sql = sql + ", description = " + Utils.QuotedStr(Item.Description, '\'');
            sql = sql + ", onlineurl = " + Utils.QuotedStr(Item.OnlineURL, '\'');
            sql = sql + ", extension = " + Utils.QuotedStr(Item.Extension, '\'');
            sql = sql + ", provider = " + Utils.QuotedStr(Item.Provider, '\'');
            sql = sql + ", classrestrictions = " + Utils.QuotedStr(Item.GetClassRestrictionStr(), '\'');
            sql = sql + ", effects = " + Utils.QuotedStr(Item.GetEffectStr(), '\'');
            sql = sql + ", realm = " + (Item.Realm).ToString();
            sql = sql + ", position = " + (TempPos).ToString();
            sql = sql + ", type = " + ((int)Item.Type).ToString();
            sql = sql + ", level = " + (Item.Level).ToString();
            sql = sql + ", quality = " + (Item.Quality).ToString();
            sql = sql + ", bonus = " + (Item.Bonus).ToString();
            sql = sql + ", class = " + (Item.Class).ToString();
            sql = sql + ", subclass = " + (Item.SubClass).ToString();
            sql = sql + ", material = " + (Item.Material).ToString();
            sql = sql + ", af = " + (Item.AF).ToString();
            sql = sql + ", dps = " + (Item.DPS).ToString();
            sql = sql + ", speed = " + (Item.Speed).ToString();
            sql = sql + ", damagetype = " + (Item.DamageType).ToString();
            sql = sql + ", maxlevel = " + (Item.MaxLevel).ToString();
            sql = sql + ", lastupdate = " + (Utils.DateTimeToUnix(Item.LastUpdate)).ToString();
            sql = sql + " where id = " + (index).ToString();
            Unit.frmMain.ZQuery.CommandText = sql;
            Unit.frmMain.ZQuery.ExecuteNonQuery();
        }
Beispiel #34
0
 public EditItemForm(CItem _item, ref CPersonManager _personManager)
 {
     InitializeComponent();
     editedItem = _item;
     personManager = _personManager;
     opening = true;
     fillUIComponents();
     fillItemData();
     ((OpenFileDialog)(beImage.Dialog)).DefaultExt = ".jpg";
     ((OpenFileDialog)(beImage.Dialog)).Filter = "Картинки|*.jpg|Картинки|*.png";
 }
 void OnUnSetDragedObject(GameObject item)
 {
     m_dragedObject.Moving = false;
     m_dragedObject = null;
 }
Beispiel #36
0
 public CItem Clone()
 {
     var u = new CItem ();
     u.Photo = new PhotoInfo(this.Photo.farm, this.Photo.server, this.Photo.id, this.Photo.secret);
     this.ScalableColor.CopyTo (u.ScalableColor, 0);
     this.ColorLayout.CopyTo (u.ColorLayout, 0);
     this.ColorStructure.CopyTo (u.ColorStructure, 0);
     this.EdgeHistogram.CopyTo (u.EdgeHistogram, 0);
     this.HomogeneousTexture.CopyTo (u.HomogeneousTexture, 0);
     return u;
 }
Beispiel #37
0
 private static bool HasItem(CItem item)
 {
     return Item.HasItem(item.ID, myHero);
 }
Beispiel #38
0
 private static void Buy(CItem item)
 {
     Item itm = new Item(item.ID);
     itm.Buy();
 }
 void OnSetDragedObject(GameObject item, int colume, int row)
 {
     m_dragedObject 		= new CItem(item, colume, row, true);
     m_dragedStartPoint 	= item.transform.localPosition;
 }
Beispiel #40
0
 public CItem Parse(XPathDocument doc)
 {
     var docnav = doc.CreateNavigator ();
     docnav.MoveToFollowing ("photo", "");
     var item = new CItem (docnav);
     docnav.MoveToFollowing ("Mpeg7", "");
     docnav.MoveToFollowing ("Image", "");
     foreach (XPathNavigator nav in docnav.Select("*")) {
         var _type = nav.GetAttribute ("type", "");
         //Console.WriteLine("type: {0}", _type);
         //Console.WriteLine(nav.OuterXml);
         switch (_type) {
         case "ScalableColorType":
             PrimitiveIO<short>.LoadVector (nav.Value, item.ScalableColor, 0, item.ScalableColor.Length);
             break;
         case "ColorStructureType":
             PrimitiveIO<short>.LoadVector (nav.Value, item.ColorStructure, 0, item.ColorStructure.Length);
             break;
         case "ColorLayoutType":
             item.SetColorLayout (nav);
             break;
         case "EdgeHistogramType":
             PrimitiveIO<short>.LoadVector (nav.Value, item.EdgeHistogram, 0, item.EdgeHistogram.Length);
             break;
         case "HomogeneousTextureType":
             item.SetHomegeneousTexture (nav);
             break;
         default:
             throw new ArgumentException (String.Format("Unknown node type '{0}'"));
         }
     }
     return item;
 }