Files
tbd-station-14/Content.Shared/GameObjects/Components/Items/SharedHandsComponent.cs
clusterfack ea05c593aa Storage Component (toolboxes, backpacks, etc) (#57)
* Fix
Finish and update submodule
Comments code, changes network messages
FIXES THE USE INTERACTION SO YOU CAN ACTUALLY ACTIVATE THINGS NOW
Need engine commits
We'll figure out what to do about this shit later eh mates? Maybe have a script in the build process that automatically moves them over to godot/scenes
Changes some prototypes and fixes stuff
Fixes some more bugs, makes storage values show up properly
Part 3
Part 2
Storage Take 1

* Doneso
2018-04-22 13:11:38 +02:00

41 lines
1.2 KiB
C#

using SS14.Shared.GameObjects;
using SS14.Shared.Serialization;
using System;
using System.Collections.Generic;
namespace Content.Shared.GameObjects
{
public abstract class SharedHandsComponent : Component
{
public sealed override string Name => "Hands";
public sealed override uint? NetID => ContentNetIDs.HANDS;
public sealed override Type StateType => typeof(HandsComponentState);
}
// The IDs of the items get synced over the network.
[Serializable]
public class HandsComponentState : ComponentState
{
public readonly Dictionary<string, EntityUid> Hands;
public readonly string ActiveIndex;
public HandsComponentState(Dictionary<string, EntityUid> hands, string activeIndex) : base(ContentNetIDs.HANDS)
{
Hands = hands;
ActiveIndex = activeIndex;
}
}
/// <summary>
/// A message that activates the inhand, presumed for now the activation will occur only on the active hand
/// </summary>
[Serializable, NetSerializable]
public class ActivateInhandMsg : ComponentMessage
{
public ActivateInhandMsg()
{
Directed = true;
}
}
}