using System;
using System.Collections.Generic;
using Artemis.Core.Events;
namespace Artemis.Core;
///
/// Represents a pin containing a value on a
///
public interface IPin
{
///
/// Gets the node the pin belongs to
///
INode Node { get; }
///
/// Gets or sets the name of the pin
///
string Name { get; set; }
///
/// Gets the direction of the pin
///
PinDirection Direction { get; }
///
/// Gets the type of value the pin holds
///
Type Type { get; }
///
/// Gets a boolean indicating whether the type of this pin is numeric.
///
bool IsNumeric { get; }
///
/// Gets the value the pin holds
///
object? PinValue { get; }
///
/// Gets a read only list of pins this pin is connected to
///
IReadOnlyList ConnectedTo { get; }
///
/// Gets or sets a boolean indicating whether this pin is evaluated or not
///
bool IsEvaluated { get; set; }
///
/// Occurs when the pin connects to another pin
///
event EventHandler> PinConnected;
///
/// Occurs when the pin disconnects from another pin
///
event EventHandler> PinDisconnected;
///
/// Resets the pin, causing it to re-evaluate the next time its value is requested
///
void Reset();
///
/// Connects the pin to the provided
///
/// The pin to connect this pin to
void ConnectTo(IPin pin);
///
/// Disconnects the pin to the provided
///
/// The pin to disconnect this pin to
void DisconnectFrom(IPin pin);
///
/// Disconnects all pins this pin is connected to
///
void DisconnectAll();
///
/// Determines whether this pin is compatible with the given type
///
/// The type to check for compatibility
///
/// A boolean indicating whether or not enums should be exactly equal or just both be
/// enums
///
/// if the type is compatible, otherwise .
public bool IsTypeCompatible(Type type, bool forgivingEnumMatching = true);
}