public ChpController(chpDB DB, ChpPostController post)
        {
            this.DBcontroller  = DB;
            this.chpController = post;
            initOrderword();
            chpController.notifyTime = DBcontroller.nextNotifyTime();

            chpController.notificationChpTime += chpTimeEvent;
            chpController.orderEvent          += orderRes;
        }
示例#2
0
        public void init(string DBaddress, string database, string user, string password, string botname, ulong channelID, string token)
        {
            this.DBaddress = DBaddress;
            this.database  = database;
            this.user      = user;
            this.password  = password;
            this.botname   = botname;
            this.channelID = channelID;
            this.token     = token;

            //覇者の紋章コンストラクタ
            chpData    = new PostgreSQL_ChpRead(DBaddress, database, user, password);
            chpTimeDB  = new PostgreSQL_chp_confDB(DBaddress, database, user, password);
            chpDBCon   = new chpDB(chpData, chpTimeDB);
            chpPost    = new emgPostToDiscord(token, channelID, botname);
            chpPostCon = new ChpPostController(chpPost);
            chpCon     = new ChpController(chpDBCon, chpPostCon);

            //緊急クエストコンストラクタ
            emgDBRead  = new PostgreSQL_EmgRead(DBaddress, database, user, password);
            configDB   = new PostgreSQL_configLoader(DBaddress, database, user, password);
            emgPost    = new emgPostToDiscord(token, channelID, botname);
            emgPostCon = new EmgPostController(emgPost);
            EmgDB      = new EmgDBGet(emgDBRead);
            EmgCon     = new EmgController(emgPostCon, EmgDB, configDB);

            //緊急クエスト参加コンストラクタ
            joinMemDB  = new PostgreSQL_joinDB(DBaddress, database, user, password);
            joinPost   = new joinPostDiscord(token, channelID, botname);
            jDB        = new joinDB(joinMemDB, emgDBRead);
            joinSerCon = new joinServiceController(joinPost);
            joinCon    = new JoinController(jDB, joinSerCon, configDB);

            //その他コンストラクタ
            List <AbstractServiceController> lstService = new List <AbstractServiceController>();

            lstService.Add(chpPostCon);
            lstService.Add(emgPostCon);
            lstService.Add(joinSerCon);
            discord = new DiscordService(token, channelID, botname);
            defCon  = new DefaultDiscordController(discord, lstService);
        }