diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-20 14:33:09 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-20 14:33:09 +1000 |
commit | 6352e8e3196f78388b6c771073f9e03eaa612673 (patch) | |
tree | e23772f79a7fbc41bc9108951e9e136857484bf4 /source/frontend/StarContainerInteractor.hpp | |
parent | 6741a057e5639280d85d0f88ba26f000baa58f61 (diff) |
everything everywhere
all at once
Diffstat (limited to 'source/frontend/StarContainerInteractor.hpp')
-rw-r--r-- | source/frontend/StarContainerInteractor.hpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/source/frontend/StarContainerInteractor.hpp b/source/frontend/StarContainerInteractor.hpp new file mode 100644 index 0000000..9b17748 --- /dev/null +++ b/source/frontend/StarContainerInteractor.hpp @@ -0,0 +1,46 @@ +#ifndef STAR_CONTAINER_INTERACTION_HPP +#define STAR_CONTAINER_INTERACTION_HPP + +#include "StarContainerEntity.hpp" + +namespace Star { + +STAR_CLASS(ContainerInteractor); + +typedef List<ItemPtr> ContainerResult; + +class ContainerInteractor { +public: + void openContainer(ContainerEntityPtr containerEntity); + void closeContainer(); + + bool containerOpen() const; + + // Returns NullEntityId if no container is open + EntityId openContainerId() const; + + // Throws exception if there is no currently open container. + ContainerEntityPtr const& openContainer() const; + + List<ContainerResult> pullContainerResults(); + + void swapInContainer(size_t slot, ItemPtr const& items); + void addToContainer(ItemPtr const& items); + void takeFromContainerSlot(size_t slot, size_t count); + void applyAugmentInContainer(size_t slot, ItemPtr const& augment); + + void startCraftingInContainer(); + void stopCraftingInContainer(); + void burnContainer(); + void clearContainer(); + +private: + static ContainerResult resultFromItem(ItemPtr const& items); + + mutable ContainerEntityPtr m_openContainer; + List<RpcPromise<ContainerResult>> m_pendingResults; +}; + +} + +#endif |