Ejemplo n.º 1
0
        /// <summary>
        /// Returns box counts
        /// </summary>
        /// <param name="states"></param>
        /// <returns></returns>
        public int?this[BoxState states]
        {
            get
            {
                var results = new List <int?>(INDEX_STATE_MAX);
                if (states.HasFlag(BoxState.Cancelled))
                {
                    results.Add(_counts[INDEX_STATE_CANCELLED]);
                }
                if (states.HasFlag(BoxState.InProgress))
                {
                    results.Add(_counts[INDEX_STATE_UNVERIFIED]);
                }
                if (states.HasFlag(BoxState.Completed))
                {
                    results.Add(_counts[INDEX_STATE_VERIFIED]);
                }
                if (states.HasFlag(BoxState.NotStarted))
                {
                    results.Add(_counts[INDEX_STATE_NOTSTARTED]);
                }
                return(results.Sum());
            }
            set
            {
                switch (states)
                {
                case BoxState.Completed:
                    _counts[INDEX_STATE_VERIFIED] = value;
                    break;

                case BoxState.Cancelled:
                    _counts[INDEX_STATE_CANCELLED] = value;
                    break;

                case BoxState.InProgress:
                    _counts[INDEX_STATE_UNVERIFIED] = value;
                    break;

                case BoxState.NotStarted:
                    _counts[INDEX_STATE_NOTSTARTED] = value;
                    break;

                default:
                    throw new NotSupportedException(states.ToString());
                }
            }
        }
Ejemplo n.º 2
0
    public void Play(BoxState state, LocalSave.TimeBoxType type)
    {
        string str  = state.ToString();
        string str2 = string.Empty;

        if (type == LocalSave.TimeBoxType.BoxChoose_DiamondNormal)
        {
            str2 = "eNormal";
            this.Image_Down.set_sprite(SpriteManager.GetUICommon("UICommon_Box02_Down"));
        }
        else if (type == LocalSave.TimeBoxType.BoxChoose_DiamondLarge)
        {
            str2 = "eLarge";
            this.Image_Down.set_sprite(SpriteManager.GetUICommon("UICommon_Box01_Down"));
        }
        object[] args      = new object[] { str, str2 };
        string   stateName = Utils.FormatString("{0}_{1}", args);

        this.Ani_Box.Play(stateName);
    }