#include "project_screen.h"
#include "project_script.h"
#include "project_timer.h"

#include "part_volume0.h"
#include "part_volume1.h"

// ================
// ==== Script ====
// ================

int start_timer = 0;
int curr_part = VOLUME0;

bool change_part = true;

void UpdateStartTimer()
{
	start_timer = Ticks();
}

void NewPart(int part)
{
	curr_part = part;
	change_part = true;
}

int GetPart()
{
	return curr_part;
}

void Script()
{
	if (change_part)
	{
		UpdateStartTimer();
		change_part = false;
	}

	int part_timer = Ticks() - start_timer;

	switch(curr_part)
	{
		case VOLUME0:
			volume0_run(part_timer);
		break;

		case VOLUME1:
			volume1_run(part_timer);
		break;

		default:
		break;
	}
}
