Interactable component system. (#9)

* InteractableComponent v1. Broken edition

* It works!
This commit is contained in:
Pieter-Jan Briers
2017-10-06 21:05:21 +02:00
committed by GitHub
parent 8c1fa84c6e
commit 7597cd9172
8 changed files with 174 additions and 22 deletions

View File

@@ -0,0 +1,48 @@
using SS14.Shared.Interfaces.GameObjects;
using System;
namespace Content.Server.Interfaces.GameObjects
{
public interface IInteractableComponent : IComponent
{
/// <summary>
/// Invoked when an entity is clicked with an empty hand.
/// </summary>
event EventHandler<AttackHandEventArgs> OnAttackHand;
/// <summary>
/// Invoked when an entity is clicked with an item.
/// </summary>
event EventHandler<AttackByEventArgs> OnAttackBy;
}
public class AttackByEventArgs : EventArgs
{
public readonly IEntity Target;
public readonly IEntity User;
public readonly IItemComponent Item;
public readonly string HandIndex;
public AttackByEventArgs(IEntity target, IEntity user, IItemComponent item, string handIndex)
{
Target = target;
User = user;
Item = item;
HandIndex = handIndex;
}
}
public class AttackHandEventArgs : EventArgs
{
public readonly IEntity Target;
public readonly IEntity User;
public readonly string HandIndex;
public AttackHandEventArgs(IEntity target, IEntity user, string handIndex)
{
Target = target;
User = user;
HandIndex = handIndex;
}
}
}