2019-11-13 17:37:46 -05:00
|
|
|
|
using System;
|
2017-09-26 21:27:48 +02:00
|
|
|
|
using System.Collections.Generic;
|
2019-11-13 17:37:46 -05:00
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
using Robust.Shared.Serialization;
|
2017-09-26 21:27:48 +02:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.GameObjects
|
|
|
|
|
|
{
|
|
|
|
|
|
public abstract class SharedHandsComponent : Component
|
|
|
|
|
|
{
|
|
|
|
|
|
public sealed override string Name => "Hands";
|
|
|
|
|
|
public sealed override uint? NetID => ContentNetIDs.HANDS;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// The IDs of the items get synced over the network.
|
2018-05-27 10:13:33 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2017-09-26 21:27:48 +02:00
|
|
|
|
public class HandsComponentState : ComponentState
|
|
|
|
|
|
{
|
2018-01-20 14:46:31 -08:00
|
|
|
|
public readonly Dictionary<string, EntityUid> Hands;
|
2017-09-30 16:56:19 +02:00
|
|
|
|
public readonly string ActiveIndex;
|
2017-09-26 21:27:48 +02:00
|
|
|
|
|
2018-01-20 14:46:31 -08:00
|
|
|
|
public HandsComponentState(Dictionary<string, EntityUid> hands, string activeIndex) : base(ContentNetIDs.HANDS)
|
2017-09-26 21:27:48 +02:00
|
|
|
|
{
|
|
|
|
|
|
Hands = hands;
|
2017-09-30 16:56:19 +02:00
|
|
|
|
ActiveIndex = activeIndex;
|
2017-09-26 21:27:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-04-22 06:11:38 -05:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2020-01-17 18:41:47 -08:00
|
|
|
|
/// A message that calls the use interaction on an item in hand, presumed for now the interaction will occur only on the active hand.
|
2018-04-22 06:11:38 -05:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2020-01-17 18:41:47 -08:00
|
|
|
|
public class UseInHandMsg : ComponentMessage
|
2018-04-22 06:11:38 -05:00
|
|
|
|
{
|
2020-01-17 18:41:47 -08:00
|
|
|
|
public UseInHandMsg()
|
2018-04-22 06:11:38 -05:00
|
|
|
|
{
|
|
|
|
|
|
Directed = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-11-21 20:58:11 +01:00
|
|
|
|
|
2020-01-17 18:41:47 -08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// A message that calls the activate interaction on the item in Index.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public class ActivateInHandMsg : ComponentMessage
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Index { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public ActivateInHandMsg(string index)
|
|
|
|
|
|
{
|
|
|
|
|
|
Directed = true;
|
|
|
|
|
|
Index = index;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-11-21 20:58:11 +01:00
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public class ClientAttackByInHandMsg : ComponentMessage
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Index { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public ClientAttackByInHandMsg(string index)
|
|
|
|
|
|
{
|
|
|
|
|
|
Directed = true;
|
|
|
|
|
|
Index = index;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2019-08-31 17:49:18 -07:00
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public class ClientChangedHandMsg : ComponentMessage
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Index { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public ClientChangedHandMsg(string index)
|
|
|
|
|
|
{
|
|
|
|
|
|
Directed = true;
|
|
|
|
|
|
Index = index;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-09-26 21:27:48 +02:00
|
|
|
|
}
|