/*
 * ResetTriggerPhysicsComponent.cpp
 *
 *  Created on: Aug 19, 2020
 *      Author: fredrick
 */

#include "ResetTriggerPhysicsComponent.h"

namespace JamSpook {

ResetTriggerPhysicsComponent::ResetTriggerPhysicsComponent(mat4 transform,
                                                           shared_ptr<BroadcastObservable<shared_ptr<Message> > > entity,
                                                           weak_ptr<BroadcastObservable<const milliseconds> > physicsSystem,
                                                           weak_ptr<BroadcastObservable<shared_ptr<CollisionStateChangeMessage> > > physicsCollisionSubSystem,
                                                           weak_ptr<BroadcastObservable<shared_ptr<ColliderQueryMessage> > > physicsColliderQuerySubSystem,
                                                           shared_ptr<Collider> collider):
        PhysicsComponent(transform,
                         entity,
                         physicsSystem,
                         physicsCollisionSubSystem,
                         physicsColliderQuerySubSystem,
                         collider)
{}

ResetTriggerPhysicsComponent::~ResetTriggerPhysicsComponent()
{}

void ResetTriggerPhysicsComponent::update(const milliseconds dtms)
{
//    Log::write(LogLevel::trace, "CollectablePhysicsComponent - update");
    PhysicsComponent::update(dtms);
}

void ResetTriggerPhysicsComponent::onICCMessage(shared_ptr<Message> message)
{
    PhysicsComponent::onICCMessage(message);
}

void ResetTriggerPhysicsComponent::onCollision(const string& tag)
{
    ICCBroadcast(make_shared<Message>(IDCache::get("ContactWithPlayer")));
}

} // namespace JamSpook
