/** 
 * \file Language.cpp
 * \brief This file creates string table depending on selected language. 
 * It returns string from table with given index.
 * 
 * \author Petar Bajic, MPE (C) All Rights Reserved, Homepage: www.mystic-peanut.com
 * \date January, 16 2007.
 */

#include "Language.h"

/**
 * \brief Standard constructor.
 * \author Petar Bajic 
 * \date January, 16 2007.
 */
CLanguage::CLanguage()
{
	m_Language = 0;
}

/**
 * \brief Sets chosen language loaded from config.ini, 
 * then calls LoadTextLanguages() to initialize string table.
 *
 * \param language 0 - english, 1 - serbian
 * \author Petar Bajic 
 * \date January, 16 2007.
 */
bool CLanguage::SetLanguage(int language)
{
	if(language < NUM_LANGUAGES)
	{
		m_Language = language;
		LoadTextLanguages(language);
		return true;
	}

	return false;
}

/**
 * \brief Returns text string from the given index position in the table.
 * \author Petar Bajic 
 * \date January, 16 2007.
 */
WCHAR* CLanguage::GetText(int index)
{
	return m_allText[index];
}

/**
 * \brief Loads strings to language table depending on given language.
 * \param language chosen language
 * \author Petar Bajic 
 * \date January, 16 2007.
 */
