Re-organize all projects (#4166)

This commit is contained in:
DrSmugleaf
2021-06-09 22:19:39 +02:00
committed by GitHub
parent 9f50e4061b
commit ff1a2d97ea
1773 changed files with 5258 additions and 5508 deletions

View File

@@ -0,0 +1,29 @@
#nullable enable
using Content.Shared.DragDrop;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Nutrition.Components
{
/// <summary>
/// Indicates that the entity can be thrown on a kitchen spike for butchering.
/// </summary>
[RegisterComponent]
public class SharedButcherableComponent : Component, IDraggable
{
public override string Name => "Butcherable";
[ViewVariables]
public string? MeatPrototype => _meatPrototype;
[ViewVariables]
[DataField("meat")]
private string? _meatPrototype;
public bool CanDrop(CanDropEvent args)
{
return true;
}
}
}

View File

@@ -0,0 +1,18 @@
#nullable enable
using System;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Shared.Nutrition.Components
{
public class SharedCreamPiedComponent : Component
{
public override string Name => "CreamPied";
}
[Serializable, NetSerializable]
public enum CreamPiedVisuals
{
Creamed,
}
}

View File

@@ -0,0 +1,29 @@
#nullable enable
using System;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Shared.Nutrition.Components
{
public abstract class SharedFoodContainerComponent : Component
{
}
[NetSerializable, Serializable]
public enum FoodContainerVisualMode
{
/// <summary>
/// Discrete: 50 eggs in a carton -> down to 25, will show 12/12 until it gets below max
/// Rounded: 50 eggs in a carton -> down to 25, will round it to 6 of 12
/// </summary>
Discrete,
Rounded,
}
[NetSerializable, Serializable]
public enum FoodContainerVisuals
{
Capacity,
Current,
}
}

View File

@@ -0,0 +1,17 @@
#nullable enable
using System;
using Robust.Shared.Serialization;
namespace Content.Shared.Nutrition.Components
{
public class SharedFoodComponent
{
// TODO: Remove maybe? Add visualizer for food
[Serializable, NetSerializable]
public enum FoodVisuals
{
Visual,
MaxUses,
}
}
}

View File

@@ -0,0 +1,65 @@
#nullable enable
using System;
using Content.Shared.Movement.Components;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Nutrition.Components
{
public abstract class SharedHungerComponent : Component, IMoveSpeedModifier
{
public sealed override string Name => "Hunger";
public sealed override uint? NetID => ContentNetIDs.HUNGER;
[ViewVariables]
public abstract HungerThreshold CurrentHungerThreshold { get; }
float IMoveSpeedModifier.WalkSpeedModifier
{
get
{
if (CurrentHungerThreshold == HungerThreshold.Starving)
{
return 0.75f;
}
return 1.0f;
}
}
float IMoveSpeedModifier.SprintSpeedModifier
{
get
{
if (CurrentHungerThreshold == HungerThreshold.Starving)
{
return 0.75f;
}
return 1.0f;
}
}
[Serializable, NetSerializable]
protected sealed class HungerComponentState : ComponentState
{
public HungerThreshold CurrentThreshold { get; }
public HungerComponentState(HungerThreshold currentThreshold) : base(ContentNetIDs.HUNGER)
{
CurrentThreshold = currentThreshold;
}
}
}
[Serializable, NetSerializable]
public enum HungerThreshold : byte
{
Overfed,
Okay,
Peckish,
Starving,
Dead,
}
}

View File

@@ -0,0 +1,66 @@
#nullable enable
using System;
using Content.Shared.Movement.Components;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Nutrition.Components
{
public abstract class SharedThirstComponent : Component, IMoveSpeedModifier
{
public sealed override string Name => "Thirst";
public sealed override uint? NetID => ContentNetIDs.THIRST;
[ViewVariables]
public abstract ThirstThreshold CurrentThirstThreshold { get; }
float IMoveSpeedModifier.SprintSpeedModifier
{
get
{
if (CurrentThirstThreshold == ThirstThreshold.Parched)
{
return 0.75f;
}
return 1.0f;
}
}
float IMoveSpeedModifier.WalkSpeedModifier
{
get
{
if (CurrentThirstThreshold == ThirstThreshold.Parched)
{
return 0.75f;
}
return 1.0f;
}
}
[Serializable, NetSerializable]
protected sealed class ThirstComponentState : ComponentState
{
public ThirstThreshold CurrentThreshold { get; }
public ThirstComponentState(ThirstThreshold currentThreshold) : base(ContentNetIDs.THIRST)
{
CurrentThreshold = currentThreshold;
}
}
}
[NetSerializable, Serializable]
public enum ThirstThreshold : byte
{
// Hydrohomies
OverHydrated,
Okay,
Thirsty,
Parched,
Dead,
}
}