NewProjectDialog::NewProjectDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::NewProjectDialog)
{
    ui->setupUi(this);

    /* Getting the default directory from the application settings */
    QSettings settings;
    settings.beginGroup("NewProjectDialog");

    ui->locationBox->setText(settings.value("defaultDir",
                                            QDir::home().absolutePath())
                             .toString());

    settings.endGroup();

    /* Populating the target box */
    TargetData targets;
    for(int i = 0; i < targets.count(); i++)
    {
        ui->targetBox->insertItem(i, QIcon(), targets.name(i), targets.id(i));
    }
    targetChange(0);

    /* Connecting the browse button and target box */
    QObject::connect(ui->browseButton, SIGNAL(clicked()),
                     this, SLOT(browse()));
    QObject::connect(ui->targetBox, SIGNAL(currentIndexChanged(int)),
                     this, SLOT(targetChange(int)));
}
void EnemyHolder::update()
{
	if (!is_start) return;


	targetChange();
	for (auto& it : enemys)
	{
		it.update();
	}
}