예제 #1
0
 public static ICollection <Stats_Repository.DTO.Encounter> ToNEncounter(this ICollection <WCL_Api_Library.DTO.Encounter> encounters,
                                                                         Stats_Repository.DTO.Zone zone)
 {
     return(encounters.Select(s => new Stats_Repository.DTO.Encounter {
         EncounterId = s.Id, Name = s.Name, Zone = zone
     }).ToList());
 }
예제 #2
0
 public static ICollection <Stats_Repository.DTO.Partition> ToNPartition(this ICollection <WCL_Api_Library.DTO.Partition> partitions,
                                                                         Stats_Repository.DTO.Zone zone)
 {
     return(partitions.Select(s => new Stats_Repository.DTO.Partition {
         Name = s.Name, Compact = s.Compact, Zone = zone
     }).ToList());
 }
예제 #3
0
        // public static Zone ToNZone(this WCL_Api_Library.DTO.Zone zone)
        // {
        //     return new Zone
        //     {
        //         Brackets = new Brackets
        //         {
        //             Bucket = zone.Brackets.Bucket,
        //             Max = zone.Brackets.Max,
        //             Min = zone.Brackets.Min,
        //             Type = zone.Brackets.Type
        //         },
        //         Frozen = zone.Frozen,
        //         ZoneId = zone.Id,
        //         Name = zone.Name,
        //         Encounters = zone.Encounters.ToNEncounter(),
        //         Partitions = zone.Partitions.ToNPartition()
        //     };
        // }
        //
        // public static ICollection<Encounter> ToNEncounter(this ICollection<WCL_Api_Library.DTO.Encounter> encounters)
        // {
        //     return encounters.Select(s => new Encounter {Id = s.Id, Name = s.Name}).ToList();
        // }
        // public static ICollection<Partition> ToNPartition(this ICollection<WCL_Api_Library.DTO.Partition> partitions)
        // {
        //     return partitions.Select(s => new Partition {Name = s.Name,Compact = s.Compact}).ToList();
        // }
        //

        public static Stats_Repository.DTO.Zone ToZone(this WCL_Api_Library.DTO.Zone zone)
        {
            var newZone = new Stats_Repository.DTO.Zone
            {
                Brackets = new Stats_Repository.DTO.Brackets
                {
                    Bucket = zone.Brackets.Bucket,
                    Max    = zone.Brackets.Max,
                    Min    = zone.Brackets.Min,
                    Type   = zone.Brackets.Type
                },
                Frozen = zone.Frozen,
                ZoneId = zone.Id,
                Name   = zone.Name
            };

            newZone.Encounters = zone.Encounters.ToNEncounter(newZone);
            newZone.Partitions = zone.Partitions.ToNPartition(newZone);


            return(newZone);
        }