Files
tbd-station-14/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs
ZelteHonor b2e2aef78d Rider static analysis (#433)
* Non-accessed local variable

* Merge cast and type checks.

* StringComparison.Ordinal added for better culture support

* Supposed code improvement in launcher. Remove unused code.

* Update ExplosionHelper.cs

Unintentional change.

* Optimized Import

* Add Robust.Shared.Utility import where it was deleted

* Other random suggestion

* Improve my comment
2019-11-13 23:37:46 +01:00

42 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects
{
public abstract class SharedDamageableComponent : Component
{
public override string Name => "Damageable";
public sealed override uint? NetID => ContentNetIDs.DAMAGEABLE;
public sealed override Type StateType => typeof(DamageComponentState);
}
// The IDs of the items get synced over the network.
[Serializable, NetSerializable]
public class DamageComponentState : ComponentState
{
public Dictionary<DamageType, int> CurrentDamage = new Dictionary<DamageType, int>();
public DamageComponentState(Dictionary<DamageType, int> damage) : base(ContentNetIDs.DAMAGEABLE)
{
CurrentDamage = damage;
}
}
/// <summary>
/// Damage types used in-game.
/// Total should never be used directly - it's a derived value.
/// </summary>
public enum DamageType
{
Total,
Brute,
Heat,
Cold,
Acid,
Toxic,
Electric
}
}