Пример #1
0
        public AGS404GroupTables CreateAGS404GroupTables(string[] groups)
        {
            if (groups == null)
            {
                groups = new string[] { "PROJ", "UNIT", "DICT", "ABBR", "TYPE", "LOCA", "SAMP", "ERES", "MONG", "MOND" };
            }

            AGS404GroupTables g = new AGS404GroupTables();

            if (groups.Contains("PROJ"))
            {
                g.PROJ = new AGSGroupReader <PROJ>(_lines).GroupTable();
            }

            if (groups.Contains("UNIT"))
            {
                g.UNIT = new AGSGroupReader <UNIT>(_lines).GroupTable();
            }
            if (groups.Contains("DICT"))
            {
                g.DICT = new AGSGroupReader <DICT>(_lines).GroupTable();
            }
            if (groups.Contains("ABBR"))
            {
                g.ABBR = new AGSGroupReader <ABBR>(_lines).GroupTable();
            }
            if (groups.Contains("TYPE"))
            {
                g.TYPE = new AGSGroupReader <TYPE>(_lines).GroupTable();
            }

            if (groups.Contains("LOCA"))
            {
                g.LOCA = new AGSGroupReader <POINT>(_lines).GroupTable();
            }

            if (groups.Contains("SAMP"))
            {
                g.SAMP = new AGSGroupReader <SAMP>(_lines).GroupTable();
            }
            if (groups.Contains("ERES"))
            {
                g.ERES = new AGSGroupReader <ERES>(_lines).GroupTable();
            }
            if (groups.Contains("MONG"))
            {
                g.MONG = new AGSGroupReader <MONG>(_lines).GroupTable();
            }
            if (groups.Contains("MOND"))
            {
                g.MOND = new AGSGroupReader <MOND>(_lines).GroupTable();
            }

            return(g);
        }
Пример #2
0
        public string CreateAGS404String(string [] groups)
        {
            if (groups == null)
            {
                groups = new string[] { "PROJ", "UNIT", "DICT", "ABBR", "TYPE", "LOCA", "SAMP", "ERES", "MONG", "MOND" };
            }

            AGS404GroupTables _tables404 = (AGS404GroupTables)_tables;
            StringBuilder     sb         = new StringBuilder();

            if (groups.Contains("PROJ") && _tables404.PROJ != null)
            {
                AGSGroupWriter <PROJ> gw = new AGSGroupWriter <PROJ>(_tables404.PROJ);
                gw.writeGroup(sb);
            }

            if (groups.Contains("LOCA") && _tables404.LOCA != null)
            {
                AGSGroupWriter <POINT> gw = new AGSGroupWriter <POINT>(_tables404.LOCA);
                sb.AppendLine();
                gw.writeGroup(sb);
            }

            if (groups.Contains("ERES") && _tables404.ERES != null)
            {
                AGSGroupWriter <ERES> gw = new AGSGroupWriter <ERES>(_tables404.ERES);
                sb.AppendLine();
                gw.writeGroup(sb);
            }

            if (groups.Contains("MONG") && _tables404.MONG != null)
            {
                AGSGroupWriter <MONG> gw = new AGSGroupWriter <MONG>(_tables404.MONG);
                sb.AppendLine();
                gw.writeGroup(sb);
            }

            if (groups.Contains("MOND") && _tables404.MOND != null)
            {
                AGSGroupWriter <MOND> gw = new AGSGroupWriter <MOND>(_tables404.MOND);
                sb.AppendLine();
                gw.writeGroup(sb);
            }

            if (groups.Contains("SAMP") && _tables404.SAMP != null)
            {
                AGSGroupWriter <SAMP> gw = new AGSGroupWriter <SAMP>(_tables404.SAMP);
                sb.AppendLine();
                gw.writeGroup(sb);
            }

            if (groups.Contains("TRAN") && _tables404.TRAN != null)
            {
                AGSGroupWriter <TRAN> gw = new AGSGroupWriter <TRAN>(_tables404.TRAN);
                sb.AppendLine();
                gw.writeGroup(sb);
            }

            if (groups.Contains("ABBR") && _tables404.ABBR != null)
            {
                AGSGroupWriter <ABBR> gw = new AGSGroupWriter <ABBR>(_tables404.ABBR);
                sb.AppendLine();
                gw.writeGroup(sb);
            }

            if (groups.Contains("TYPE") && _tables404.TYPE != null)
            {
                AGSGroupWriter <TYPE> gw = new AGSGroupWriter <TYPE>(_tables404.TYPE);
                sb.AppendLine();
                gw.writeGroup(sb);
            }

            if (groups.Contains("UNIT") && _tables404.UNIT != null)
            {
                AGSGroupWriter <UNIT> gw = new AGSGroupWriter <UNIT>(_tables404.UNIT);
                sb.AppendLine();
                gw.writeGroup(sb);
            }


            return(sb.ToString());
        }