큐 완전 개혁

This commit is contained in:
2024-01-02 14:41:24 +09:00
parent 70c70eee93
commit c996f290db
30 changed files with 771 additions and 576 deletions

View 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;
};
}

View 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>

View File

@@ -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;
};
}

View File

@@ -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;
};
}

View File

@@ -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;
};
}

View File

@@ -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;
};
}

View File

@@ -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;
};
}

View File

@@ -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;
};
}