2026-03-01 12:16:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
#include "Container.h"
|
|
|
|
|
|
|
|
|
|
class Player;
|
|
|
|
|
|
|
|
|
|
class CompoundContainer : public Container
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
int name;
|
2026-03-02 15:58:20 +07:00
|
|
|
std::shared_ptr<Container> c1, c2;
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
public:
|
2026-03-02 15:58:20 +07:00
|
|
|
CompoundContainer(int name, std::shared_ptr<Container> c1, std::shared_ptr<Container> c2);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
unsigned int getContainerSize();
|
|
|
|
|
|
|
|
|
|
int getName();
|
|
|
|
|
|
2026-03-02 15:58:20 +07:00
|
|
|
std::shared_ptr<ItemInstance> getItem(unsigned int slot);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
2026-03-02 15:58:20 +07:00
|
|
|
std::shared_ptr<ItemInstance> removeItem(unsigned int slot, int i);
|
|
|
|
|
std::shared_ptr<ItemInstance> removeItemNoUpdate(int slot);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
2026-03-02 15:58:20 +07:00
|
|
|
void setItem(unsigned int slot, std::shared_ptr<ItemInstance> item);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
int getMaxStackSize();
|
|
|
|
|
|
|
|
|
|
void setChanged();
|
|
|
|
|
|
2026-03-02 15:58:20 +07:00
|
|
|
bool stillValid(std::shared_ptr<Player> player);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
|
|
|
|
virtual void startOpen();
|
|
|
|
|
virtual void stopOpen();
|
|
|
|
|
};
|