Revert "Refactor Damage to use Protoypes (#4262)"

This reverts commit 20bf5739a9.
This commit is contained in:
Silver
2021-08-24 00:50:39 -06:00
committed by Silver
parent 20bf5739a9
commit e708091518
121 changed files with 711 additions and 10237 deletions

View File

@@ -1,22 +1,9 @@
<<<<<<< HEAD
<<<<<<< refs/remotes/origin/master
<<<<<<< refs/remotes/origin/master
using System.Collections.Generic;
using Content.Server.Atmos.Components;
=======
#nullable enable
using System.Collections.Generic;
>>>>>>> Merge fixes
=======
using System.Collections.Generic;
>>>>>>> Refactor damageablecomponent update (#4406)
=======
using System.Collections.Generic;
>>>>>>> refactor-damageablecomponent
using System.Linq;
using Content.Server.Atmos.Components;
using Content.Shared.Damage;
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Resistances;
using Content.Shared.GameTicking;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
@@ -56,9 +43,8 @@ namespace Content.Server.Damage
if (entity.TryGetComponent(out IDamageableComponent? damageable))
{
damageable.SupportedDamageTypes.Clear();
damageable.FullySupportedDamageGroups.Clear();
damageable.ApplicableDamageGroups.Clear();
damageable.SupportedTypes.Clear();
damageable.SupportedClasses.Clear();
}
return true;
@@ -83,33 +69,14 @@ namespace Content.Server.Damage
if (entity.TryGetComponent(out IDamageableComponent? damageable))
{
if (old.SupportedDamageTypes != null)
<<<<<<< HEAD
if (old.SupportedTypes != null)
{
damageable.SupportedDamageTypes.UnionWith(old.SupportedDamageTypes);
damageable.SupportedTypes.UnionWith(old.SupportedTypes);
}
if (old.SupportedDamageGroups != null)
if (old.SupportedClasses != null)
{
damageable.FullySupportedDamageGroups.UnionWith(old.SupportedDamageGroups);
}
if (old.ApplicableDamageGroups != null)
{
=======
{
damageable.SupportedDamageTypes.UnionWith(old.SupportedDamageTypes);
}
if (old.SupportedDamageGroups != null)
{
damageable.FullySupportedDamageGroups.UnionWith(old.SupportedDamageGroups);
}
if (old.ApplicableDamageGroups != null)
{
>>>>>>> refactor-damageablecomponent
damageable.ApplicableDamageGroups.UnionWith(old.ApplicableDamageGroups);
damageable.SupportedClasses.UnionWith(old.SupportedClasses);
}
}
@@ -144,9 +111,8 @@ namespace Content.Server.Damage
if (entity.TryGetComponent(out IDamageableComponent? damageable))
{
SupportedDamageTypes = damageable.SupportedDamageTypes.ToHashSet();
SupportedDamageGroups = damageable.FullySupportedDamageGroups.ToHashSet();
ApplicableDamageGroups = damageable.ApplicableDamageGroups.ToHashSet();
SupportedTypes = damageable.SupportedTypes.ToHashSet();
SupportedClasses = damageable.SupportedClasses.ToHashSet();
}
}
@@ -154,11 +120,9 @@ namespace Content.Server.Damage
public bool MovedByPressure { get; }
public HashSet<DamageTypePrototype>? SupportedDamageTypes { get; }
public HashSet<DamageType>? SupportedTypes { get; }
public HashSet<DamageGroupPrototype>? SupportedDamageGroups { get; }
public HashSet<DamageGroupPrototype>? ApplicableDamageGroups { get; }
public HashSet<DamageClass>? SupportedClasses { get; }
}
}
}