Show / Hide Table of Contents

    Class Operation

    Class that represents a common base between game operations.

    Inheritance
    System.Object
    Priority_Queue.FastPriorityQueueNode
    Priority_Queue.StablePriorityQueueNode
    BaseEvent
    Operation
    AttackOrchestratorOperation
    AutoWalkOrchestratorOperation
    BasicAttackOperation
    ChangeModesOperation
    ElevatedOperation
    LookAtOperation
    MovementOperation
    SpeechOperation
    StatChangeOperation
    TurnToDirectionOperation
    Implements
    System.IEquatable<BaseEvent>
    IOperation
    IEvent
    Inherited Members
    BaseEvent.Cancelled
    BaseEvent.Expedited
    BaseEvent.Completed
    BaseEvent.EventId
    BaseEvent.RequestorId
    BaseEvent.RepeatAfter
    BaseEvent.HasCancellationHandler
    BaseEvent.HasExpeditionHandler
    BaseEvent.ExcludeFromTelemetry
    BaseEvent.State
    BaseEvent.Cancel()
    BaseEvent.Expedite()
    BaseEvent.Complete(Boolean)
    BaseEvent.Equals(BaseEvent)
    Priority_Queue.StablePriorityQueueNode.InsertionIndex
    Priority_Queue.FastPriorityQueueNode.Priority
    Priority_Queue.FastPriorityQueueNode.QueueIndex
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Fibula.Mechanics.Operations
    Assembly: Fibula.Mechanics.dll
    Syntax
    public abstract class Operation : BaseEvent, IEquatable<BaseEvent>, IOperation, IEvent

    Constructors

    | Improve this Doc View Source

    Operation(UInt32)

    Initializes a new instance of the Operation class.

    Declaration
    protected Operation(uint requestorId)
    Parameters
    Type Name Description
    System.UInt32 requestorId

    The id of the creature requesting the movement.

    Properties

    | Improve this Doc View Source

    AssociatedExhaustion

    Gets or sets the information about the exhaustion that this operation produces.

    Declaration
    public (ConditionType Type, TimeSpan Cost)? AssociatedExhaustion { get; protected set; }
    Property Value
    Type Description
    System.Nullable<System.ValueTuple<ConditionType, System.TimeSpan>>
    | Improve this Doc View Source

    CanBeCancelled

    Gets or sets a value indicating whether the event can be cancelled.

    Declaration
    public override bool CanBeCancelled { get; protected set; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    BaseEvent.CanBeCancelled

    Methods

    | Improve this Doc View Source

    AddContentToContainerOrFallback(IOperationContext, IThingContainer, ref IThing, Byte, Boolean, ICreature)

    Attempts to add content to the first possible parent container that accepts it, on a chain of parent containers.

    Declaration
    protected bool AddContentToContainerOrFallback(IOperationContext context, IThingContainer thingContainer, ref IThing remainder, byte addIndex = 255, bool includeTileAsFallback = true, ICreature requestorCreature = null)
    Parameters
    Type Name Description
    IOperationContext context

    A reference to the operation context.

    IThingContainer thingContainer

    The first thing container to add to.

    IThing remainder

    The remainder content to add, which overflows to the next container in the chain.

    System.Byte addIndex

    The index at which to attempt to add, only for the first attempted container.

    System.Boolean includeTileAsFallback

    Optional. A value for whether to include tiles in the fallback chain.

    ICreature requestorCreature

    Optional. The creature requesting the addition of content.

    Returns
    Type Description
    System.Boolean

    True if the content was successfully added, false otherwise.

    | Improve this Doc View Source

    DispatchTextNotification(IOperationContext, String)

    Sends a TextMessageNotification to the requestor of the operation, if there is one and it is a player.

    Declaration
    protected void DispatchTextNotification(IOperationContext context, string message = "Sorry, not possible.")
    Parameters
    Type Name Description
    IOperationContext context

    A reference to the operation context.

    System.String message

    Optional. The message to send. Defaults to NotPossible.

    | Improve this Doc View Source

    Execute(IOperationContext)

    Executes the operation's logic.

    Declaration
    protected abstract void Execute(IOperationContext context)
    Parameters
    Type Name Description
    IOperationContext context

    The execution context for this operation.

    | Improve this Doc View Source

    Execute(IEventContext)

    Executes the event logic.

    Declaration
    public override void Execute(IEventContext context)
    Parameters
    Type Name Description
    IEventContext context

    The execution context.

    Overrides
    BaseEvent.Execute(IEventContext)
    | Improve this Doc View Source

    GetRequestor(ICreatureFinder)

    Gets the creature that is requesting the event, if known.

    Declaration
    public ICreature GetRequestor(ICreatureFinder creatureFinder)
    Parameters
    Type Name Description
    ICreatureFinder creatureFinder

    A reference to the creature finder in use.

    Returns
    Type Description
    ICreature

    The creature that requested the operation, or null if there wasn't any.

    | Improve this Doc View Source

    SendNotification(IOperationContext, INotification)

    Sends a notification synchronously.

    Declaration
    protected void SendNotification(IOperationContext context, INotification notification)
    Parameters
    Type Name Description
    IOperationContext context

    A reference to the operation context.

    INotification notification

    The notification to send.

    Implements

    System.IEquatable<T>
    IOperation
    IEvent

    Extension Methods

    ObjectExtensions.YieldSingleItem<T>(T)
    ObjectExtensions.GetPropertyValue(Object, String)
    Validate.ThrowIfNull(Object, String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018-2020 | The Fibula Project
    Generated using DocFX | Jose L. Nuñez de Caceres et al.