Exemplo n.º 1
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="conn">DB接続情報</param>
        /// <param name="wareProductionManager">ウェア生産情報一覧</param>
        /// <param name="transportTypeManager">カーゴ種別一覧</param>
        public ModuleBuilder(
            IDbConnection conn,
            WareProductionManager wareProductionManager,
            TransportTypeManager transportTypeManager,
            WareEquipmentManager wareEquipmentManager
            )
        {
            // モジュール種別一覧を作成
            {
                const string sql = "SELECT ModuleTypeID, Name FROM ModuleType";
                _ModuleTypes = conn.Query <ModuleType>(sql)
                               .ToDictionary(x => x.ModuleTypeID, x => x as IModuleType);
            }


            // モジュール情報一覧を作成
            _Modules = conn.Query <X4_DataExporterWPF.Entity.Module>("SELECT * FROM Module")
                       .ToDictionary(x => x.ModuleID);


            _ModuleProductManager = new(conn, wareProductionManager);

            _StorageManager = new(conn, transportTypeManager);

            _WareEquipmentManager = wareEquipmentManager;
        }
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="conn">DB接続情報</param>
        public WareBuilder(IDbConnection conn, TransportTypeManager transportTypeManager)
        {
            _Conn = conn;

            _TransportTypeManager  = transportTypeManager;
            _WareTagsManager       = new(conn);
            _WareOwnerManager      = new(conn);
            _WareResourceManager   = new(conn);
            _WareProductionManager = new(conn);
            _WareGroupManager      = new(conn);
            _WareEffectManager     = new(conn);


            var wareEquipmentManager = new WareEquipmentManager(conn);

            _ShipBuilder      = new(conn, wareEquipmentManager);
            _ModuleBuilder    = new(conn, _WareProductionManager, transportTypeManager, wareEquipmentManager);
            _EquipmentBuilder = new(conn);
        }