Table of Contents

Class ArgAttribute

Namespace
Core.Commands
Assembly
Core.dll

Marks a property as a command argument for auto-parsing and serialization.

Supported types:

  • Primitives: int, float, double, bool, byte, ushort, uint, long
  • Strings: string
  • Fixed-point: FixedPoint64 (parsed from float)

Usage: [Arg(0, "amount")] public int Amount { get; set; }

[Arg(1, "target", Optional = true)] public ushort TargetId { get; set; }

[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class ArgAttribute : Attribute
Inheritance
object
Attribute
ArgAttribute

Constructors

ArgAttribute(int, string)

public ArgAttribute(int position, string name = null)

Parameters

position int
name string

Properties

Description

Description for help text

public string Description { get; set; }

Property Value

string

Name

Display name for help text (e.g., "amount", "provinceId")

public string Name { get; }

Property Value

string

Optional

If true, argument can be omitted. Property keeps default value.

public bool Optional { get; set; }

Property Value

bool

Position

Positional index in the argument list (0-based)

public int Position { get; }

Property Value

int