VV support.

This commit is contained in:
PJB3005
2018-09-09 15:34:43 +02:00
parent 06ea07eca5
commit 1dabe49234
24 changed files with 91 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ using Content.Shared.Construction;
using SS14.Shared.GameObjects; using SS14.Shared.GameObjects;
using SS14.Shared.Interfaces.GameObjects; using SS14.Shared.Interfaces.GameObjects;
using SS14.Shared.Interfaces.Network; using SS14.Shared.Interfaces.Network;
using SS14.Shared.ViewVariables;
namespace Content.Client.GameObjects.Components.Construction namespace Content.Client.GameObjects.Components.Construction
{ {
@@ -9,11 +10,12 @@ namespace Content.Client.GameObjects.Components.Construction
{ {
public override string Name => "ConstructionGhost"; public override string Name => "ConstructionGhost";
public ConstructionPrototype Prototype { get; set; } [ViewVariables] public ConstructionPrototype Prototype { get; set; }
public ConstructorComponent Master { get; set; } [ViewVariables] public ConstructorComponent Master { get; set; }
public int GhostID { get; set; } [ViewVariables] public int GhostID { get; set; }
public override void HandleMessage(ComponentMessage message, INetChannel netChannel = null, IComponent component = null) public override void HandleMessage(ComponentMessage message, INetChannel netChannel = null,
IComponent component = null)
{ {
base.HandleMessage(message, netChannel, component); base.HandleMessage(message, netChannel, component);

View File

@@ -6,12 +6,14 @@ using SS14.Shared.GameObjects;
using SS14.Shared.Interfaces.GameObjects; using SS14.Shared.Interfaces.GameObjects;
using SS14.Shared.IoC; using SS14.Shared.IoC;
using System.Collections.Generic; using System.Collections.Generic;
using SS14.Shared.ViewVariables;
namespace Content.Client.GameObjects namespace Content.Client.GameObjects
{ {
public class HandsComponent : SharedHandsComponent, IHandsComponent public class HandsComponent : SharedHandsComponent, IHandsComponent
{ {
private readonly Dictionary<string, IEntity> hands = new Dictionary<string, IEntity>(); private readonly Dictionary<string, IEntity> hands = new Dictionary<string, IEntity>();
[ViewVariables]
public string ActiveIndex { get; private set; } public string ActiveIndex { get; private set; }
public IEntity GetEntity(string index) public IEntity GetEntity(string index)

View File

@@ -11,6 +11,7 @@ using SS14.Shared.GameObjects;
using SS14.Shared.Interfaces.GameObjects; using SS14.Shared.Interfaces.GameObjects;
using SS14.Shared.Interfaces.GameObjects.Components; using SS14.Shared.Interfaces.GameObjects.Components;
using SS14.Shared.IoC; using SS14.Shared.IoC;
using SS14.Shared.ViewVariables;
using static Content.Shared.Construction.ConstructionStepMaterial; using static Content.Shared.Construction.ConstructionStepMaterial;
using static Content.Shared.Construction.ConstructionStepTool; using static Content.Shared.Construction.ConstructionStepTool;
@@ -20,7 +21,9 @@ namespace Content.Server.GameObjects.Components.Construction
{ {
public override string Name => "Construction"; public override string Name => "Construction";
[ViewVariables]
public ConstructionPrototype Prototype { get; private set; } public ConstructionPrototype Prototype { get; private set; }
[ViewVariables]
public int Stage { get; private set; } public int Stage { get; private set; }
SpriteComponent Sprite; SpriteComponent Sprite;

View File

@@ -8,6 +8,7 @@ using YamlDotNet.RepresentationModel;
using Content.Server.Interfaces; using Content.Server.Interfaces;
using Content.Shared.GameObjects; using Content.Shared.GameObjects;
using SS14.Shared.Serialization; using SS14.Shared.Serialization;
using SS14.Shared.ViewVariables;
namespace Content.Server.GameObjects namespace Content.Server.GameObjects
{ {
@@ -29,6 +30,7 @@ namespace Content.Server.GameObjects
/// The resistance set of this object. /// The resistance set of this object.
/// Affects receiving damage of various types. /// Affects receiving damage of various types.
/// </summary> /// </summary>
[ViewVariables]
public ResistanceSet Resistances { get; private set; } public ResistanceSet Resistances { get; private set; }
Dictionary<DamageType, int> CurrentDamage = new Dictionary<DamageType, int>(); Dictionary<DamageType, int> CurrentDamage = new Dictionary<DamageType, int>();

View File

@@ -7,6 +7,7 @@ using YamlDotNet.RepresentationModel;
using Content.Server.Interfaces; using Content.Server.Interfaces;
using Content.Shared.GameObjects; using Content.Shared.GameObjects;
using SS14.Shared.Serialization; using SS14.Shared.Serialization;
using SS14.Shared.ViewVariables;
namespace Content.Server.GameObjects namespace Content.Server.GameObjects
{ {
@@ -25,6 +26,7 @@ namespace Content.Server.GameObjects
/// Damage threshold calculated from the values /// Damage threshold calculated from the values
/// given in the prototype declaration. /// given in the prototype declaration.
/// </summary> /// </summary>
[ViewVariables]
public DamageThreshold Threshold { get; private set; } public DamageThreshold Threshold { get; private set; }

View File

@@ -11,12 +11,14 @@ using SS14.Shared.IoC;
using Content.Server.GameObjects.EntitySystems; using Content.Server.GameObjects.EntitySystems;
using SS14.Shared.Serialization; using SS14.Shared.Serialization;
using SS14.Shared.Interfaces.Network; using SS14.Shared.Interfaces.Network;
using SS14.Shared.ViewVariables;
namespace Content.Server.GameObjects namespace Content.Server.GameObjects
{ {
public class ServerDoorComponent : Component, IAttackHand public class ServerDoorComponent : Component, IAttackHand
{ {
public override string Name => "Door"; public override string Name => "Door";
[ViewVariables]
public bool Opened { get; private set; } public bool Opened { get; private set; }
private float OpenTimeCounter; private float OpenTimeCounter;

View File

@@ -15,6 +15,7 @@ using SS14.Shared.Interfaces.Network;
using SS14.Shared.IoC; using SS14.Shared.IoC;
using SS14.Shared.Map; using SS14.Shared.Map;
using SS14.Shared.Serialization; using SS14.Shared.Serialization;
using SS14.Shared.ViewVariables;
namespace Content.Server.GameObjects namespace Content.Server.GameObjects
{ {
@@ -22,6 +23,7 @@ namespace Content.Server.GameObjects
{ {
private string activeIndex; private string activeIndex;
[ViewVariables(VVAccess.ReadWrite)]
public string ActiveIndex public string ActiveIndex
{ {
get => activeIndex; get => activeIndex;

View File

@@ -9,6 +9,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using SS14.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Interactable namespace Content.Server.GameObjects.Components.Interactable
{ {
@@ -25,6 +26,7 @@ namespace Content.Server.GameObjects.Components.Interactable
/// <summary> /// <summary>
/// Status of light, whether or not it is emitting light. /// Status of light, whether or not it is emitting light.
/// </summary> /// </summary>
[ViewVariables]
public bool Activated { get; private set; } = false; public bool Activated { get; private set; } = false;
public override void Initialize() public override void Initialize()

View File

@@ -1,6 +1,7 @@
using SS14.Shared.GameObjects; using SS14.Shared.GameObjects;
using SS14.Shared.Serialization; using SS14.Shared.Serialization;
using SS14.Shared.Utility; using SS14.Shared.Utility;
using SS14.Shared.ViewVariables;
using YamlDotNet.RepresentationModel; using YamlDotNet.RepresentationModel;
namespace Content.Server.GameObjects.Components.Interactable.Tools namespace Content.Server.GameObjects.Components.Interactable.Tools
@@ -10,6 +11,7 @@ namespace Content.Server.GameObjects.Components.Interactable.Tools
/// <summary> /// <summary>
/// For tool interactions that have a delay before action this will modify the rate, time to wait is divided by this value /// For tool interactions that have a delay before action this will modify the rate, time to wait is divided by this value
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float SpeedModifier public float SpeedModifier
{ {
get => _speedModifier; get => _speedModifier;

View File

@@ -5,6 +5,7 @@ using YamlDotNet.RepresentationModel;
using SS14.Server.GameObjects; using SS14.Server.GameObjects;
using Content.Server.GameObjects.EntitySystems; using Content.Server.GameObjects.EntitySystems;
using SS14.Shared.Serialization; using SS14.Shared.Serialization;
using SS14.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Interactable.Tools namespace Content.Server.GameObjects.Components.Interactable.Tools
{ {
@@ -20,6 +21,7 @@ namespace Content.Server.GameObjects.Components.Interactable.Tools
/// <summary> /// <summary>
/// Maximum fuel capacity the welder can hold /// Maximum fuel capacity the welder can hold
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float FuelCapacity public float FuelCapacity
{ {
get => _fuelCapacity; get => _fuelCapacity;
@@ -30,6 +32,7 @@ namespace Content.Server.GameObjects.Components.Interactable.Tools
/// <summary> /// <summary>
/// Fuel the welder has to do tasks /// Fuel the welder has to do tasks
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float Fuel public float Fuel
{ {
get => _fuel; get => _fuel;
@@ -50,6 +53,7 @@ namespace Content.Server.GameObjects.Components.Interactable.Tools
/// <summary> /// <summary>
/// Status of welder, whether it is ignited /// Status of welder, whether it is ignited
/// </summary> /// </summary>
[ViewVariables]
public bool Activated { get; private set; } = false; public bool Activated { get; private set; } = false;
//private string OnSprite { get; set; } //private string OnSprite { get; set; }

View File

@@ -9,6 +9,7 @@ using SS14.Shared.GameObjects;
using SS14.Shared.Interfaces.GameObjects; using SS14.Shared.Interfaces.GameObjects;
using SS14.Shared.Interfaces.Network; using SS14.Shared.Interfaces.Network;
using SS14.Shared.Log; using SS14.Shared.Log;
using SS14.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Mobs namespace Content.Server.GameObjects.Components.Mobs
{ {
@@ -23,11 +24,13 @@ namespace Content.Server.GameObjects.Components.Mobs
/// <summary> /// <summary>
/// The mind controlling this mob. Can be null. /// The mind controlling this mob. Can be null.
/// </summary> /// </summary>
[ViewVariables]
public Mind Mind { get; private set; } public Mind Mind { get; private set; }
/// <summary> /// <summary>
/// True if we have a mind, false otherwise. /// True if we have a mind, false otherwise.
/// </summary> /// </summary>
[ViewVariables]
public bool HasMind => Mind != null; public bool HasMind => Mind != null;
/// <summary> /// <summary>

View File

@@ -9,6 +9,7 @@ using SS14.Shared.Utility;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using SS14.Shared.ViewVariables;
using YamlDotNet.RepresentationModel; using YamlDotNet.RepresentationModel;
namespace Content.Server.GameObjects.Components.Power namespace Content.Server.GameObjects.Components.Power
@@ -23,6 +24,7 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary> /// <summary>
/// The method of draw we will try to use to place our load set via component parameter, defaults to using power providers /// The method of draw we will try to use to place our load set via component parameter, defaults to using power providers
/// </summary> /// </summary>
[ViewVariables]
public virtual DrawTypes DrawType public virtual DrawTypes DrawType
{ {
get => _drawType; get => _drawType;
@@ -33,14 +35,17 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary> /// <summary>
/// The power draw method we are currently connected to and using /// The power draw method we are currently connected to and using
/// </summary> /// </summary>
[ViewVariables]
public DrawTypes Connected { get; protected set; } = DrawTypes.None; public DrawTypes Connected { get; protected set; } = DrawTypes.None;
[ViewVariables]
public bool Powered { get; private set; } = false; public bool Powered { get; private set; } = false;
/// <summary> /// <summary>
/// Is an external power source currently available? /// Is an external power source currently available?
/// </summary> /// </summary>
[ViewVariables]
public bool ExternalPowered public bool ExternalPowered
{ {
get => _externalPowered; get => _externalPowered;
@@ -55,6 +60,7 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary> /// <summary>
/// Is an internal power source currently available? /// Is an internal power source currently available?
/// </summary> /// </summary>
[ViewVariables]
public bool InternalPowered public bool InternalPowered
{ {
get => _internalPowered; get => _internalPowered;
@@ -69,6 +75,7 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary> /// <summary>
/// Priority for powernet draw, lower will draw first, defined in powernet.cs /// Priority for powernet draw, lower will draw first, defined in powernet.cs
/// </summary> /// </summary>
[ViewVariables]
public virtual Powernet.Priority Priority public virtual Powernet.Priority Priority
{ {
get => _priority; get => _priority;
@@ -81,6 +88,7 @@ namespace Content.Server.GameObjects.Components.Power
/// Power load from this entity. /// Power load from this entity.
/// In Watts. /// In Watts.
/// </summary> /// </summary>
[ViewVariables]
public float Load public float Load
{ {
get => _load; get => _load;
@@ -98,6 +106,7 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary> /// <summary>
/// A power provider that will handle our load, if we are linked to any /// A power provider that will handle our load, if we are linked to any
/// </summary> /// </summary>
[ViewVariables]
public PowerProviderComponent Provider public PowerProviderComponent Provider
{ {
get => _provider; get => _provider;

View File

@@ -5,6 +5,7 @@ using SS14.Shared.Log;
using SS14.Shared.Serialization; using SS14.Shared.Serialization;
using SS14.Shared.Utility; using SS14.Shared.Utility;
using System; using System;
using SS14.Shared.ViewVariables;
using YamlDotNet.RepresentationModel; using YamlDotNet.RepresentationModel;
namespace Content.Server.GameObjects.Components.Power namespace Content.Server.GameObjects.Components.Power
@@ -20,6 +21,7 @@ namespace Content.Server.GameObjects.Components.Power
/// Power supply from this entity /// Power supply from this entity
/// </summary> /// </summary>
private float _supply = 1000; //arbitrary initial magic number to start private float _supply = 1000; //arbitrary initial magic number to start
[ViewVariables]
public float Supply public float Supply
{ {
get => _supply; get => _supply;

View File

@@ -5,6 +5,7 @@ using SS14.Shared.Interfaces.GameObjects.Components;
using SS14.Shared.IoC; using SS14.Shared.IoC;
using System; using System;
using System.Linq; using System.Linq;
using SS14.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Power namespace Content.Server.GameObjects.Components.Power
{ {
@@ -18,7 +19,8 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary> /// <summary>
/// The powernet this node is connected to /// The powernet this node is connected to
/// </summary> /// </summary>
public Powernet Parent; [ViewVariables]
public Powernet Parent { get; set; }
/// <summary> /// <summary>
/// An event handling when this node connects to a powernet /// An event handling when this node connects to a powernet

View File

@@ -9,6 +9,7 @@ using SS14.Shared.Utility;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using SS14.Shared.ViewVariables;
using YamlDotNet.RepresentationModel; using YamlDotNet.RepresentationModel;
namespace Content.Server.GameObjects.Components.Power namespace Content.Server.GameObjects.Components.Power
@@ -26,6 +27,7 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary> /// <summary>
/// Variable that determines the range that the power provider will try to supply power to /// Variable that determines the range that the power provider will try to supply power to
/// </summary> /// </summary>
[ViewVariables]
public int PowerRange public int PowerRange
{ {
get => _range; get => _range;
@@ -51,6 +53,7 @@ namespace Content.Server.GameObjects.Components.Power
private bool _mainBreaker = true; private bool _mainBreaker = true;
[ViewVariables(VVAccess.ReadWrite)]
public bool MainBreaker public bool MainBreaker
{ {
get => _mainBreaker; get => _mainBreaker;
@@ -76,6 +79,7 @@ namespace Content.Server.GameObjects.Components.Power
private float _theoreticalLoad = 0f; private float _theoreticalLoad = 0f;
[ViewVariables]
public float TheoreticalLoad public float TheoreticalLoad
{ {
get => _theoreticalLoad; get => _theoreticalLoad;

View File

@@ -5,6 +5,7 @@ using SS14.Shared.IoC;
using SS14.Shared.Serialization; using SS14.Shared.Serialization;
using SS14.Shared.Utility; using SS14.Shared.Utility;
using System; using System;
using SS14.Shared.ViewVariables;
using YamlDotNet.RepresentationModel; using YamlDotNet.RepresentationModel;
namespace Content.Server.GameObjects.Components.Power namespace Content.Server.GameObjects.Components.Power
@@ -23,6 +24,7 @@ namespace Content.Server.GameObjects.Components.Power
/// Maximum amount of energy the internal battery can store. /// Maximum amount of energy the internal battery can store.
/// In Joules. /// In Joules.
/// </summary> /// </summary>
[ViewVariables]
public float Capacity => _capacity; public float Capacity => _capacity;
private float _capacity = 10000; // Arbitrary value, replace. private float _capacity = 10000; // Arbitrary value, replace.
@@ -30,6 +32,7 @@ namespace Content.Server.GameObjects.Components.Power
/// Energy the battery is currently storing. /// Energy the battery is currently storing.
/// In Joules. /// In Joules.
/// </summary> /// </summary>
[ViewVariables]
public float Charge => _charge; public float Charge => _charge;
private float _charge = 0; private float _charge = 0;
@@ -37,6 +40,7 @@ namespace Content.Server.GameObjects.Components.Power
/// Rate at which energy will be taken to charge internal battery. /// Rate at which energy will be taken to charge internal battery.
/// In Watts. /// In Watts.
/// </summary> /// </summary>
[ViewVariables]
public float ChargeRate => _chargeRate; public float ChargeRate => _chargeRate;
private float _chargeRate = 1000; private float _chargeRate = 1000;
@@ -44,9 +48,11 @@ namespace Content.Server.GameObjects.Components.Power
/// Rate at which energy will be distributed to the powernet if needed. /// Rate at which energy will be distributed to the powernet if needed.
/// In Watts. /// In Watts.
/// </summary> /// </summary>
[ViewVariables]
public float DistributionRate => _distributionRate; public float DistributionRate => _distributionRate;
private float _distributionRate = 1000; private float _distributionRate = 1000;
[ViewVariables]
public bool Full => Charge >= Capacity; public bool Full => Charge >= Capacity;
private bool _chargepowernet = false; private bool _chargepowernet = false;
@@ -54,6 +60,7 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary> /// <summary>
/// Do we distribute power into the powernet from our stores if the powernet requires it? /// Do we distribute power into the powernet from our stores if the powernet requires it?
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public bool ChargePowernet public bool ChargePowernet
{ {
get => _chargepowernet; get => _chargepowernet;

View File

@@ -7,6 +7,7 @@ using System.Linq;
using SS14.Shared.Interfaces.GameObjects; using SS14.Shared.Interfaces.GameObjects;
using Content.Server.GameObjects.Components.Interactable.Tools; using Content.Server.GameObjects.Components.Interactable.Tools;
using SS14.Shared.Interfaces.GameObjects.Components; using SS14.Shared.Interfaces.GameObjects.Components;
using SS14.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Power namespace Content.Server.GameObjects.Components.Power
{ {
@@ -20,8 +21,10 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary> /// <summary>
/// The powernet this component is connected to /// The powernet this component is connected to
/// </summary> /// </summary>
public Powernet Parent; [ViewVariables]
public Powernet Parent { get; set; }
[ViewVariables]
public bool Regenerating { get; set; } = false; public bool Regenerating { get; set; } = false;
public override void Initialize() public override void Initialize()

View File

@@ -4,6 +4,7 @@ using SS14.Shared.IoC;
using SS14.Shared.Log; using SS14.Shared.Log;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using SS14.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Power namespace Content.Server.GameObjects.Components.Power
{ {
@@ -23,6 +24,7 @@ namespace Content.Server.GameObjects.Components.Power
/// <summary> /// <summary>
/// Unique identifier per powernet, used for debugging mostly. /// Unique identifier per powernet, used for debugging mostly.
/// </summary> /// </summary>
[ViewVariables]
public int Uid { get; } public int Uid { get; }
/// <summary> /// <summary>
@@ -41,6 +43,7 @@ namespace Content.Server.GameObjects.Components.Power
private readonly Dictionary<PowerGeneratorComponent, float> GeneratorList = private readonly Dictionary<PowerGeneratorComponent, float> GeneratorList =
new Dictionary<PowerGeneratorComponent, float>(); new Dictionary<PowerGeneratorComponent, float>();
[ViewVariables]
public int GeneratorCount => GeneratorList.Count; public int GeneratorCount => GeneratorList.Count;
/// <summary> /// <summary>
@@ -49,6 +52,7 @@ namespace Content.Server.GameObjects.Components.Power
private readonly SortedSet<PowerDeviceComponent> DeviceLoadList = private readonly SortedSet<PowerDeviceComponent> DeviceLoadList =
new SortedSet<PowerDeviceComponent>(new DevicePriorityCompare()); new SortedSet<PowerDeviceComponent>(new DevicePriorityCompare());
[ViewVariables]
public int DeviceCount => DeviceLoadList.Count; public int DeviceCount => DeviceLoadList.Count;
/// <summary> /// <summary>
@@ -61,6 +65,7 @@ namespace Content.Server.GameObjects.Components.Power
/// </summary> /// </summary>
private readonly List<PowerStorageComponent> PowerStorageSupplierList = new List<PowerStorageComponent>(); private readonly List<PowerStorageComponent> PowerStorageSupplierList = new List<PowerStorageComponent>();
[ViewVariables]
public int PowerStorageSupplierCount => PowerStorageSupplierList.Count; public int PowerStorageSupplierCount => PowerStorageSupplierList.Count;
/// <summary> /// <summary>
@@ -68,23 +73,27 @@ namespace Content.Server.GameObjects.Components.Power
/// </summary> /// </summary>
private readonly List<PowerStorageComponent> PowerStorageConsumerList = new List<PowerStorageComponent>(); private readonly List<PowerStorageComponent> PowerStorageConsumerList = new List<PowerStorageComponent>();
[ViewVariables]
public int PowerStorageConsumerCount => PowerStorageConsumerList.Count; public int PowerStorageConsumerCount => PowerStorageConsumerList.Count;
/// <summary> /// <summary>
/// Static counter of all continuous load placed from devices on this power network. /// Static counter of all continuous load placed from devices on this power network.
/// In Watts. /// In Watts.
/// </summary> /// </summary>
[ViewVariables]
public float Load { get; private set; } = 0; public float Load { get; private set; } = 0;
/// <summary> /// <summary>
/// Static counter of all continuous supply from generators on this power network. /// Static counter of all continuous supply from generators on this power network.
/// In Watts. /// In Watts.
/// </summary> /// </summary>
[ViewVariables]
public float Supply { get; private set; } = 0; public float Supply { get; private set; } = 0;
/// <summary> /// <summary>
/// Variable that causes powernet to be regenerated from its wires during the next update cycle. /// Variable that causes powernet to be regenerated from its wires during the next update cycle.
/// </summary> /// </summary>
[ViewVariables]
public bool Dirty { get; set; } = false; public bool Dirty { get; set; } = false;
// These are stats for power monitoring equipment such as APCs. // These are stats for power monitoring equipment such as APCs.
@@ -93,6 +102,7 @@ namespace Content.Server.GameObjects.Components.Power
/// The total supply that was available to us last tick. /// The total supply that was available to us last tick.
/// This does not mean it was used. /// This does not mean it was used.
/// </summary> /// </summary>
[ViewVariables]
public float LastTotalAvailable { get; private set; } public float LastTotalAvailable { get; private set; }
/// <summary> /// <summary>
@@ -102,6 +112,7 @@ namespace Content.Server.GameObjects.Components.Power
/// If avail &lt; demand, this will be just &lt;= than the actual avail /// If avail &lt; demand, this will be just &lt;= than the actual avail
/// (e.g. if all machines need 100 W but there's 20 W excess, the 20 W will be avail but not drawn.) /// (e.g. if all machines need 100 W but there's 20 W excess, the 20 W will be avail but not drawn.)
/// </summary> /// </summary>
[ViewVariables]
public float LastTotalDraw { get; private set; } public float LastTotalDraw { get; private set; }
/// <summary> /// <summary>
@@ -111,6 +122,7 @@ namespace Content.Server.GameObjects.Components.Power
/// As such, this will quite abruptly shoot up if available rises to cover supplier charge demand too. /// As such, this will quite abruptly shoot up if available rises to cover supplier charge demand too.
/// </summary> /// </summary>
/// <seealso cref="LastTotalDemandWithSuppliers"/> /// <seealso cref="LastTotalDemandWithSuppliers"/>
[ViewVariables]
public float LastTotalDemand { get; private set; } public float LastTotalDemand { get; private set; }
/// <summary> /// <summary>
@@ -118,11 +130,13 @@ namespace Content.Server.GameObjects.Components.Power
/// This does not mean it was full filled in practice. /// This does not mean it was full filled in practice.
/// See <see cref="LastTotalDemand"/> for the difference. /// See <see cref="LastTotalDemand"/> for the difference.
/// </summary> /// </summary>
[ViewVariables]
public float LastTotalDemandWithSuppliers { get; private set; } public float LastTotalDemandWithSuppliers { get; private set; }
/// <summary> /// <summary>
/// The amount of power that we are lacking to properly power everything (excluding storage supplier charging). /// The amount of power that we are lacking to properly power everything (excluding storage supplier charging).
/// </summary> /// </summary>
[ViewVariables]
public float Lack => Math.Max(0, LastTotalDemand - LastTotalAvailable); public float Lack => Math.Max(0, LastTotalDemand - LastTotalAvailable);
/// <summary> /// <summary>
@@ -131,6 +145,7 @@ namespace Content.Server.GameObjects.Components.Power
/// It is ALSO not implied that if this is &gt; 0, that we have sufficient power for everything. /// It is ALSO not implied that if this is &gt; 0, that we have sufficient power for everything.
/// See the doc comment on <see cref="LastTotalDraw"/>. /// See the doc comment on <see cref="LastTotalDraw"/>.
/// </summary> /// </summary>
[ViewVariables]
public float Excess => Math.Max(0, LastTotalAvailable - LastTotalDraw); public float Excess => Math.Max(0, LastTotalAvailable - LastTotalDraw);
public void Update(float frameTime) public void Update(float frameTime)

View File

@@ -5,6 +5,7 @@ using SS14.Shared.Interfaces.GameObjects;
using SS14.Shared.Interfaces.Reflection; using SS14.Shared.Interfaces.Reflection;
using SS14.Shared.IoC; using SS14.Shared.IoC;
using SS14.Shared.Serialization; using SS14.Shared.Serialization;
using SS14.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Stack namespace Content.Server.GameObjects.Components.Stack
{ {
@@ -17,6 +18,7 @@ namespace Content.Server.GameObjects.Components.Stack
public override string Name => "Stack"; public override string Name => "Stack";
[ViewVariables]
public int Count public int Count
{ {
get => _count; get => _count;
@@ -29,9 +31,14 @@ namespace Content.Server.GameObjects.Components.Stack
} }
} }
} }
[ViewVariables]
public int MaxCount { get => _maxCount; private set => _maxCount = value; } public int MaxCount { get => _maxCount; private set => _maxCount = value; }
[ViewVariables]
public int AvailableSpace => MaxCount - Count; public int AvailableSpace => MaxCount - Count;
[ViewVariables]
public object StackType { get; private set; } public object StackType { get; private set; }
public void Add(int amount) public void Add(int amount)

View File

@@ -6,6 +6,7 @@ using SS14.Shared.Utility;
using YamlDotNet.RepresentationModel; using YamlDotNet.RepresentationModel;
using Content.Shared.GameObjects; using Content.Shared.GameObjects;
using SS14.Shared.Serialization; using SS14.Shared.Serialization;
using SS14.Shared.ViewVariables;
namespace Content.Server.GameObjects namespace Content.Server.GameObjects
{ {
@@ -23,6 +24,7 @@ namespace Content.Server.GameObjects
public override uint? NetID => ContentNetIDs.TEMPERATURE; public override uint? NetID => ContentNetIDs.TEMPERATURE;
//TODO: should be programmatic instead of how it currently is //TODO: should be programmatic instead of how it currently is
[ViewVariables]
public float CurrentTemperature { get; private set; } = PhysicalConstants.ZERO_CELCIUS; public float CurrentTemperature { get; private set; } = PhysicalConstants.ZERO_CELCIUS;
float _fireDamageThreshold = 0; float _fireDamageThreshold = 0;

View File

@@ -5,6 +5,7 @@ using SS14.Server.Interfaces.Player;
using SS14.Shared.Interfaces.GameObjects; using SS14.Shared.Interfaces.GameObjects;
using SS14.Shared.IoC; using SS14.Shared.IoC;
using SS14.Shared.Network; using SS14.Shared.Network;
using SS14.Shared.ViewVariables;
namespace Content.Server.Mobs namespace Content.Server.Mobs
{ {
@@ -14,7 +15,7 @@ namespace Content.Server.Mobs
/// <remarks> /// <remarks>
/// Think of it like this: if a player is supposed to have their memories, /// Think of it like this: if a player is supposed to have their memories,
/// their mind follows along. /// their mind follows along.
/// ///
/// Things such as respawning do not follow, because you're a new character. /// Things such as respawning do not follow, because you're a new character.
/// Getting borged, cloned, turned into a catbeast, etc... will keep it following you. /// Getting borged, cloned, turned into a catbeast, etc... will keep it following you.
/// </remarks> /// </remarks>
@@ -184,7 +185,7 @@ namespace Content.Server.Mobs
throw new ArgumentException("That entity already has a mind.", nameof(entity)); throw new ArgumentException("That entity already has a mind.", nameof(entity));
} }
} }
CurrentMob?.InternalEjectMind(); CurrentMob?.InternalEjectMind();
CurrentMob = component; CurrentMob = component;
CurrentMob?.InternalAssignMind(this); CurrentMob?.InternalAssignMind(this);

View File

@@ -1,6 +1,7 @@
using Content.Server.Mobs; using Content.Server.Mobs;
using SS14.Server.Interfaces.Player; using SS14.Server.Interfaces.Player;
using SS14.Shared.Network; using SS14.Shared.Network;
using SS14.Shared.ViewVariables;
namespace Content.Server.Players namespace Content.Server.Players
{ {
@@ -13,11 +14,13 @@ namespace Content.Server.Players
/// <summary> /// <summary>
/// The session ID of the player owning this data. /// The session ID of the player owning this data.
/// </summary> /// </summary>
[ViewVariables]
public NetSessionId SessionId { get; } public NetSessionId SessionId { get; }
/// <summary> /// <summary>
/// The currently occupied mind of the player owning this data. /// The currently occupied mind of the player owning this data.
/// </summary> /// </summary>
[ViewVariables]
public Mind Mind { get; set; } public Mind Mind { get; set; }
public PlayerData(NetSessionId sessionId) public PlayerData(NetSessionId sessionId)

View File

@@ -32,3 +32,4 @@
- whisper - whisper
- me - me
- ooc - ooc
CanViewVar: true

2
engine

Submodule engine updated: 6e95476156...523e4d8c49