* Update RobustToolbox * Transition direct type usages * More updates * Fix invalid use of to map * Update RobustToolbox * Fix dropping items * Rename name usages of "GridCoordinates" to "EntityCoordinates" * Revert "Update RobustToolbox" This reverts commit 9f334a17c5908ded0043a63158bb671e4aa3f346. * Revert "Update RobustToolbox" This reverts commit 3a9c8cfa3606fa501aa84407796d2ad920853a09. # Conflicts: # RobustToolbox * Fix cursed IMapGrid method usage. * GridTileLookupTest now uses EntityCoordinates Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com> Co-authored-by: Víctor Aguilera Puerto <zddm@outlook.es>
63 lines
1.6 KiB
C#
63 lines
1.6 KiB
C#
using System;
|
|
using JetBrains.Annotations;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Interfaces.GameObjects;
|
|
using Robust.Shared.Map;
|
|
|
|
namespace Content.Shared.Interfaces.GameObjects.Components
|
|
{
|
|
/// <summary>
|
|
/// This interface gives components behavior when landing after being thrown.
|
|
/// </summary>
|
|
public interface ILand
|
|
{
|
|
void Land(LandEventArgs eventArgs);
|
|
}
|
|
|
|
public class LandEventArgs : EventArgs
|
|
{
|
|
public LandEventArgs(IEntity user, EntityCoordinates landingLocation)
|
|
{
|
|
User = user;
|
|
LandingLocation = landingLocation;
|
|
}
|
|
|
|
public IEntity User { get; }
|
|
public EntityCoordinates LandingLocation { get; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Raised when an entity that was thrown lands.
|
|
/// </summary>
|
|
[PublicAPI]
|
|
public class LandMessage : EntitySystemMessage
|
|
{
|
|
/// <summary>
|
|
/// If this message has already been "handled" by a previous system.
|
|
/// </summary>
|
|
public bool Handled { get; set; }
|
|
|
|
/// <summary>
|
|
/// Entity that threw the item.
|
|
/// </summary>
|
|
public IEntity User { get; }
|
|
|
|
/// <summary>
|
|
/// Item that was thrown.
|
|
/// </summary>
|
|
public IEntity Thrown { get; }
|
|
|
|
/// <summary>
|
|
/// Location where the item landed.
|
|
/// </summary>
|
|
public EntityCoordinates LandLocation { get; }
|
|
|
|
public LandMessage(IEntity user, IEntity thrown, EntityCoordinates landLocation)
|
|
{
|
|
User = user;
|
|
Thrown = thrown;
|
|
LandLocation = landLocation;
|
|
}
|
|
}
|
|
}
|