forked from gameprogcpp/code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTargetComponent.cpp
More file actions
27 lines (24 loc) · 729 Bytes
/
TargetComponent.cpp
File metadata and controls
27 lines (24 loc) · 729 Bytes
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
// ----------------------------------------------------------------
// From Game Programming in C++ by Sanjay Madhav
// Copyright (C) 2017 Sanjay Madhav. All rights reserved.
//
// Released under the BSD License
// See LICENSE in root directory for full details.
// ----------------------------------------------------------------
#include "BoxComponent.h"
#include "Actor.h"
#include "Game.h"
#include "PhysWorld.h"
#include "TargetComponent.h"
#include "Math.h"
#include "Game.h"
#include "HUD.h"
TargetComponent::TargetComponent(Actor * owner)
:Component(owner)
{
mOwner->GetGame()->GetHUD()->AddTargetComponent(this);
}
TargetComponent::~TargetComponent()
{
mOwner->GetGame()->GetHUD()->RemoveTargetComponent(this);
}