From 7f5058f1872e1ecc2ea9b897e32708903480e702 Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Thu, 24 Aug 2017 15:50:17 +0300 Subject: Behaviors now attachable to Monsters --- src/Mobs/Behaviors/BehaviorBreeder.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/Mobs/Behaviors/BehaviorBreeder.cpp') diff --git a/src/Mobs/Behaviors/BehaviorBreeder.cpp b/src/Mobs/Behaviors/BehaviorBreeder.cpp index b2bd8da5d..b32fafc8c 100644 --- a/src/Mobs/Behaviors/BehaviorBreeder.cpp +++ b/src/Mobs/Behaviors/BehaviorBreeder.cpp @@ -9,15 +9,25 @@ #include "../../Item.h" #include "../../BoundingBox.h" -cBehaviorBreeder::cBehaviorBreeder(cMonster * a_Parent) : - m_Parent(a_Parent), +cBehaviorBreeder::cBehaviorBreeder() : m_LovePartner(nullptr), m_LoveTimer(0), m_LoveCooldown(0), m_MatingTimer(0) { - m_Parent = a_Parent; - ASSERT(m_Parent != nullptr); +} + + + + + +void cBehaviorBreeder::AttachToMonster(cMonster & a_Parent) +{ + m_Parent = &a_Parent; + m_Parent->AttachTickBehavior(this); + m_Parent->AttachPostTickBehavior(this); + m_Parent->AttachRightClickBehavior(this); + m_Parent->AttachDestroyBehavior(this); } -- cgit v1.2.3