Esempio n. 1
0
        public List <string> LoadArchitecturesFromString(ArchitectureList architectures, string dataString)
        {
            List <string> errorMsg = new List <string>();

            char[]   separator = new char[] { ' ', '\n', '\r', '\t' };
            string[] strArray  = dataString.Split(separator, StringSplitOptions.RemoveEmptyEntries);
            this.Architectures.Clear();
            try
            {
                foreach (string str in strArray)
                {
                    Architecture gameObject = architectures.GetGameObject(int.Parse(str)) as Architecture;
                    if (gameObject != null)
                    {
                        this.AddArchitecture(gameObject);
                    }
                    else
                    {
                        errorMsg.Add("建筑ID" + str + "不存在");
                    }
                }
            }
            catch
            {
                errorMsg.Add("建筑列表应为半型空格分隔的建筑ID");
            }
            if (this.ArchitectureCount == 0)
            {
                errorMsg.Add("没有建筑");
            }
            return(errorMsg);
        }
Esempio n. 2
0
        public void LoadArchitectureFromString(ArchitectureList archs, string data)
        {
            char[]   separator = new char[] { ' ', '\n', '\r', '\t' };
            string[] strArray  = data.Split(separator, StringSplitOptions.RemoveEmptyEntries);

            this.architecture = new ArchitectureList();
            foreach (string i in strArray)
            {
                this.architecture.Add(archs.GetGameObject(int.Parse(i)) as Architecture);
            }
        }
Esempio n. 3
0
 public void LoadArchitecturesFromString(ArchitectureList architectures, string dataString)
 {
     char[]   separator = new char[] { ' ', '\n', '\r' };
     string[] strArray  = dataString.Split(separator, StringSplitOptions.RemoveEmptyEntries);
     this.Architectures.Clear();
     foreach (string str in strArray)
     {
         Architecture gameObject = architectures.GetGameObject(int.Parse(str)) as Architecture;
         if (gameObject != null)
         {
             this.AddArchitecture(gameObject);
         }
     }
 }
Esempio n. 4
0
 public void LoadArchitecturesFromString(ArchitectureList architectures, string dataString)
 {
     char[] separator = new char[] { ' ', '\n', '\r', '\t' };
     string[] strArray = dataString.Split(separator, StringSplitOptions.RemoveEmptyEntries);
     this.Architectures.Clear();
     foreach (string str in strArray)
     {
         Architecture gameObject = architectures.GetGameObject(int.Parse(str)) as Architecture;
         if (gameObject != null)
         {
             this.AddArchitecture(gameObject);
         }
     }
 }
Esempio n. 5
0
        public void LoadArchitectureFromString(ArchitectureList archs, string data)
        {
            char[] separator = new char[] { ' ', '\n', '\r' };
            string[] strArray = data.Split(separator, StringSplitOptions.RemoveEmptyEntries);

            this.architecture = new ArchitectureList();
            foreach (string i in strArray)
            {
                this.architecture.Add(archs.GetGameObject(int.Parse(i)) as Architecture);
            }
        }
Esempio n. 6
0
 public List<string> LoadArchitecturesFromString(ArchitectureList architectures, string dataString)
 {
     List<string> errorMsg = new List<string>();
     char[] separator = new char[] { ' ', '\n', '\r', '\t' };
     string[] strArray = dataString.Split(separator, StringSplitOptions.RemoveEmptyEntries);
     this.Architectures.Clear();
     try
     {
         foreach (string str in strArray)
         {
             Architecture gameObject = architectures.GetGameObject(int.Parse(str)) as Architecture;
             if (gameObject != null)
             {
                 this.AddArchitecture(gameObject);
             }
             else
             {
                 errorMsg.Add("建筑ID" + str + "不存在");
             }
         }
     }
     catch
     {
         errorMsg.Add("建筑列表应为半型空格分隔的建筑ID");
     }
     if (this.ArchitectureCount == 0)
     {
         errorMsg.Add("没有建筑");
     }
     return errorMsg;
 }