Esempio n. 1
0
        /// <summary>
        /// Constructor will be called after real constructor and before Initialize.
        /// </summary>
        public PlatformModule()
        {
            OldState = PlatformModuleState.Undefined;

            Equipments   = new List <IModuleEquipment>();
            PortRoutings = new HashSet <int>();
            ItemRoutings = new Dictionary <PlatformItem, int>();
            Entities     = new PlatformModuleEntity();
        }
        /// <summary>
        /// Converts this instance of <see cref="PlatformModuleEntity"/> to an instance of <see cref="PlatformModuleEntityDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="PlatformModuleEntity"/> to convert.</param>
        public static PlatformModuleEntityDTO ToDTO(this PlatformModuleEntity entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new PlatformModuleEntityDTO();

            dto.Id             = entity.Id;
            dto.Name           = entity.Name;
            dto.LimitItemCount = entity.LimitItemCount;

            return(dto);
        }
        /// <summary>
        /// Converts this instance of <see cref="PlatformModuleEntityDTO"/> to an instance of <see cref="PlatformModuleEntity"/>.
        /// </summary>
        /// <param name="dto"><see cref="PlatformModuleEntityDTO"/> to convert.</param>
        public static PlatformModuleEntity ToEntity(this PlatformModuleEntityDTO dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new PlatformModuleEntity();

            entity.Id             = dto.Id;
            entity.Name           = dto.Name;
            entity.LimitItemCount = dto.LimitItemCount;

            return(entity);
        }