1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! Contains main plugin exported by this crate.
use crateAbilitylike;
use *;
use PhantomData;
use ;
use InputManagerSystem;
/// A [`Plugin`] that advances the abilities of type `A`.
///
/// This plugin ticks down the [`CooldownState`](crate::cooldown::CooldownState) and
/// [`ChargeState`](crate::charges::ChargeState) components of every entity with abilities of type `A`,
/// replenishing charges and refreshing cooldowns as they expire.
///
/// This plugin needs to be passed in an [`Abilitylike`] enum type that you've created for your game.
/// If you have more than one distinct type of action (e.g. menu actions, camera actions and player actions),
/// consider creating multiple `Abilitylike` enums and adding a copy of this plugin for each `Abilitylike` type.
///
/// ## Systems
///
/// The plugin adds [`tick_cooldowns`](crate::systems::tick_cooldowns) to
/// [`PreUpdate`], in the [`AbilitySystem::TickCooldowns`] set.
/// It is ordered before [`InputManagerSystem::Update`],
/// so cooldowns are advanced before action states are updated for the frame.
///
/// **WARNING:** These systems run during [`PreUpdate`].
/// If you have systems that care about inputs and actions that also run during this stage,
/// you must define an ordering between your systems or behavior will be very erratic.
/// System sets provided by [`leafwing_abilities`](crate).
// Deriving default induces an undesired bound on the generic