2020-08-19 10:23:20 -04:00
|
|
|
|
using System.Collections.Generic;
|
2020-09-02 06:07:54 -04:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using Content.Server.GameObjects.Components.Medical;
|
|
|
|
|
|
using Content.Server.Mobs;
|
2020-10-30 01:05:18 +01:00
|
|
|
|
using Content.Shared.GameTicking;
|
2020-08-19 10:23:20 -04:00
|
|
|
|
using Robust.Shared.GameObjects.Systems;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.GameObjects.EntitySystems
|
|
|
|
|
|
{
|
2020-10-30 01:05:18 +01:00
|
|
|
|
internal sealed class CloningSystem : EntitySystem, IResettingEntitySystem
|
2020-08-19 10:23:20 -04:00
|
|
|
|
{
|
2020-09-02 06:07:54 -04:00
|
|
|
|
public override void Update(float frameTime)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var comp in ComponentManager.EntityQuery<CloningPodComponent>())
|
|
|
|
|
|
{
|
|
|
|
|
|
comp.Update(frameTime);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-08-19 10:23:20 -04:00
|
|
|
|
|
2020-11-27 11:00:49 +01:00
|
|
|
|
public readonly Dictionary<int, Mind> Minds = new();
|
2020-09-02 06:07:54 -04:00
|
|
|
|
|
2020-10-30 01:05:18 +01:00
|
|
|
|
public void AddToDnaScans(Mind mind)
|
2020-08-19 10:23:20 -04:00
|
|
|
|
{
|
2020-09-02 06:07:54 -04:00
|
|
|
|
if (!Minds.ContainsValue(mind))
|
2020-08-19 10:23:20 -04:00
|
|
|
|
{
|
2020-09-02 06:07:54 -04:00
|
|
|
|
Minds.Add(Minds.Count(), mind);
|
2020-08-19 10:23:20 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-10-30 01:05:18 +01:00
|
|
|
|
public bool HasDnaScan(Mind mind)
|
2020-09-02 06:07:54 -04:00
|
|
|
|
{
|
|
|
|
|
|
return Minds.ContainsValue(mind);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-10-30 01:05:18 +01:00
|
|
|
|
public Dictionary<int, string> GetIdToUser()
|
2020-08-19 10:23:20 -04:00
|
|
|
|
{
|
2020-09-02 06:07:54 -04:00
|
|
|
|
return Minds.ToDictionary(m => m.Key, m => m.Value.CharacterName);
|
2020-08-19 10:23:20 -04:00
|
|
|
|
}
|
2020-10-30 01:05:18 +01:00
|
|
|
|
|
|
|
|
|
|
public void Reset()
|
|
|
|
|
|
{
|
|
|
|
|
|
Minds.Clear();
|
|
|
|
|
|
}
|
2020-08-19 10:23:20 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|