Show / Hide Table of Contents

Class LogicEvent

Represents a single logic event that is part of a logic chain.

Inheritance
Object
LogicEvent
Namespace: Modding.Levels
Assembly: Assembly-CSharp.dll
Syntax
public class LogicEvent
Remarks

Events can be either modded or official events. They mostly behave the same way, but accessing data the player set up in the mapper is different:

For modded events, the EventProperties property exposes the EventProperties set up by the mod, take a look at the documentation for modded events for more information.

There is currently no stable API to access data for official events, but it's still possible using some unstable classes: The InternalObject has an eventData field which can be cast to the appropriate subclass of EventContainer to get access to the event-specific data.

Properties

Chain

The LogicChain this event is a part of.

Declaration
public LogicChain Chain { get; }
Property Value
Type Description
LogicChain

EventProperties

EventProperties of modded events. Always empty for official events.

Declaration
public IDictionary<string, EventProperty> EventProperties { get; }
Property Value
Type Description
IDictionary<String, EventProperty>

EventType

Which event type this is.

This is unique for offical events, but always Modded for all modded events.

Declaration
public EventContainer.EventType EventType { get; }
Property Value
Type Description
EventContainer.EventType

Identifier

Unique identifier of this event.

Declaration
public string Identifier { get; }
Property Value
Type Description
String

InternalObject

The internal representation of this event.

WARNING: This is not part of the stable API and subject to change!

Declaration
public EntityEvent InternalObject { get; }
Property Value
Type Description
EntityEvent

IsModdedEvent

Whether this event type is added to the game by a mod.

Declaration
public bool IsModdedEvent { get; }
Property Value
Type Description
Boolean

Name

Display name of this event. This is the same text that is displayed in the mapper when setting up the event.

Declaration
public string Name { get; }
Property Value
Type Description
String

PickerEntities

The entities that are selected in the picker of this event, if it has one.

Declaration
public ReadOnlyCollection<Entity> PickerEntities { get; }
Property Value
Type Description
ReadOnlyCollection<Entity>

Team

The assigned team. This value is correct for official events, as well as modded events that contain only one team button. If a modded event supports multiple teams, this value will be the first one while the other can be accessed using the Teams property.

Declaration
public MPTeam Team { get; }
Property Value
Type Description
MPTeam

Teams

All assigned teams. Includes the team returned by Team at the first position but also any other teams.

Declaration
public MPTeam[] Teams { get; }
Property Value
Type Description
MPTeam[]

Methods

Equals(LogicEvent)

Declaration
protected bool Equals(LogicEvent other)
Parameters
Type Name Description
LogicEvent other
Returns
Type Description
Boolean

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj
Returns
Type Description
Boolean
Overrides
Object.Equals(Object)

From(EntityEvent, LogicChain)

Create a LogicEvent from its internal representation.

Declaration
public static LogicEvent From(EntityEvent evt, LogicChain chain)
Parameters
Type Name Description
EntityEvent evt
LogicChain chain
Returns
Type Description
LogicEvent

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32
Overrides
Object.GetHashCode()

ToString()

Declaration
public override string ToString()
Returns
Type Description
String
Overrides
Object.ToString()

Operators

Equality(LogicEvent, LogicEvent)

Declaration
public static bool operator ==(LogicEvent left, LogicEvent right)
Parameters
Type Name Description
LogicEvent left
LogicEvent right
Returns
Type Description
Boolean

Inequality(LogicEvent, LogicEvent)

Declaration
public static bool operator !=(LogicEvent left, LogicEvent right)
Parameters
Type Name Description
LogicEvent left
LogicEvent right
Returns
Type Description
Boolean
Back to top Generated by DocFX