Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend inventory actor functionality #101

Open
petterarvidsson opened this issue Mar 20, 2016 · 5 comments
Open

Extend inventory actor functionality #101

petterarvidsson opened this issue Mar 20, 2016 · 5 comments
Milestone

Comments

@petterarvidsson
Copy link
Member

petterarvidsson commented Mar 20, 2016

To accommodate more advanced use cases such as machines extend the inventory actor with new functionality.

As a first step, add three different types of inventories that can be associated with a UUID (block):

  • STORAGE, generic multi purpose storage
  • INPUT, inventory designated for input
  • OUTPUT, inventory designated for output

Then add (or rework existing) messages:

  • GetInventories(uuid) -> [uuid, storage, input, output]
  • AddToInventory(uuid, inventoryType, stack) -> [uuid, inventoryType, stack]
  • RemoveFromInventory(uuid, inventoryType, blockTypeId, amount) -> [uuid, inventoryType, stack]
  • ReplaceInventorySlot(uuid, inventoryType, slot, stack) -> [uuid, inventoryType, slot, stack]
  • TryToReplaceInventorySlot(uuid, inventoryType, slot, stack) -> [uuid, inventoryType, slot, stack]
  • TransferBetweenInventories(fromUuid. fromInventoryType, toUuid, toInvenotryType, blockTypeId, amount) -> [?]
  • RegisterForInventoriesEvents(uuid)
  • DeregisterForInventoriesEvents(uuid)
  • InventoryEvent(uuid)
@petterarvidsson
Copy link
Member Author

@nsg I will implement this for release 10 with the more generic solution where the inventory type is a proper type (my idea of syntax was name/space/INVENTORY_TYPE_NAME, e.g. org/konstructs/STORAGE). So every block with an id (UUID) can have any number of storages each with a namespaced id. What do you think?

@petterarvidsson
Copy link
Member Author

I will initially leave out the inventory events in relation to the pull discussion we had. Let's see if we need that when we start implementing some machines.

@nsg
Copy link
Member

nsg commented Jul 27, 2017

Sounds good 👍

@petterarvidsson
Copy link
Member Author

Api messages are being added in konstructs/server-api#27

@nsg
Copy link
Member

nsg commented Jul 28, 2017

Looking good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants