示例#1
0
 public MixedArrayItem(int v)
 {
     objects = new object[4];
     objects[0] = LinkedList.NewList(v);
     objects[1] = new TItem(v);
     objects[2] = LinkedList.NewList(v);
     objects[3] = new TItem(v);
 }
示例#2
0
 /// <summary>
 /// Get the text covered by the match item.
 /// </summary>
 /// <param name="item">Match item.</param>
 public string GetText(TItem item)
 {
     StringBuilder sb = new StringBuilder();
     if (item != null)
     {
         string input_string = item.InputEnumerable as string;
         if (input_string != null)
         {
             sb.Append(input_string.Substring(item.StartIndex, item.NextIndex - item.StartIndex));
         }
         else
         {
             foreach (char ch in item.Inputs)
                 sb.Append(ch);
         }
     }
     return sb.ToString();
 }
示例#3
0
文件: NTItem.cs 项目: masroore/db4o
 public NTItem(int value)
 {
     tItem = new TItem(value);
 }
示例#4
0
 public SyncActionData(int index, TItem item)
 {
     Index = index;
     Item  = item;
 }
示例#5
0
 protected virtual void CloseItemAsync(TItem item, TimeSpan timeout)
 {
     _parent.CloseItemAsync(item, timeout);
 }
    public GameObject AddBrickMan(BrickManDesc desc)
    {
        Vector3 position = new Vector3(0f, 11000f, 0f);

        if (freeInvisiblePositionQ.Count <= 0)
        {
            Debug.LogError("No more free Invisible Position ");
        }
        else
        {
            position = freeInvisiblePositionQ.Dequeue();
        }
        GameObject gameObject = Object.Instantiate((Object)brickMan, position, Quaternion.Euler(0f, 0f, 0f)) as GameObject;

        if (null == gameObject)
        {
            Debug.LogError("Fail to instantiate a brick man ");
            return(null);
        }
        PlayerProperty component = gameObject.GetComponent <PlayerProperty>();

        if (null == component)
        {
            Object.DestroyImmediate(gameObject);
            Debug.LogError("New brickman doesnt have PlayerProperty ");
            return(null);
        }
        component.Desc = desc;
        component.InvisiblePosition = position;
        TPController component2 = gameObject.GetComponent <TPController>();

        if (null == component2)
        {
            Object.DestroyImmediate(gameObject);
            Debug.LogError("New brickman doesnt have ThirdPersonController");
            return(null);
        }
        Camera camera = null;

        Camera[] componentsInChildren = gameObject.GetComponentsInChildren <Camera>();
        if (componentsInChildren != null)
        {
            string value = "Near";
            if (Application.loadedLevelName == "Result4Defense")
            {
                value = "Far";
            }
            int num = 0;
            while (camera == null && num < componentsInChildren.Length)
            {
                if (componentsInChildren[num].name.Contains(value))
                {
                    camera = componentsInChildren[num];
                }
                num++;
            }
        }
        if (null == camera)
        {
            Object.DestroyImmediate(gameObject);
            Debug.LogError(" New brickman doesnt have Overlay camera ");
            return(null);
        }
        if (freeOverlayQ.Count <= 0)
        {
            Debug.LogError("No more freeOverlay ");
        }
        camera.enabled       = true;
        camera.targetTexture = freeOverlayQ.Dequeue();
        Weapon.isInitialize  = true;
        LookCoordinator component3 = gameObject.GetComponent <LookCoordinator>();

        if (null == component3)
        {
            Object.DestroyImmediate(gameObject);
            Debug.LogError("New brickman doesnt have LookCoordinator");
            return(null);
        }
        component3.Init(mirror: false);
        for (int i = 0; i < desc.Equipment.Length; i++)
        {
            TItem tItem = TItemManager.Instance.Get <TItem>(desc.Equipment[i]);
            if (tItem != null)
            {
                string itemCode = desc.Equipment[i];
                if (tItem.type == TItem.TYPE.WEAPON)
                {
                    TWeapon tWeapon = (TWeapon)tItem;
                    int     num2    = 0;
                    while (desc.WpnChg != null && num2 < desc.WpnChg.Length)
                    {
                        TItem tItem2 = TItemManager.Instance.Get <TItem>(desc.WpnChg[num2]);
                        if (tItem2 != null && tItem2.type == TItem.TYPE.WEAPON)
                        {
                            TWeapon tWeapon2 = (TWeapon)tItem2;
                            if (tWeapon.slot == tWeapon2.slot)
                            {
                                itemCode = desc.WpnChg[num2];
                            }
                        }
                        num2++;
                    }
                    int num3 = 0;
                    while (desc.DrpItm != null && num3 < desc.DrpItm.Length)
                    {
                        TItem tItem3 = TItemManager.Instance.Get <TItem>(desc.DrpItm[num3]);
                        if (tItem3 != null && tItem3.type == TItem.TYPE.WEAPON)
                        {
                            TWeapon tWeapon3 = (TWeapon)tItem3;
                            if (tWeapon.slot == tWeapon3.slot)
                            {
                                itemCode = desc.DrpItm[num3];
                            }
                        }
                        num3++;
                    }
                }
                component3.Equip(itemCode);
            }
        }
        component3.ChangeWeapon(RoomManager.Instance.DefaultWeaponType);
        dicBrickMan.Add(desc.Seq, gameObject);
        Weapon.isInitialize = false;
        return(gameObject);
    }
