AdvancedRobot AddCustomEvent Method Robocode Robot API for .NET
Overload List

  NameDescription
Public methodAddCustomEvent(Condition)
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);
Public methodAddCustomEvent(String, Int32, ConditionTest)
Same as AddCustomEvent(Condition), but alows to define condition as anonymous method.
Back to Top
See Also