mirror of
https://github.com/HappyTanuki/BumbleCee.git
synced 2025-10-26 09:55:14 +00:00
큐 완전 개혁
This commit is contained in:
18
include/Commands/CommandType.hpp
Normal file
18
include/Commands/CommandType.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include <dpp/dpp.h>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <MusicQueue.hpp>
|
||||
|
||||
namespace commands {
|
||||
class ICommand {
|
||||
public:
|
||||
//이 생성자를 명시적으로 호출할 것.
|
||||
ICommand(std::shared_ptr<dpp::cluster> botCluster);
|
||||
virtual void operator()(const dpp::slashcommand_t &event) = 0;
|
||||
|
||||
std::vector<dpp::slashcommand> commandObjectVector;
|
||||
protected:
|
||||
std::shared_ptr<dpp::cluster> botCluster;
|
||||
};
|
||||
}
|
||||
7
include/Commands/Commands.hpp
Normal file
7
include/Commands/Commands.hpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include <Commands/Play.hpp>
|
||||
#include <Commands/Repeat.hpp>
|
||||
#include <Commands/Queue.hpp>
|
||||
#include <Commands/Skip.hpp>
|
||||
#include <Commands/Leave.hpp>
|
||||
#include <Commands/Delete.hpp>
|
||||
@@ -1,19 +1,15 @@
|
||||
#ifndef _DELETE_HPP_
|
||||
#define _DELETE_HPP_
|
||||
#include <CommandType.hpp>
|
||||
#pragma once
|
||||
#include <Commands/CommandType.hpp>
|
||||
#include <BumbleCeepp.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace Commands {
|
||||
class Delete : public ICommand {
|
||||
public:
|
||||
Delete(std::shared_ptr<BumbleCeepp> Bot);
|
||||
namespace commands {
|
||||
class Delete : public ICommand {
|
||||
public:
|
||||
Delete(std::shared_ptr<dpp::cluster> botCluster, std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap);
|
||||
|
||||
void operator()(const dpp::slashcommand_t& Event) {}
|
||||
void operator()(std::list<FQueueElement>& MusicQueue, const dpp::slashcommand_t& Event);
|
||||
private:
|
||||
std::shared_ptr<BumbleCeepp> Bot;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
void operator()(const dpp::slashcommand_t& event);
|
||||
private:
|
||||
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
|
||||
};
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
#ifndef _LEAVE_HPP_
|
||||
#define _LEAVE_HPP_
|
||||
#include <CommandType.hpp>
|
||||
#pragma once
|
||||
#include <Commands/CommandType.hpp>
|
||||
#include <BumbleCeepp.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace Commands {
|
||||
class Leave : public ICommand {
|
||||
public:
|
||||
Leave(std::shared_ptr<BumbleCeepp> Bot);
|
||||
namespace commands {
|
||||
class Leave : public ICommand {
|
||||
public:
|
||||
Leave(std::shared_ptr<dpp::cluster> botCluster, std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap);
|
||||
|
||||
void operator()(const dpp::slashcommand_t& Event) {}
|
||||
void operator()(std::list<FQueueElement>& MusicQueue, const dpp::slashcommand_t& Event);
|
||||
private:
|
||||
std::shared_ptr<BumbleCeepp> Bot;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
void operator()(const dpp::slashcommand_t& event);
|
||||
private:
|
||||
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
|
||||
};
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
#ifndef _PLAY_HPP_
|
||||
#define _PLAY_HPP_
|
||||
#include <CommandType.hpp>
|
||||
#pragma once
|
||||
#include <Commands/CommandType.hpp>
|
||||
#include <BumbleCeepp.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace Commands {
|
||||
class Play : public ICommand {
|
||||
public:
|
||||
Play(std::shared_ptr<BumbleCeepp> Bot);
|
||||
namespace commands {
|
||||
class Play : public ICommand {
|
||||
public:
|
||||
Play(std::shared_ptr<dpp::cluster> botCluster, std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap);
|
||||
|
||||
void operator()(const dpp::slashcommand_t& Event) {}
|
||||
void operator()(std::list<FQueueElement>& MusicQueue, const dpp::slashcommand_t& Event);
|
||||
private:
|
||||
std::shared_ptr<BumbleCeepp> Bot;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
void operator()(const dpp::slashcommand_t& event);
|
||||
private:
|
||||
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
|
||||
};
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
#ifndef _QUEUE_HPP_
|
||||
#define _QUEUE_HPP_
|
||||
#include <CommandType.hpp>
|
||||
#pragma once
|
||||
#include <Commands/CommandType.hpp>
|
||||
#include <BumbleCeepp.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace Commands {
|
||||
class Queue : public ICommand {
|
||||
public:
|
||||
Queue(std::shared_ptr<BumbleCeepp> Bot);
|
||||
namespace commands {
|
||||
class Queue : public ICommand {
|
||||
public:
|
||||
Queue(std::shared_ptr<dpp::cluster> botCluster, std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap);
|
||||
|
||||
void operator()(const dpp::slashcommand_t& Event) {}
|
||||
void operator()(std::list<FQueueElement>& MusicQueue, const dpp::slashcommand_t& Event);
|
||||
private:
|
||||
std::shared_ptr<BumbleCeepp> Bot;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
void operator()(const dpp::slashcommand_t& event);
|
||||
private:
|
||||
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
|
||||
};
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
#ifndef _REPEAT_HPP_
|
||||
#define _REPEAT_HPP_
|
||||
#include <CommandType.hpp>
|
||||
#pragma once
|
||||
#include <Commands/CommandType.hpp>
|
||||
#include <BumbleCeepp.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace Commands {
|
||||
class Repeat : public ICommand {
|
||||
public:
|
||||
Repeat(std::shared_ptr<BumbleCeepp> Bot);
|
||||
namespace commands {
|
||||
class Repeat : public ICommand {
|
||||
public:
|
||||
Repeat(std::shared_ptr<dpp::cluster> botCluster, std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap);
|
||||
|
||||
void operator()(const dpp::slashcommand_t& Event) {}
|
||||
void operator()(std::list<FQueueElement>& MusicQueue, const dpp::slashcommand_t& Event);
|
||||
private:
|
||||
std::shared_ptr<BumbleCeepp> Bot;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
void operator()(const dpp::slashcommand_t& event);
|
||||
private:
|
||||
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
|
||||
};
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
#ifndef _SKIP_HPP_
|
||||
#define _SKIP_HPP_
|
||||
#include <CommandType.hpp>
|
||||
#pragma once
|
||||
#include <Commands/CommandType.hpp>
|
||||
#include <BumbleCeepp.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace Commands {
|
||||
class Skip : public ICommand {
|
||||
public:
|
||||
Skip(std::shared_ptr<BumbleCeepp> Bot);
|
||||
namespace commands {
|
||||
class Skip : public ICommand {
|
||||
public:
|
||||
Skip(std::shared_ptr<dpp::cluster> botCluster, std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap);
|
||||
|
||||
void operator()(const dpp::slashcommand_t& Event) {}
|
||||
void operator()(std::list<FQueueElement>& MusicQueue, const dpp::slashcommand_t& Event);
|
||||
private:
|
||||
std::shared_ptr<BumbleCeepp> Bot;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
void operator()(const dpp::slashcommand_t& event);
|
||||
private:
|
||||
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user