// DO NOT MODIFY THIS FILE, IT HAS BEEN GENERATED.
// File generated by Quazal DDL Compiler, Version 4.1 [SP2] (Build 1224.83)
// Copyright (C) 1998-2004, Quazal Technologies Inc.

#ifndef _DSCombatantStateDDL_H_
#define _DSCombatantStateDDL_H_

#include <NetZ.h>
BEGIN_NAMESPACE_QUAZAL;
class DATASET(DSCombatantState): public DataSet {
public:
	_DS_GENERAL_DECLARATIONS(DSCombatantState);
	DATASET(DSCombatantState)( const DATASET(DSCombatantState) &oOther ) :
		d_sightX(oOther.d_sightX), 
		d_sightY(oOther.d_sightY), 
		d_sightZ(oOther.d_sightZ)
	{
	}

	_DS_ASSIGN_OPERATOR(DSCombatantState){
		_DS_COPYDATASET_VAR(d_sightX);
		_DS_COPYDATASET_VAR(d_sightY);
		_DS_COPYDATASET_VAR(d_sightZ);
	}

	_DS_EQUAL_OPERATOR(DSCombatantState){
		_DS_EQUAL_VAR(d_sightX);
		_DS_EQUAL_VAR(d_sightY);
		_DS_EQUAL_VAR(d_sightZ);
		return true;
	}

	_DS_TMPL_EQUAL_OPERATOR(DSCombatantState)

	class Buffer: public PHBDRModel {
	public:
		_DS_DECLARE_EXTRAPOLATION_VAR(qFloat,d_sightX);
		_DS_DECLARE_EXTRAPOLATION_VAR(qFloat,d_sightY);
		_DS_DECLARE_EXTRAPOLATION_VAR(qFloat,d_sightZ);
		void DelayedUpdateModel() {
			while (_DS_READY_TO_USE()) {
				_DS_DELAYED_UPDATE_TIME();
				_DS_DELAYED_UPDATE_VAR(d_sightX);
				_DS_DELAYED_UPDATE_VAR(d_sightY);
				_DS_DELAYED_UPDATE_VAR(d_sightZ);
			}
		}

		void UpdateModel(Time tTime, DDLTYPE(float)::CPPType d_sightX, DDLTYPE(float)::CPPType d_sightY, DDLTYPE(float)::CPPType d_sightZ, qByte byRole, const ContinuityBreak& oContinuityBreak) {
			DelayedUpdateModel();
			_DS_UPDATE_TIME(tTime);
			_DS_UPDATE_VAR(d_sightX);
			_DS_UPDATE_VAR(d_sightY);
			_DS_UPDATE_VAR(d_sightZ);
		}

	void ExtractFrom(Message* pMsg) {
		_DS_EXTRACT_TIMESTAMP();
		_DS_EXTRACT_BREAK();
		DDLTYPE(float)::CPPType d_sightX;
		DDLTYPE(float)::CPPType d_sightY;
		DDLTYPE(float)::CPPType d_sightZ;
		_MSG_EXTRACT_VARIABLE(Td_sightX,d_sightX);
		_MSG_EXTRACT_VARIABLE(Td_sightY,d_sightY);
		_MSG_EXTRACT_VARIABLE(Td_sightZ,d_sightZ);
		UpdateModel(tTimeStamp, d_sightX, d_sightY, d_sightZ, DUPLICA, oContinuityBreak);
	}

		_DS_REFRESHVARS(DSCombatantState) {
			DelayedUpdateModel();
			_DS_EXTRAPOLATE_VAR(d_sightX);
			_DS_EXTRAPOLATE_VAR(d_sightY);
			_DS_EXTRAPOLATE_VAR(d_sightZ);
			return true;
		}

	};
	void AddPredictedPoint(Time tTimestamp) {
		_DS_PREDICT_NEWPOINT_VAR(d_sightX);
		_DS_PREDICT_NEWPOINT_VAR(d_sightY);
		_DS_PREDICT_NEWPOINT_VAR(d_sightZ);
	}


	void UpdateModel(Buffer* pBuffer, Time tTime, qBool bReliable) {
		pBuffer->UpdateModel(tTime, d_sightX, d_sightY, d_sightZ, DUPLICATION_MASTER, m_oBreak.GetState());
		pBuffer->AddPointReliabilityData(bReliable);
	}


	qReal ComputeExtrapolationSquaredError(Buffer* pBuffer, const Time& tPredictionTime) {
		qReal dESE=0;
		_DS_ADDESE_VAR(d_sightX);
		_DS_ADDESE_VAR(d_sightY);
		_DS_ADDESE_VAR(d_sightZ);
		return dESE;
	}

	DDLTYPE(float)::CPPType d_sightX;
	DDLTYPE(float)::CPPType d_sightY;
	DDLTYPE(float)::CPPType d_sightZ;
	_DS_DECLARE_NOLOOPBACK();
	_DS_DECLARE_EXTRAPOLATED();
	_PR_unreliable_pudecl();
	_PR_extrapolation_filter_pudecl();

protected:
	_PR_unreliable_prdecl();
	_PR_extrapolation_filter_prdecl();
private:
	typedef DDLTYPE(float) Td_sightX;
	typedef DDLTYPE(float) Td_sightY;
	typedef DDLTYPE(float) Td_sightZ;
};

#define _DSDECL_DSCombatantState _PR_extrapolation_filter_dsdecl(DSCombatantState)

END_NAMESPACE_QUAZAL;
// For convenience, this declaration is directly available outside the Quazal namespace
using NS_QUAZAL DATASET(DSCombatantState);


#endif // _DSCombatantStateDDL_H_
