示例#1
0
            public static IEnumerable <DeckZone> GetDefinedDeckZones(IProjectVersion version)
            {
                var name = "TAB*DECKS";
                var t    = version.GetTable(name);

                if (t == null)
                {
                    return(Enumerable.Empty <DeckZone>());
                }

                return(t.Rows
                       .Cast <IRow>()
                       .Select(r => new DeckZone()
                {
                    ID = r.GetStringValue("NAME"),
                    Surface = r.GetStringValue("SURFACE")
                })
                       .ToList());
            }
示例#2
0
            public static IEnumerable <MainVerticalZone> GetMainVerticalZones(IProjectVersion version)
            {
                var name = "TAB*MVZ";
                var t    = version.GetTable(name);

                if (t == null)
                {
                    return(Enumerable.Empty <MainVerticalZone>());
                }

                return(t.Rows.Cast <IRow>()
                       .Select(r => new MainVerticalZone()
                {
                    Name = r.GetStringValue("NAME"),
                    Min = ShipCoordinate.Create(r.GetStringValue("LLIMIT")),
                    Max = ShipCoordinate.Create(r.GetStringValue("ULIMIT")),
                    Index = r.GetStringValue("NR")
                })
                       .OrderByDescending(mvz => mvz.Name)
                       .ToList());
            }