AdvancedRobot AddCustomEvent Method (Condition)Robocode Robot API for .NET
Registers a custom event to be called when a condition is met. When you are finished with your condition or just want to remove it you must call RemoveCustomEvent(Condition).

Examples

// Create the condition for our custom event
Condition triggerHitCondition = new Condition("triggerhit")
{
    public bool Test()
    {
        return (Energy <= trigger);
    }
}

// Add our custom event based on our condition
AddCustomEvent(triggerHitCondition);

Namespace: Robocode
Assembly: robocode (in robocode.dll) Version: 1.9.3.0
Syntax

public void AddCustomEvent(
	Condition condition
)

Parameters

condition
Type: Robocode Condition
The condition that must be met. Throws ArgumentException if the condition parameter has been set to null.
See Also