add $rand command
This commit is contained in:
+17
-5
@@ -3,20 +3,32 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <random>
|
||||
|
||||
#include "Lobby.hh"
|
||||
#include "Client.hh"
|
||||
|
||||
|
||||
|
||||
void player_use_item(std::shared_ptr<Client> c, size_t item_index);
|
||||
|
||||
struct CommonItemCreator {
|
||||
struct CommonItemData {
|
||||
std::vector<uint32_t> enemy_item_categories;
|
||||
std::vector<uint32_t> box_item_categories;
|
||||
std::vector<std::vector<uint8_t>> unit_types;
|
||||
|
||||
CommonItemCreator(const std::vector<uint32_t>& enemy_item_categories,
|
||||
const std::vector<uint32_t>& box_item_categories,
|
||||
const std::vector<std::vector<uint8_t>>& unit_types);
|
||||
CommonItemData(
|
||||
std::vector<uint32_t>&& enemy_item_categories,
|
||||
std::vector<uint32_t>&& box_item_categories,
|
||||
std::vector<std::vector<uint8_t>>&& unit_types);
|
||||
};
|
||||
|
||||
struct CommonItemCreator {
|
||||
std::shared_ptr<const CommonItemData> data;
|
||||
std::shared_ptr<std::mt19937> random;
|
||||
|
||||
CommonItemCreator(
|
||||
std::shared_ptr<const CommonItemData> data,
|
||||
std::shared_ptr<std::mt19937> random);
|
||||
|
||||
int32_t decide_item_type(bool is_box) const;
|
||||
ItemData create_drop_item(bool is_box, uint8_t episode, uint8_t difficulty,
|
||||
|
||||
Reference in New Issue
Block a user