Refactor a bunch of stuff.
This commit is contained in:
@@ -46,119 +46,6 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
public IEntity AttackWith { get; set; }
|
||||
}
|
||||
|
||||
#region Tools
|
||||
|
||||
public class ToolActEventArgs : EventArgs
|
||||
{
|
||||
public IEntity User { get; set; }
|
||||
public GridCoordinates ClickLocation { get; set; }
|
||||
public IEntity AttackWith { get; set; }
|
||||
public ToolComponent ToolComponent => AttackWith.GetComponent<ToolComponent>();
|
||||
public virtual Tool Behavior { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This interface gives components behavior when being clicked on or "attacked" by a user with a wrench in their hand
|
||||
/// </summary>
|
||||
public interface IWrenchAct
|
||||
{
|
||||
/// <summary>
|
||||
/// Called when using a wrench on an entity
|
||||
/// </summary>
|
||||
bool WrenchAct(WrenchActEventArgs eventArgs);
|
||||
}
|
||||
|
||||
public class WrenchActEventArgs : ToolActEventArgs
|
||||
{
|
||||
public override Tool Behavior => Tool.Wrench;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This interface gives components behavior when being clicked on or "attacked" by a user with a crowbar in their hand
|
||||
/// </summary>
|
||||
public interface ICrowbarAct
|
||||
{
|
||||
/// <summary>
|
||||
/// Called when using a wrench on an entity
|
||||
/// </summary>
|
||||
bool CrowbarAct(CrowbarActEventArgs eventArgs);
|
||||
}
|
||||
|
||||
public class CrowbarActEventArgs : ToolActEventArgs
|
||||
{
|
||||
public override Tool Behavior => Tool.Crowbar;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This interface gives components behavior when being clicked on or "attacked" by a user with a screwdriver in their hand
|
||||
/// </summary>
|
||||
public interface IScrewdriverAct
|
||||
{
|
||||
/// <summary>
|
||||
/// Called when using a wrench on an entity
|
||||
/// </summary>
|
||||
bool ScrewdriverAct(ScrewdriverActEventArgs eventArgs);
|
||||
}
|
||||
|
||||
public class ScrewdriverActEventArgs : ToolActEventArgs
|
||||
{
|
||||
public override Tool Behavior => Tool.Screwdriver;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This interface gives components behavior when being clicked on or "attacked" by a user with a wirecutter in their hand
|
||||
/// </summary>
|
||||
public interface IWirecutterAct
|
||||
{
|
||||
/// <summary>
|
||||
/// Called when using a wrench on an entity
|
||||
/// </summary>
|
||||
bool WirecutterAct(WirecutterActEventArgs eventArgs);
|
||||
}
|
||||
|
||||
public class WirecutterActEventArgs : ToolActEventArgs
|
||||
{
|
||||
public override Tool Behavior => Tool.Wirecutter;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This interface gives components behavior when being clicked on or "attacked" by a user with a welder in their hand
|
||||
/// </summary>
|
||||
public interface IWelderAct
|
||||
{
|
||||
/// <summary>
|
||||
/// Called when using a wrench on an entity
|
||||
/// </summary>
|
||||
bool WelderAct(WelderActEventArgs eventArgs);
|
||||
}
|
||||
|
||||
public class WelderActEventArgs : ToolActEventArgs
|
||||
{
|
||||
public override Tool Behavior => Tool.Welder;
|
||||
public WelderComponent WelderComponent => (WelderComponent)ToolComponent;
|
||||
public bool Lit { get; set; }
|
||||
public float Fuel { get; set; }
|
||||
public float FuelCapacity { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This interface gives components behavior when being clicked on or "attacked" by a user with a multitool in their hand
|
||||
/// </summary>
|
||||
public interface IMultitoolAct
|
||||
{
|
||||
/// <summary>
|
||||
/// Called when using a wrench on an entity
|
||||
/// </summary>
|
||||
bool MultitoolAct(MultitoolActEventArgs eventArgs);
|
||||
}
|
||||
|
||||
public class MultitoolActEventArgs : ToolActEventArgs
|
||||
{
|
||||
public override Tool Behavior => Tool.Multitool;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// This interface gives components behavior when being clicked on or "attacked" by a user with an empty hand
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user