CanadianMachines / CanadianExperienceLib / MachineDrawable.h
MachineDrawable.h
Raw
/**
 * @file MachineDrawable.h
 * @author sriram
 *
 *
 */

#ifndef CANADIANEXPERIENCE_CANADIANEXPERIENCELIB_MACHINEDRAWABLE_H
#define CANADIANEXPERIENCE_CANADIANEXPERIENCELIB_MACHINEDRAWABLE_H

#include "Drawable.h"
#include "Timeline.h"
#include <machine-api.h>

struct ma_engine;

/**
 * A drawable that displays an machine
 */
class MachineDrawable: public Drawable
{
private:
	///machine system for drawable
	std::shared_ptr<MachineSystem> mMachine=nullptr;

	///start time for drawable
	int mStartTime = -1;

	///start time for drawable
	int mEndTime = 1000;

	/// The animation timeline
	Timeline* mTimeline=nullptr;

public:

	MachineDrawable(const std::wstring& name, const std::wstring resourcesDir,ma_engine* audioEngine,int num,int startTime,int endTime);
	void Draw(std::shared_ptr<wxGraphicsContext> graphics) override;

	/**
	 * hit test
	 * @param pos
	 * @return
	 */
	bool HitTest(wxPoint pos) override{return false;}

	void SetTimeline(Timeline *timeline) override;

	/**
	 * getter for timeline
	 * @return
	 */
	Timeline* GetTimeline(){return mTimeline;}

	void SetMachineNumber(wxWindow* parent);

	/**
	 * setter for start time
	 * @param frame
	 */
	 void SetStartTime(int frame){mStartTime=frame;}

	/**
	* setter for start time
	 * @param frame
	*/
	void SetEndTime(int frame){mEndTime=frame;}

	/**
	 * getter for start time
	 *@return start time
	 */
	int GetStartTime(){return mStartTime;}

	/**
	* getter for start time
	 * @return end time
	*/
	int GetEndTime(){return mEndTime;}

	/**
	 * getter for machine number
	 * @return
	 */
	int GetMachineNumber(){return mMachine->GetMachineNumber();}

	/**
	 * sets machine number
	 * @param num
	 */
	void SetNumber(int num){mMachine->SetMachineNumber(num);}
};

#endif //CANADIANEXPERIENCE_CANADIANEXPERIENCELIB_MACHINEDRAWABLE_H