Simple network replication for hands, untested.

This commit is contained in:
PJB3005
2017-09-26 21:27:48 +02:00
parent a464acf354
commit 4f2d059de4
8 changed files with 107 additions and 10 deletions

View File

@@ -0,0 +1,25 @@
using SS14.Shared.GameObjects;
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, int> Hands;
public HandsComponentState(Dictionary<string, int> hands)
{
Hands = hands;
}
}
}

View File

@@ -0,0 +1,7 @@
namespace Content.Shared.GameObjects
{
public static class ContentNetIDs
{
public const uint HANDS = 0;
}
}