<commit_before>﻿using Content.Server.Interfaces.GameObjects;
using System;
using System.Collections.Generic;
using Robust.Shared.Maths;
using Robust.Shared.GameObjects;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
using Content.Server.Interfaces;
using Content.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;

namespace Content.Server.GameObjects
{
    //TODO: add support for component add/remove

    /// <summary>
    /// A component that handles receiving damage and healing,
    /// as well as informing other components of it.
    /// </summary>
    public class DamageableComponent : SharedDamageableComponent, IDamageableComponent
    {
        /// <inheritdoc />
        public override string Name => "Damageable";

        /// <summary>
        /// The resistance set of this object.
        /// Affects receiving damage of various types.
        /// </summary>
        [ViewVariables]
        public ResistanceSet Resistances { get; private set; }

        public IReadOnlyDictionary<DamageType, int> CurrentDamage => _currentDamage;
        private Dictionary<DamageType, int> _currentDamage = new Dictionary<DamageType, int>();

        Dictionary<DamageType, List<DamageThreshold>> Thresholds = new Dictionary<DamageType, List<DamageThreshold>>();

        public event EventHandler<DamageThresholdPassedEventArgs> DamageThresholdPassed;

        public override ComponentState GetComponentState()<commit_msg>Make it possible to VV DamageableComponent's damage.<commit_after>﻿using Content.Server.Interfaces.GameObjects;
using System;
using System.Collections.Generic;
using Robust.Shared.Maths;
using Robust.Shared.GameObjects;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
using Content.Server.Interfaces;
using Content.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;

namespace Content.Server.GameObjects
{
    //TODO: add support for component add/remove

    /// <summary>
    /// A component that handles receiving damage and healing,
    /// as well as informing other components of it.
    /// </summary>
    public class DamageableComponent : SharedDamageableComponent, IDamageableComponent
    {
        /// <inheritdoc />
        public override string Name => "Damageable";

        /// <summary>
        /// The resistance set of this object.
        /// Affects receiving damage of various types.
        /// </summary>
        [ViewVariables]
        public ResistanceSet Resistances { get; private set; }

        [ViewVariables]
        public IReadOnlyDictionary<DamageType, int> CurrentDamage => _currentDamage;
        private Dictionary<DamageType, int> _currentDamage = new Dictionary<DamageType, int>();

        Dictionary<DamageType, List<DamageThreshold>> Thresholds = new Dictionary<DamageType, List<DamageThreshold>>();

        public event EventHandler<DamageThresholdPassedEventArgs> DamageThresholdPassed;

        public override ComponentState GetComponentState()
{'fraction_non_alphanumeric': 0.0901612372490951, 'fraction_numerical': 0.0, 'mean_word_length': 3.6130500758725344, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3956606', 'n_tokens_mistral': 787, 'n_tokens_neox': 766, 'n_words': 218}