Ability_Behavior.cpp
Go to the documentation of this file.
1 #include "Ability_Behavior.hpp"
2 
3 namespace comp
4 {
5 
7  cm( inst, this, "Ability_Behavior" ),
8  inst( inst ),
9  m_ability( m_ability ),
10  field_activate( inst )
11 {
12  this->cm.owns( this->field_activate.cm );
13 
14  this->m_ability->activator.ModifyMode( &this->cm, iv::Attribute::ValueMode::Disabled );
15 
16  this->field_activate.Assign_Attribute_R( &m_ability->activator );
17  this->field_activate.on_activated(
18  [ this ]()
19  {
20  this->AbilityActivated();
21  }
22  );
23 }
24 
26 {
27  return this->inst;
28 }
29 
31 {
32  return this->m_ability;
33 }
34 
35 void Ability_Behavior::AbilityEnable( bool enabled )
36 {
37  if( enabled )
39  else
40  this->m_ability->activator.ModifyMode( &this->cm, iv::Attribute::ValueMode::Disabled );
41 }
42 
43 }