Пример #1
0
 public PlanshetViewData SetPlanshetSectorInfo(IDbConnection connection, SectorInfoOut sector)
 {
     return(PlanshetBodyHelper.SetBody(
                sector, Resource.Sector,
                IdConstructor(sector.TypeNativeName, sector.Id),
                MapInfoTemplates[3],
                MapInfoTemplates[4]));
 }
Пример #2
0
        public SectorInfoOut GetSectorInfo(IDbConnection connection, short sectorId)
        {
            var sector = _gSectorsService.GetById(connection, sectorId, i => i);

            if (sector == null)
            {
                return(null);
            }

            var sectorType = _gameTypeService.GetGGameType(connection, sector.TypeId);

            if (sectorType == null)
            {
                return(null);
            }

            var galaxyName = _galaxyService.GetGalaxyById(connection, sector.GalaxyId, i => i);

            if (galaxyName == null)
            {
                return(null);
            }


            var topAllianceName = _allianceService.GetTopAllianceInSector(connection, sectorId);
            var systemIds       = _systemService.GetSystemIds(connection, sectorId);

            var sectorInfo = new SectorInfoOut
            {
                GalaxyId          = sector.GalaxyId,
                GalaxyName        = galaxyName.NativeName,
                SectorId          = sector.Id,
                SectorName        = sector.NativeName,
                Id                = sector.Id,
                NativeName        = sector.NativeName,
                TextureTypeId     = sector.TextureTypeId,
                TypeNativeName    = sectorType.Type,
                TypeTranslateName =
                    L10N.ExecuteTranslateNameOrDescr(sectorType.Description, true, L10N.GetCurrentCulture()),
                SubtypeNativeName = sectorType.SubType,
                Description       = L10N.ExecuteTranslateNameOrDescr(sector.Translate, false, L10N.GetCurrentCulture()),
                AllianceName      = topAllianceName,
                ChildCount        = (short)systemIds.Count,
                SpriteImages      = new SpriteImages().SectorImages(sector.TextureTypeId),
                GameTypeId        = sectorType.Id
            };

            sectorInfo.SetComplexButtonView();
            return(sectorInfo);
        }