From 8e533220f005acbf313ec0ea9c54f3fa3380c40f Mon Sep 17 00:00:00 2001 From: teascade Date: Tue, 16 May 2017 15:21:42 +0300 Subject: [PATCH] Fix docs --- .../Scripts/Entities/SyncBases/Inventory.cs | 3 ++ .../Scripts/Items/InventoryActionHandler.cs | 30 ++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Entities/SyncBases/Inventory.cs b/Assets/Scripts/Entities/SyncBases/Inventory.cs index 38a61fd..1351830 100644 --- a/Assets/Scripts/Entities/SyncBases/Inventory.cs +++ b/Assets/Scripts/Entities/SyncBases/Inventory.cs @@ -28,6 +28,9 @@ namespace Cyber.Entities.SyncBases { /// public Character Character; + /// + /// The which handles inventory actions properly. + /// public InventoryActionHandler ActionHandler; /// diff --git a/Assets/Scripts/Items/InventoryActionHandler.cs b/Assets/Scripts/Items/InventoryActionHandler.cs index 6dc005f..ddc584b 100644 --- a/Assets/Scripts/Items/InventoryActionHandler.cs +++ b/Assets/Scripts/Items/InventoryActionHandler.cs @@ -2,32 +2,60 @@ using Cyber.Entities.SyncBases; using Cyber.Networking.Clientside; using Cyber.Networking.Messages; -using UnityEngine; namespace Cyber.Items { + /// + /// Handles InventoryActions, building them on the client when needed and running them. + /// public class InventoryActionHandler { private Inventory Inventory; private Character Character; + /// + /// Creates an + /// + /// + /// public InventoryActionHandler(Inventory inventory, Character character) { Inventory = inventory; Character = character; } + /// + /// Builds a packet. + /// + /// The equipped slot to use. + /// public InventoryActionPkt BuildUseItem(EquipSlot slot) { return new InventoryActionPkt(InventoryAction.Use, (int) slot); } + /// + /// Builds a packet. + /// + /// The equipped slot to clear. + /// public InventoryActionPkt BuildClearSlot(EquipSlot slot) { return new InventoryActionPkt(InventoryAction.Unequip, (int) slot); } + /// + /// Builds a packet. + /// + /// The item ID to equip. + /// public InventoryActionPkt BuildEquipItem(int itemID) { return new InventoryActionPkt(InventoryAction.Equip, itemID); } + /// + /// Handles an to handle. Ran on server and client. + /// + /// The to run + /// The item related to the action. + /// Weather the action failed or not. public bool HandleAction(InventoryAction action, int relatedInt) { switch (action) { case InventoryAction.Equip: