Horizon Official Technical Documentation
Horizon::Zone::CombatRegistry::MeleeExecutionOperation Class Reference

#include <Combat.hpp>

+ Inheritance diagram for Horizon::Zone::CombatRegistry::MeleeExecutionOperation:
+ Collaboration diagram for Horizon::Zone::CombatRegistry::MeleeExecutionOperation:

Classes

class  MeleeExecutionOperand
 

Public Types

enum  melee_execution_operation_type { MELEE_EXECUTION_OPERATION_TARGET = 0 }
 
- Public Types inherited from Horizon::Zone::CombatRegistry::CombatOperation
enum  combat_operation_type {
  COMBAT_OPERATION_ATTRIBUTE , COMBAT_OPERATION_APPEARANCE , COMBAT_OPERATION_STATUS , COMBAT_OPERATION_SKILL_EXECUTION ,
  COMBAT_OPERATION_MELEE_EXECUTION , COMBAT_OPERATION_SKILL_RESULT , COMBAT_OPERATION_MELEE_RESULT , COMBAT_OPERATION_MAX
}
 

Public Member Functions

 MeleeExecutionOperation (MeleeExecutionOperand *operand, melee_execution_operation_type type)
 
 ~MeleeExecutionOperation ()
 
void execute () const override
 
- Public Member Functions inherited from Horizon::Zone::CombatRegistry::CombatOperation
 CombatOperation ()=delete
 
 CombatOperation (const CombatOperation &right)=delete
 
 CombatOperation (CombatOperation &&right)=delete
 
 CombatOperation (CombatOperand *operand, int operation_type, int operation_sub_type, CombatOperationValue *value)
 
 CombatOperation (CombatOperand *operand, int operation_type, int operation_sub_type)
 
virtual ~CombatOperation ()
 
virtual CombatOperandget_operand () const
 
int get_operation_type () const
 
int get_operation_sub_type () const
 
virtual CombatOperationValueget_operation_value () const
 
int get_priority ()
 
void set_priority (int priority)
 
virtual void execute () const =0
 
void operator= (const CombatOperation &operation)=delete
 

Additional Inherited Members

- Protected Attributes inherited from Horizon::Zone::CombatRegistry::CombatOperation
CombatOperand_operand {nullptr}
 
int _operation_type { 0 }
 
int _operation_sub_type { 0 }
 
CombatOperationValue_operation_value {nullptr}
 
int _priority { 0 }
 

Member Enumeration Documentation

◆ melee_execution_operation_type

Constructor & Destructor Documentation

◆ MeleeExecutionOperation()

Horizon::Zone::CombatRegistry::MeleeExecutionOperation::MeleeExecutionOperation ( MeleeExecutionOperand operand,
melee_execution_operation_type  type 
)
inline

◆ ~MeleeExecutionOperation()

Horizon::Zone::CombatRegistry::MeleeExecutionOperation::~MeleeExecutionOperation ( )
inline
555{ }

Member Function Documentation

◆ execute()

void CombatRegistry::MeleeExecutionOperation::execute ( ) const
overridevirtual

Implements Horizon::Zone::CombatRegistry::CombatOperation.

551{
552 std::shared_ptr<Unit> source = get_operand()->get_source();
553 std::shared_ptr<Unit> target = get_operand()->get_target();
556
557 switch(get_operation_sub_type())
558 {
560 {
561 source->attack(target, config.continuous);
562 }
563 break;
564 }
565}
std::shared_ptr< Unit > get_target()
Definition: Combat.hpp:263
std::shared_ptr< Unit > get_source()
Definition: Combat.hpp:262
int get_operation_sub_type() const
Definition: Combat.hpp:319
virtual CombatOperand * get_operand() const
Definition: Combat.hpp:317
s_melee_execution_operation_config get_config()
Definition: Combat.hpp:547

References Horizon::Zone::CombatRegistry::MeleeExecutionOperation::MeleeExecutionOperand::s_melee_execution_operation_config::continuous, and Horizon::Zone::CombatRegistry::MeleeExecutionOperation::MeleeExecutionOperand::get_config().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: