pub struct Event { /* private fields */ }
Expand description

A higher-level representation of a combat event.

Events can be many things, from damage events to general status messages (e.g. there’s EventKind::MapId to give information about the current map). The main way to use events is to match on the EventKind stored in .kind and then decide how to proceed. Note that all Events have certain fields that are always present, but they might not always be useful or contain sensible information. This is just an artifact of how arcdps saves the events.

The main way to deal with events is to iterate/use the .events() provided by a parsed Log. However, if you end up working with raw events (CbtEvent), then you can convert them to a “high-level” event using the standard TryFrom/TryInto mechanisms:

use std::convert::TryInto;
let raw_event: raw::CbtEvent = panic!();
let event: Event = raw_event.try_into().unwrap();

Note that if you plan on re-using the raw event afterwards, you should use the implementation that works on a reference instead: Event::try_from(&raw_event).

Implementations

The time when the event happened.

This are the milliseconds since Windows has been started (timeGetTime()).

Whether the agent had more than 90% of its health.

This is the scholar threshold.

Whether the target health was below 50%.

This is the threshold for many runes and trait damage modifiers (e.g. Bolt to the Heart).

Whether the source agent was moving.

Whether the source agent was flanking the target.

Whether some (or all) damage was mitigated by shields.

The kind of the event.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Transform a raw event to a “high-level” event.

If the event is not known, or some other error occured, None is returned.

  • raw_event - the raw event to transform.

The type returned in the event of a conversion error.

Convenience method to avoid manual borrowing.

Note that this conversion will consume the event, so if you plan on re-using it, use the TryFrom<&raw::CbtEvent> implementation that works with a reference.

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.