Table of Contents

Interface IConditional<TSelf>

Namespace
DynaSharp
Assembly
DynaSharp.dll

A command that takes a condition. It is the way to write a helper that works on all of them, without knowing the command:

public static TCommand OnlyIfOwned<TCommand>(this TCommand command, string owner)
    where TCommand : IConditional<TCommand>, allows ref struct =>
    command.If(Attr("owner").Eq(owner));
public interface IConditional<TSelf> where TSelf : IConditional<TSelf>, allows ref struct

Type Parameters

TSelf

The command.

Methods

If<TCondition>(TCondition)

Adds a condition. The write happens only if it holds, and a second condition means both must hold.

TSelf If<TCondition>(TCondition condition) where TCondition : ICondition

Parameters

condition TCondition

The condition.

Returns

TSelf

The command, which replaces this one.

Type Parameters

TCondition

The type of the condition.