This commit is contained in:
2024-01-22 03:26:22 +09:00
parent c996f290db
commit b7b1018871
18 changed files with 118 additions and 134 deletions

View File

@@ -15,4 +15,15 @@ public:
protected:
std::shared_ptr<dpp::cluster> botCluster;
};
}
namespace commands {
class VCCommand : public ICommand {
public:
VCCommand(std::shared_ptr<dpp::cluster> botCluster) : ICommand(botCluster) {}
std::shared_ptr<MusicQueue> getQueue(const dpp::slashcommand_t& event);
protected:
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
};
}

View File

@@ -4,12 +4,10 @@
#include <memory>
namespace commands {
class Delete : public ICommand {
class Delete : public VCCommand {
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);
private:
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
};
}

View File

@@ -4,12 +4,10 @@
#include <memory>
namespace commands {
class Leave : public ICommand {
class Leave : public VCCommand {
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);
private:
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
};
}

View File

@@ -4,12 +4,10 @@
#include <memory>
namespace commands {
class Play : public ICommand {
class Play : public VCCommand {
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);
private:
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
};
}

View File

@@ -4,12 +4,10 @@
#include <memory>
namespace commands {
class Queue : public ICommand {
class Queue : public VCCommand {
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);
private:
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
};
}

View File

@@ -4,12 +4,10 @@
#include <memory>
namespace commands {
class Repeat : public ICommand {
class Repeat : public VCCommand {
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);
private:
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
};
}

View File

@@ -4,12 +4,10 @@
#include <memory>
namespace commands {
class Skip : public ICommand {
class Skip : public VCCommand {
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);
private:
std::unordered_map<dpp::snowflake, std::shared_ptr<MusicQueue>> *queueMap;
};
}

View File

@@ -9,7 +9,7 @@ struct FMusicQueueID {
class MusicQueue {
public:
MusicQueue(FMusicQueueID id);
MusicQueue(FMusicQueueID id, std::shared_ptr<dpp::cluster> botCluster);
void operator+=(FQueueElement operand);
FQueueElement pop(int index);
FQueueElement peek(int index);
@@ -19,9 +19,9 @@ public:
std::list<struct FQueueElement>::iterator end();
std::size_t size();
FMusicQueueID getId();
void play(std::shared_ptr<dpp::cluster> botCluster);
void play();
void markerCallback(std::shared_ptr<dpp::cluster> botCluster);
void markerCallback();
bool repeat;
private:
@@ -29,5 +29,5 @@ private:
std::mutex mutex;
std::mutex playMutex;
FMusicQueueID id;
bool queuePlaying;
std::shared_ptr<dpp::cluster> botCluster;
};