示例#7
0
        public Using(TItem name)
        {
            this.Name = name;

            Items = new List<TItem> { name };
        }
示例#8
0
 public ItemBatch(TItem firstItem)
 {
     First = firstItem;
     Count = 1;
 }
 public SimpleNode(TItem data)
 {
     Data = data;
 }
示例#10
0
        public Rule(TItem name, AstNode body, string ovr)
        {
            this.Name = name;
            this.Body = body;
            this.Override = ovr;

            Items = new List<TItem> { name };
            Children = new List<AstNode> { body };
        }
 /// <summary>
 /// Initializes a new instance of the instance.
 /// </summary>
 /// <param name="item">The item that is affected by the change.</param>
 /// <param name="action">The action that caused the event.</param>
 public NotifyCollectionChangedSignal(TItem item, NotifyCollectionChangedAction action)
 {
     this.Item   = item;
     this.Action = action;
 }
 internal static async Task <(HttpStatusCode StatusCode, string eTag)> CreateItemViaStreamAsync <TItem>(this Container container, TItem item, bool retryOnNonFatalErrors, ItemRequestOptions itemRequestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) where TItem : ICosmosDocument
 public Node(TItem item, Node next)
 {
     this.item = item;
     this.next = next;
 }
示例#14
0
    private void DoItems()
    {
        uiImages.Draw();
        WiseSlot(crdSrcItem, srcItem);
        WiseSlot(crdAdditiveItem, additiveItem);
        if (!dstItemNoDraw)
        {
            WiseSlot(crdDstItem, dstItem);
        }
        GUI.Box(crdItemActionOutline, string.Empty, "LineBoxBlue");
        int  num    = 0;
        Item source = (srcItem == null) ? dstItem : srcItem;

        myItems = MyInfoManager.Instance.GetItemsCanMerge(source);
        int num2 = myItems.Length;
        int num3 = 5;
        int num4 = num2 / num3;

        if (num2 % num3 > 0)
        {
            num4++;
        }
        float num5 = crdItem.x * (float)num3;

        if (num3 > 1)
        {
            num5 += (float)((num3 - 1) * 2);
        }
        float num6 = crdItem.y * (float)num4;

        if (num4 > 0)
        {
            num6 -= yOffset;
        }
        scrollPositionShooterTool = GUI.BeginScrollView(viewRect: new Rect(0f, 0f, crdItemList.width - 20f, num6), position: crdItemList, scrollPosition: scrollPositionShooterTool, alwaysShowHorizontal: false, alwaysShowVertical: false);
        float y        = scrollPositionShooterTool.y;
        float num7     = y + crdItemList.height;
        Rect  position = new Rect(0f, 0f, crdItem.x, crdItem.y);

        num = 0;
        int num8 = 0;

        while (num < num2 && num8 < num4)
        {
            position.y = (float)num8 * crdItem.y;
            float y2    = position.y;
            float num9  = y2 + position.height;
            int   num10 = 0;
            while (num < num2 && num10 < num3)
            {
                if (num9 >= y && y2 <= num7)
                {
                    position.x = (float)num10 * (crdItem.x + 2f);
                    GUI.BeginGroup(position);
                    TItem tItem = TItemManager.Instance.Get <TItem>(myItems[num].Code);
                    if (tooltip.ItemSeq == myItems[num].Seq.ToString())
                    {
                        if (num10 < num3 - 2)
                        {
                            ltTooltip = new Vector2(rc.x + crdItemList.x + position.x + position.width, rc.y + crdItemList.y + position.y - y);
                        }
                        else
                        {
                            ltTooltip = new Vector2(rc.x + crdItemList.x + position.x - tooltip.size.x, rc.y + crdItemList.y + position.y - y);
                        }
                    }
                    string str = "BtnItem";
                    if (tItem.season == 2)
                    {
                        str = "BtnItem2";
                    }
                    if (GlobalVars.Instance.MyButton(crdItemBtn, new GUIContent(string.Empty, myItems[num].Seq.ToString()), str) && state != COMBINE_STATE.WAIT)
                    {
                        ResetCombineItem();
                        additiveItem = myItems[num];
                        state        = COMBINE_STATE.SELECT;
                        curItem      = num;
                        AutoFunctionManager.Instance.DeleteAllAutoFunction();
                    }
                    DrawItemIcon(crdIcon: new Rect(crdItemBtn.x + 4f, crdItemBtn.y + 14f, (float)(int)((double)tItem.CurIcon().width * 0.65), (float)(int)((double)tItem.CurIcon().height * 0.65)), item: myItems[num]);
                    Color color = GUI.color;
                    GUI.color = GlobalVars.Instance.txtMainColor;
                    GUI.Label(crdItemBtn, tItem.Name, "MiniLabel");
                    GUI.color = color;
                    ShowItemStatus(myItems[num]);
                    LabelUtil.TextOut(crdRemain, myItems[num].GetRemainString(), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.MiddleRight);
                    if (num == curItem)
                    {
                        GUI.Box(new Rect(crdItemBtn.x - 3f, crdItemBtn.y - 3f, crdItemBtn.width + 6f, crdItemBtn.height + 6f), string.Empty, "BtnItemF");
                    }
                    GUI.EndGroup();
                }
                num++;
                num10++;
            }
            num8++;
        }
        GUI.EndScrollView();
    }
