diff --git a/.clang-format b/.clang-format index 839e3e84..0424b416 100644 --- a/.clang-format +++ b/.clang-format @@ -5,3 +5,4 @@ AllowShortFunctionsOnASingleLine: Inline AlwaysBreakTemplateDeclarations: Yes PackConstructorInitializers: Never InsertNewlineAtEOF: true +BreakAfterAttributes: Always diff --git a/.gitignore b/.gitignore index 923edd85..d5de1e5b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,10 @@ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 +# Ignore .DS_Store file from a git repository + +.DS_Store + # User-specific stuff .idea/**/workspace.xml .idea/**/tasks.xml diff --git a/include/Mechanics/UnitManager.hpp b/include/Mechanics/UnitManager.hpp index 3eca24b9..2007280a 100644 --- a/include/Mechanics/UnitManager.hpp +++ b/include/Mechanics/UnitManager.hpp @@ -74,20 +74,32 @@ class UnitManager : public Player { void spawn(std::shared_ptr m_Map, UnitType unit, HouseType house) { + + if (house == HouseType::ENEMY) { + // m_Enemy->addUnitConstructCount(unit, 1); + } else { + // m_Player->setUnitConstructCount(unit, 1); + } + switch (unit) { case UnitType::INFANTRY: { auto avatar = std::make_shared(house); + if (m_StructureManager->getStructureArray() ->getPlayerBarrackCell() .x == -1) { return; } + + + avatar->Start(m_StructureManager->getStructureArray() ->getPlayerBarrackCell()); // avatar // ->setNewDestination(m_StructureManager.getStructureArray().getPlayerWayPointCell()); m_AvatarManager->AppendAvatar(avatar); } + default: { printf("(GOM)error! try to spawn unknown type\n"); break; diff --git a/src/Scene/TutorialScene.cpp b/src/Scene/TutorialScene.cpp index 1e6c2888..90ed8c98 100644 --- a/src/Scene/TutorialScene.cpp +++ b/src/Scene/TutorialScene.cpp @@ -13,6 +13,7 @@ void TutorialScene::Start() { m_Enemy->setTotalCurrency(5000); m_SceneCamera->Start(MapUtil::CellCoordToGlobal(glm::vec2(-10, -10)), MapUtil::CellCoordToGlobal(glm::vec2(100, 100))); + m_EnemyScripts->Start(m_Enemy, m_EnemyObjectManager, m_Map); /*