Skip to content

Commit

Permalink
Merge branch 'main' into UnitManager_Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jonylu7 authored May 16, 2024
2 parents 4fe04fa + 2d1555c commit 73e3fb4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ AllowShortFunctionsOnASingleLine: Inline
AlwaysBreakTemplateDeclarations: Yes
PackConstructorInitializers: Never
InsertNewlineAtEOF: true
BreakAfterAttributes: Always
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions include/Mechanics/UnitManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,32 @@ class UnitManager : public Player {

void spawn(std::shared_ptr<MapClass> 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<Infantry>(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;
Expand Down
1 change: 1 addition & 0 deletions src/Scene/TutorialScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand Down

0 comments on commit 73e3fb4

Please sign in to comment.