示例#15
0
 /// <summary>
 /// Override to add item-specific details, such as ids of error-causing entities.
 /// This method is called under lock and has to be efficient and not create much data, for example:
 /// only add the first 20 ids to the batch and discard the rest etc.
 /// </summary>
 protected internal virtual void Add(TItem item)
 {
     Count++;
 }
示例#16
0
        public Bind(AstNode body, TItem varname)
        {
            this.Body = body;
            this.VarName = varname;

            Children = new List<AstNode> { body };
            Items = new List<TItem> { varname };
        }
示例#17
0
        public CallOrVar(TItem name)
        {
            this.Name = name;

            Items = new List<TItem> { name };
        }
示例#18
0
        public Act(AstNode body, TItem exp)
        {
            this.Body = body;
            this.Expression = exp;

            Children = new List<AstNode> { body };
            Items = new List<TItem> { exp };
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RatedItem"/> class.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="rating">The rating.</param>
 public RatedItem(TItem item, byte rating)
 {
     this.Item   = item;
     this.Rating = rating;
 }
示例#20
0
        public Grammar(TItem name, TItem tinput, TItem tresult, TItem baseclass, IEnumerable<AstNode> rules)
        {
            this.Name = name;
            this.TInput = tinput;
            this.TResult = tresult;
            this.Base = baseclass;
            this.Rules = rules.Cast<Rule>();

            Items = new List<TItem> { name, tinput, tresult, baseclass };
            Children = new List<AstNode>(rules);
        }
示例#21
0
 public abstract bool Return(TItem item);
示例#22
0
        public Call(TItem rule, IEnumerable<AstNode> parms)
        {
            this.Rule = rule;
            this.Params = parms;

            Items = new List<TItem> { rule };
        }
示例#23
0
 public ItemRecord(int index, TItem item, double priority)
 {
     Index    = index;
     Item     = item;
     Priority = priority;
 }
示例#24
0
 public abstract bool Add(TItem item);
示例#25
0
        public Idfr(TItem text)
        {
            this.Text = text;

            Items = new List<TItem> { text };
        }
示例#26
0
 protected virtual void AbortItem(TItem item)
 {
     _parent.AbortItem(item);
 }
示例#27
0
        public Idfr(TItem text, TItem gparams)
        {
            this.Text = text;
            this.GenericParams = gparams;

            Items = new List<TItem> { text, gparams };
        }
示例#28
0
 public override bool Return(TItem connection)
 {
     return(ReturnToPool(connection));
 }
示例#29
0
        public Code(TItem text)
        {
            this.Text = text;

            Items = new List<TItem> { text };
        }
示例#30
0
 protected override void AbortItem(TItem item)
 {
     _connections.OnItemClosing(item);
     base.AbortItem(item);
 }
示例#31
0
 public Regexp(TItem text)
 {
     this.Text = text;
     Items = new List<TItem> { text };
 }
示例#32
0
        public ClassRange(TItem item, IEnumerable<char> inputs)
        {
            this.Item = item;
            Items = new List<TItem> { item };

            this.Inputs = inputs;
        }
示例#33
0
    public override bool DoDialog()
    {
        bool result = false;

        TextureUtil.DrawTexture(new Rect(0f, 0f, (float)texUpgradeBG.width, (float)texUpgradeBG.height), texUpgradeBG);
        bubbleEffect.Draw();
        myUpgradeItems = MyInfoManager.Instance.GetItemsByCat(0, 7, 0);
        RemoveNotUseItem();
        DoDoctorText();
        DoEnergyTank();
        Vector2 pos = new Vector2(size.x / 2f, 15f);

        LabelUtil.TextOut(pos, StringMgr.Instance.Get("ITEM_UPGRADE").ToUpper(), "BigLabel", txtMainClr, GlobalVars.txtEmptyColor, TextAnchor.UpperCenter);
        TItem template = upgradee.Template;

        DoItem(crdPanelItem, upgradee);
        if (strErr.Length > 0)
        {
            float x = crdPanelUpgrade.x + crdPanelUpgrade.width / 2f - 90f;
            float y = crdPanelUpgrade.y + crdPanelUpgrade.height / 2f - 30f;
            GUI.Label(new Rect(x, y, 210f, 60f), strErr, "MiniLabel");
        }
        else if (curTier >= 0)
        {
            TextureUtil.DrawTexture(new Rect(734f, 143f, 90f, 90f), texQuestion, ScaleMode.StretchToFill);
        }
        else
        {
            UpgradeSelector((int)template.upgradeCategory);
        }
        if (bProgess)
        {
            if (upgradeState == UPGRADE_STATE.GAUGE_RISE)
            {
                GUI.enabled = false;
            }
            if (GlobalVars.Instance.MyButton(crdBtnUpgrade, string.Empty, "UpgradeCancel") || GlobalVars.Instance.IsEscapePressed())
            {
                GlobalVars.Instance.StopSound();
                AutoFunctionManager.Instance.DeleteAllAutoFunction();
                EffectEnd();
                bProgess = false;
                MessageBoxMgr.Instance.AddMessage(StringMgr.Instance.Get("ITEMUPGRADE_CANCELED"));
            }
            if (upgradeState == UPGRADE_STATE.GAUGE_RISE)
            {
                GUI.enabled = true;
            }
        }
        else
        {
            if (!IsEnableUpgradeButton() || upgradeState >= UPGRADE_STATE.WAIT)
            {
                GUI.enabled = false;
            }
            if (GlobalVars.Instance.MyButton(crdBtnUpgrade, string.Empty, "UpgradeStart") && CanUpgradeXpNLv())
            {
                StartUpgrade();
                bProgess = true;
            }
            if (!IsEnableUpgradeButton() || upgradeState >= UPGRADE_STATE.WAIT)
            {
                GUI.enabled = true;
            }
        }
        int num = myUpgradeItems.Length;

        if (num > 0)
        {
            int num2 = 4;
            int num3 = num / num2;
            if (num % num2 > 0)
            {
                num3++;
            }
            float num4 = crdItem.x * (float)num2;
            if (num2 > 1)
            {
                num4 += (float)((num2 - 1) * 2);
            }
            float num5 = crdItem.y * (float)num3;
            if (num3 > 1)
            {
                num5 += (float)((num3 - 1) * 4);
            }
            Rect position = new Rect(crdItemStart.x, crdItemStart.y, crdItem.x, crdItem.y);
            scrollPosition = GUI.BeginScrollView(viewRect: new Rect(crdItemStart.x, crdItemStart.y, crdItemSlotList.width - 20f, num5), position: crdItemSlotList, scrollPosition: scrollPosition, alwaysShowHorizontal: false, alwaysShowVertical: false);
            int num6 = 0;
            int num7 = 0;
            while (num6 < num && num7 < num3)
            {
                position.y = crdItemStart.y + (float)num7 * crdItem.y;
                int num8 = 0;
                while (num6 < num && num8 < num2)
                {
                    position.x = crdItemStart.x + (float)num8 * (crdItem.x + 2f);
                    GUI.BeginGroup(position);
                    TItem  template2 = myUpgradeItems[num6].Template;
                    string str       = "BtnItem";
                    if (template2.season == 2)
                    {
                        str = "BtnItem2";
                    }
                    if (GlobalVars.Instance.MyButton(crdItemBtn, new GUIContent(string.Empty, myUpgradeItems[num6].Seq.ToString()), str))
                    {
                        if (upgradeState == UPGRADE_STATE.NONE)
                        {
                            upgradeState = UPGRADE_STATE.SELECT;
                        }
                        strErr  = string.Empty;
                        curItem = num6;
                    }
                    if (tooltip.ItemSeq == myUpgradeItems[num6].Seq.ToString())
                    {
                        if (position.x < 400f)
                        {
                            ltTooltip = new Vector2(position.x + position.width + 5f, position.y);
                        }
                        else
                        {
                            ltTooltip = new Vector2(position.x - tooltip.size.x - 5f, position.y);
                        }
                    }
                    LabelUtil.TextOut(crdItemName, template2.Name, "MiniLabel", txtMainClr, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft);
                    DrawItemIcon(crdIcon: new Rect(crdItemBtn.x + 4f, crdItemBtn.y + 13f, (float)(int)((float)template2.CurIcon().width * 0.9f), (float)(int)((float)template2.CurIcon().height * 0.9f)), item: myUpgradeItems[num6]);
                    LabelUtil.TextOut(crdRemain, myUpgradeItems[num6].GetRemainString(), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleRight);
                    if (num6 == curItem)
                    {
                        TUpgrade tUpgrade = (TUpgrade)template2;
                        curTier = tUpgrade.tier;
                        GUI.Box(new Rect(crdItemBtn.x - 3f, crdItemBtn.y - 3f, crdItemBtn.width + 6f, crdItemBtn.height + 6f), string.Empty, "BtnItemF");
                        if (strErr == string.Empty)
                        {
                            strErr = CanUseUpgrader(tUpgrade);
                        }
                    }
                    GUI.EndGroup();
                    num6++;
                    num8++;
                }
                num7++;
            }
            GUI.EndScrollView();
        }
        else
        {
            float x2 = crdUpgradeItemListBg.x + crdUpgradeItemListBg.width / 2f;
            float y2 = crdUpgradeItemListBg.y + crdUpgradeItemListBg.height / 2f;
            LabelUtil.TextOut(new Vector2(x2, y2), StringMgr.Instance.Get("NOTHING_UPGRADER"), "BigLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter);
        }
        Rect rc = new Rect(size.x - 50f, 10f, 34f, 34f);

        if (GlobalVars.Instance.MyButton(rc, string.Empty, "BtnClose") || GlobalVars.Instance.IsEscapePressed())
        {
            bProgess = false;
            result   = true;
            GlobalVars.Instance.StopSound();
            GlobalVars.Instance.PlayOneShot(GlobalVars.Instance.sndButtonClick);
            AutoFunctionManager.Instance.DeleteAllAutoFunction();
        }
        DoTooltip(new Vector2(base.rc.x, base.rc.y));
        DoGagueEffect();
        if (!ContextMenuManager.Instance.IsPopup)
        {
            WindowUtil.EatEvent();
        }
        return(result);
    }