void CLanguage::LoadTextLanguages(int language)
{
	switch (language)
	{
		case ENGLISH:
		{
			StringCchCopy(m_allText[MPE_TEXT_GAME_LOADING],1024,L"Loading");
			StringCchCopy(m_allText[MPE_TEXT_MOVIE_TEXT1],1024,L"Once upon a time there was a turtle called Tuki... Tuki was the oldest child with 50 young sisters. When he got 5, his mother put him in her lap and told him :\"Son, its time for you to find a job and get some positive money income to this family. What do you think about being a shepherd?\"");
			StringCchCopy(m_allText[MPE_TEXT_MOVIE_TEXT2],1024,L"SheepMaster hired Tuki for 1 golden coin per day. He told him about treacherous shoemaking dwarfs and gave him only simple instructions: \"Look around with Mouse, move with WASD keys, shoot with Left mouse button\"");
			StringCchCopy(m_allText[MPE_TEXT_MOVIE_TEXT3],1024,L"Help Tuki to save the sheep from forest thieves.");
			StringCchCopy(m_allText[MPE_TEXT_MENU_TITLE1],1024,L"TUKI THE TURTLE SHEPHERD");
			StringCchCopy(m_allText[MPE_TEXT_MENU_TITLE2],1024,L"Turtle Tuki Adventures: Vol.1");
			StringCchCopy(m_allText[MPE_TEXT_MENU_START],1024,L"Start");
			StringCchCopy(m_allText[MPE_TEXT_MENU_OPTIONS],1024,L"Options");
			StringCchCopy(m_allText[MPE_TEXT_MENU_CREDITS],1024,L"Credits");
			StringCchCopy(m_allText[MPE_TEXT_MENU_EXIT],1024,L"Exit");
			StringCchCopy(m_allText[MPE_TEXT_MENU_CONTROLS],1024,L"Controls");
			StringCchCopy(m_allText[MPE_TEXT_MENU_DETAILS],1024,L"Details");
			StringCchCopy(m_allText[MPE_TEXT_MENU_DIFFICULTY],1024,L"Difficulty");
			StringCchCopy(m_allText[MPE_TEXT_MENU_BACK],1024,L"Back");
			StringCchCopy(m_allText[MPE_TEXT_MENU_CONTROL_SHOOT],1024,L"ENTER - shooting");
			StringCchCopy(m_allText[MPE_TEXT_MENU_CONTROL_PAUSE],1024,L"SPACE - pause");
			StringCchCopy(m_allText[MPE_TEXT_MENU_CONTROL_MOVE],1024,L"ARROWS - movement");
			StringCchCopy(m_allText[MPE_TEXT_MENU_CONTROL_RUN],1024,L"SHIFT - running");
			StringCchCopy(m_allText[MPE_TEXT_MENU_DIFFICULTY_HARD],1024,L"HARD");
			StringCchCopy(m_allText[MPE_TEXT_MENU_DIFFICULTY_EASY],1024,L"EASY");
			StringCchCopy(m_allText[MPE_TEXT_MENU_DETAILS_ON],1024,L"ON");
			StringCchCopy(m_allText[MPE_TEXT_MENU_DETAILS_OFF],1024,L"OFF");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_SUCCESS],1024,L"Success!");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_PRESS_SPACE],1024,L"Press <SPACE> to continue");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_PAUSED],1024,L"Paused");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_SAVED_SHEEPS],1024,L"You saved all your sheeps!");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_PRESS_SPACE_EXIT],1024,L"Press <SPACE> to continue, or <ESC> to exit.");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_OOOPS],1024,L"Oooops!");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_STOLEN_SHEEP],1024,L"Dwarf stole your sheep.");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_KILLED_SHEEP],1024,L"You killed your sheep.");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_THIRD_TIME],1024,L"This is third time! You're fired!");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_BORDER_WARNING],1024,L"Don't leave the pasture!");
		}
		break;
		case SRPSKI:
		{
			StringCchCopy(m_allText[MPE_TEXT_GAME_LOADING],1024,L"Учитавање");
			StringCchCopy(m_allText[MPE_TEXT_MOVIE_TEXT1],1024,L"Беше једном корњача по имену Туки... Туки је био најстарије дете и имаше 50 млађих сеста- ра. Кад напуни 5 година, узе мајка сина Тукија па му овако рекне: \"Сине Туки, делијо, соколе и узданицо наша, таква и таква ствар, будући да си најстарији од све деце, време је да помог-неш мајци јединици у издржавању породице.\" Тако се туки спаковао, па се ижљубио са стара мајком и са млађим сестрицама, и кренуо у      свет да тражи везу за запошљење.");
			StringCchCopy(m_allText[MPE_TEXT_MOVIE_TEXT2],1024,L"Лутао је тако по шумама и горама док није на- басао на једног човека како седи и плаче. Тај   човек му рече како му нема спаса, не може ви-ше овце на испашу да тера, сваки дан му гор-   ски патуљци бар по једну дрпе. Онда му Туки  рече да ће му помоћи за минималац + социјал-но и човек сав срећан га ома прими.");
			StringCchCopy(m_allText[MPE_TEXT_MOVIE_TEXT3],1024,L"Помози Тукију да сачува овце.");
			StringCchCopy(m_allText[MPE_TEXT_MENU_TITLE1],1024,L"ТУКИ - КОРЊАЧА ЧОБАН");
			StringCchCopy(m_allText[MPE_TEXT_MENU_TITLE2],1024,L"Авантуре корњаче Тукија: Vol.1");
			StringCchCopy(m_allText[MPE_TEXT_MENU_START],1024,L"Старт");
			StringCchCopy(m_allText[MPE_TEXT_MENU_OPTIONS],1024,L"Опције");
			StringCchCopy(m_allText[MPE_TEXT_MENU_CREDITS],1024,L"Тим");
			StringCchCopy(m_allText[MPE_TEXT_MENU_EXIT],1024,L"Излаз");
			StringCchCopy(m_allText[MPE_TEXT_MENU_CONTROLS],1024,L"Контроле");
			StringCchCopy(m_allText[MPE_TEXT_MENU_DETAILS],1024,L"Детаљи");
			StringCchCopy(m_allText[MPE_TEXT_MENU_DIFFICULTY],1024,L"Тежина");
			StringCchCopy(m_allText[MPE_TEXT_MENU_BACK],1024,L"Назад");
			StringCchCopy(m_allText[MPE_TEXT_MENU_CONTROL_SHOOT],1024,L"ENTER - пуцање");
			StringCchCopy(m_allText[MPE_TEXT_MENU_CONTROL_PAUSE],1024,L"SPACE - пауза");
			StringCchCopy(m_allText[MPE_TEXT_MENU_CONTROL_MOVE],1024,L"ARROWS - кретање");
			StringCchCopy(m_allText[MPE_TEXT_MENU_CONTROL_RUN],1024,L"SHIFT - трчање");
			StringCchCopy(m_allText[MPE_TEXT_MENU_DIFFICULTY_HARD],1024,L"ТЕШКО");
			StringCchCopy(m_allText[MPE_TEXT_MENU_DIFFICULTY_EASY],1024,L"ЛАКО");
			StringCchCopy(m_allText[MPE_TEXT_MENU_DETAILS_ON],1024,L"ДА");
			StringCchCopy(m_allText[MPE_TEXT_MENU_DETAILS_OFF],1024,L"НЕ");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_SUCCESS],1024,L"Браво!");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_PRESS_SPACE],1024,L"Притисни тастер <РАЗМАК> за наставак");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_PAUSED],1024,L"Пауза");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_SAVED_SHEEPS],1024,L"Успео си да сачуваш све овце!");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_PRESS_SPACE_EXIT],1024,L"Притисни тастер <РАЗМАК> за наставак, или <ECЦ> за излаз.");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_OOOPS],1024,L"Малер!");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_STOLEN_SHEEP],1024,L"Патуљак ти дрпио овцу");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_KILLED_SHEEP],1024,L"Убио си своју овцу ко зеца.");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_THIRD_TIME],1024,L"Ово је већ трећи пут! Отпуштен си!");
			StringCchCopy(m_allText[MPE_TEXT_LEVEL_BORDER_WARNING],1024,L"Не иди са пашњака!");
		}
		break;
	}
}

