少年修仙传客户端基础资源
leonard Wu
2018-08-02 cc7db021dd09248131ad546f5bc5806cdb2eb418
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
 
namespace UnityEditor.XCodeEditor
{
    public class PBXList : ArrayList
    {
        public PBXList()
        {
            
        }
        
        public PBXList( object firstValue )
        {
            this.Add( firstValue );
        }
    
        /// <summary>
        /// This allows us to use the form:
        /// "if (x)" or "if (!x)"
        /// </summary>
        public static implicit operator bool( PBXList x ) {
            //if null or empty, treat us as false/null
            return (x == null) ? false : (x.Count == 0);
        }
 
        /// <summary>
        /// I find this handy. return our fields as comma-separated values
        /// </summary>
        public string ToCSV() {
        // TODO use a char sep argument to allow specifying separator
            string ret = string.Empty;
            foreach (string item in this) {
                ret += "\"";
                ret += item;
                ret += "\", ";
            }
            return ret;
        }
 
        /// <summary>
        /// Concatenate and format so appears as "{,,,}"
        /// </summary>
        public override string ToString() {
            return "{" + this.ToCSV() + "} ";
        }
    }
}