Kaynağa Gözat

Filename case changes (part 2), Debian build adaptation

Ivan Arkhipov 6 yıl önce
ebeveyn
işleme
5bbb1b878e

+ 1 - 1
client.pro

@@ -53,7 +53,7 @@ guiRes.target = BuildResources
 exists($$DESTDIR/res) {
         message("Directory $$DESTDIR/res already exists")
     } else {
-            gioRes.commands += $(MKDIR) \"$$DESTDIR/res\" $$escape_expand(\n\t);
+            guiRes.commands += $(MKDIR) \"$$DESTDIR/res\" $$escape_expand(\n\t)
     }
 
 win32 {

+ 1 - 1
source/gui/GUI.cpp

@@ -1,5 +1,5 @@
 #include <gui/GUI.h>
-#include <ui_gui.h>
+#include <ui_GUI.h>
 #include <gui/RecruitmentScene.h>
 #include <QDebug>
 

+ 1 - 1
source/gui/GuiSceneManager.cpp

@@ -3,7 +3,7 @@
 #include "gui/MainMenu.h"
 #include "gui/PlayerVsPlayerIntro.h"
 #include "gui/PreBattleScene.h"
-#include "hotseatgame\gui\HotSeatGame.h"
+#include "hotseatgame/gui/HotSeatGame.h"
 
 #include <QResource>
 #include <QApplication>

+ 1 - 1
source/gui/MainMenu.cpp

@@ -1,6 +1,6 @@
 #include "gui/MainMenu.h"
 #include "gui/GuiSceneManager.h"
-#include "ui_mainmenu.h"
+#include "ui_MainMenu.h"
 
 #include <QString>
 #include <QApplication>

+ 1 - 1
source/gui/PlayerVsPlayerIntro.cpp

@@ -3,7 +3,7 @@
 #include "PlayerManager.h"
 #include "gui/Scene.h"
 
-#include "ui_playervsplayerintro.h"
+#include "ui_PlayerVsPlayerIntro.h"
 
 PlayerVsPlayerIntro::PlayerVsPlayerIntro(QWidget *parent) :
     Scene(parent),

+ 1 - 1
source/gui/PreBattleScene.cpp

@@ -9,7 +9,7 @@
 #include "gui/RaceIcon.h"
 #include "gui/UnitIcon.h"
 #include "gui/GuiSceneManager.h"
-#include "ui_prebattlescene.h"
+#include "ui_PreBattleScene.h"
 
 #include <QMessageBox>
 

+ 1 - 1
source/gui/RecruitmentScene.cpp

@@ -8,7 +8,7 @@
 #include <RaceManager.h>
 #include <Race.h>
 
-#include <ui_recruitmentscene.h>
+#include <ui_RecruitmentScene.h>
 #include <QHBoxLayout>
 #include <QString>
 #include <QStringList>

+ 2 - 2
source/hotseatgame/gui/HotSeatGame.cpp

@@ -1,5 +1,5 @@
-#include "hotseatgame\gui\hotseatgame.h"
-#include "ui_hotseatgame.h"
+#include "hotseatgame/gui/HotSeatGame.h"
+#include "ui_HotSeatGame.h"
 #include "gui/guiscenemanager.h"
 
 #include <QDebug>

+ 0 - 22
source/playermanager.cpp

@@ -1,22 +0,0 @@
-#include "PlayerManager.h"
-#include <cassert>
-
-PlayerManager::PlayerManager(QObject *parent) : QObject(parent)
-{
-
-}
-
-Player* PlayerManager::getPlayer(int id) {
-    assert(unsigned(id) < players_.size());
-    return &players_[id];
-}
-
-int PlayerManager::getPlayersNum() {
-    return players_.size();
-}
-
-void PlayerManager::setPlayersNum(int num) {
-    players_.resize(num);
-    for (int i = 0; i < num; i++)
-        players_[i].init(i);
-}

+ 0 - 90
source/race.cpp

@@ -1,90 +0,0 @@
-#include "Race.h"
-#include "units/Unit.h"
-#include "units/Warrior.h"
-#include "units/Mage.h"
-
-#include <QFile>
-#include <QTextStream>
-#include <QString>
-#include <QDebug>
-
-#include <cassert>
-#include <vector>
-#include <algorithm>
-
-Race::Race(QString race_name, QObject *parent) : QObject(parent)
-{
-    race_id_ = race_name;
-
-    units_factory_.addClass<Warrior, QString>("Warrior");
-    units_factory_.addClass<Warrior, QString>("Mage");
-    units_factory_.addClass<Warrior, QString>("Rider");
-    units_factory_.addClass<Warrior, QString>("Rogue");
-    units_factory_.addClass<Warrior, QString>("Archer");
-
-    QFile file(":/assets/units/" + race_name + "/units.txt");
-    file.open(QIODevice::ReadOnly);
-    QTextStream in(&file);
-    in.setCodec("UTF-8");
-    QString unit_name = in.readLine();
-
-    while (!in.atEnd()) {
-        available_units_list_.push_back(unit_name);
-        all_units_list_.push_back(createUnit(unit_name));
-        unit_name = in.readLine();
-    }
-
-    if (unit_name.length() > 2) {
-        available_units_list_.push_back(unit_name);
-        all_units_list_.push_back(createUnit(unit_name));
-    }
-
-    QFile file0(":/assets/units/" + race_name + "/racename.txt");
-    file0.open(QIODevice::ReadOnly);
-    QTextStream in0(&file0);
-    in0.setCodec("UTF-8");
-    race_name_ = in0.readLine();
-
-    QFile file1(":/assets/units/" + race_name + "/descr.txt");
-    file1.open(QIODevice::ReadOnly);
-    QTextStream in1(&file1);
-    in1.setCodec("UTF-8");
-    race_descr_ = in1.readAll();
-
-    race_icon_.load(":/assets/units/" + race_name + "/icon.png");
-}
-
-QString Race::getRaceId() {
-    return race_id_;
-}
-
-QString Race::getRaceName() {
-    return race_name_;
-}
-
-QImage Race::getRaceIcon() {
-    return race_icon_;
-}
-
-QString Race::getRaceDescr() {
-    return race_descr_;
-}
-
-Unit* Race::createUnit(QString unit_name) {
-    qDebug() << unit_name;
-    QFile file(":/assets/units/" + race_id_ + "/" + unit_name + "/baseclass.txt");
-    file.open(QIODevice::ReadOnly);
-    QTextStream in(&file);
-    in.setCodec("UTF-8");
-    QString class_id = in.readLine();
-    qDebug() << "Creating unit of base class " << class_id << " and major class" <<  race_id_ + "|" + unit_name;
-    return units_factory_.createObject<QString>(class_id, race_id_ + "|" + unit_name);
-}
-
-const std::vector<QString>& Race::getAvailableUnitsList() {
-    return available_units_list_;
-}
-
-const std::vector<Unit*> &Race::getAllUnitsList() {
-    return all_units_list_;
-}

+ 0 - 50
source/racemanager.cpp

@@ -1,50 +0,0 @@
-#include "RaceManager.h"
-#include "Race.h"
-
-#include <QFile>
-#include <QDebug>
-#include <QTextStream>
-#include <QDebug>
-
-RaceManager::RaceManager(QObject *parent) : QObject(parent)
-{
-    QFile file(":/assets/units/races.txt");
-    file.open(QIODevice::ReadOnly);
-    QTextStream in(&file);
-    in.setCodec("UTF-8");
-    QString race_name = in.readLine();
-
-    while(!in.atEnd()) {
-        if (races_.count(race_name) != 0) {
-            qWarning() << "Warning! found double occurences of races in raceslist.txt";
-            continue;
-        }
-        if (race_name.length() < 2)
-            continue;
-        //qDebug() << available_races_;
-        available_races_.push_back(race_name);
-        races_[race_name] = new Race(race_name);
-        race_name = in.readLine();
-    }
-
-    if (race_name.length() >= 2) {
-        //qDebug() << available_races_;
-        available_races_.push_back(race_name);
-        races_[race_name] = new Race(race_name);
-        race_name = in.readLine();
-    }
-
-}
-
-Race* RaceManager::getRace(QString race_name) {
-    if (races_.count(race_name) == 0) {
-        qWarning() << "Error! Not found race with name " << race_name;
-        return nullptr;
-    }
-
-    return races_[race_name];
-}
-
-const std::vector<QString>& RaceManager::getAvailableRacesList() {
-    return available_races_;
-}