
/*
 * Copyright 2011-2022 Cuberite Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include "Entity.h"





// tolua_begin
class cFloater :
	public cEntity
{
	// tolua_end

	using Super = cEntity;

public:  // tolua_export

	CLASS_PROTODEF(cFloater)

	cFloater(Vector3d a_Pos, Vector3d a_Speed, UInt32 a_PlayerID, int a_CountDownTime);

	virtual void SpawnOn(cClientHandle & a_Client) override;
	virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;

	// tolua_begin
	bool CanPickup(void)       const { return m_CanPickupItem; }
	UInt32 GetOwnerID(void)       const { return m_PlayerID; }
	UInt32 GetAttachedMobID(void) const { return m_AttachedMobID; }
	Vector3d GetBitePos(void)     const { return m_BitePos; }
	// tolua_end

protected:
	// Position
	Vector3d m_ParticlePos;

	// Position just before the floater gets pulled under by a fish
	Vector3d m_BitePos;

	// Bool needed to check if you can get a fish.
	bool m_CanPickupItem;

	// Countdown times
	int m_PickupCountDown;
	int m_CountDownTime;

	// Entity IDs
	UInt32 m_PlayerID;
	UInt32 m_AttachedMobID;
} ;  // tolua_export
