BattleInfoPlugin.Models.MapCellInfo.MapCellInfo C# (CSharp) Метод

MapCellInfo() приватный Метод

private MapCellInfo ( map_start_next data ) : System
data BattleInfoPlugin.Models.Raw.map_start_next
Результат System
        internal MapCellInfo(map_start_next data)
        {
            this.MapId = new MapId(data.api_maparea_id, data.api_mapinfo_no);
            this.Id = data.api_no;
            this.Type = data.GetCellType();

            var getLostItems = new List<GetLostItem>();
            if (data.api_itemget != null)
            {
                getLostItems.AddRange(data.api_itemget.Select(item => new GetLostItem(item)));
            }
            if (data.api_itemget_eo_comment != null)
            {
                getLostItems.Add(data.api_itemget_eo_comment);
            }
            if (data.api_itemget_eo_result != null)
            {
                getLostItems.Add(data.api_itemget_eo_result);
            }
            if (data.api_happening != null)
            {
                getLostItems.Add(data.api_happening);
            }

            this.GetLostItems = getLostItems;

            var info = Master.Current.MapAreas[data.api_maparea_id][data.api_mapinfo_no];
            var cell = info[data.api_no];

            if (cell != null)
            {
                var rank = info.Rank;
                this.KnownEnemies = EnemyDataProvider.Current
                    .GetMapEnemiesNew()
                    .GetOrAddNew(info)
                    .GetOrAddNew(cell).Values
                    .Where(f => f.Rank?.Contains(rank) ?? false)
                    .ToArray();
            }
            else
            {
                this.KnownEnemies = new BattleFleet[0];
            }

            if (this.KnownEnemies.Length > 0)
            {
                this.EnemyName = this.KnownEnemies[0].Name;
            }
        }
MapCellInfo