Skip to content

Commit

Permalink
test count
Browse files Browse the repository at this point in the history
  • Loading branch information
jonylu7 committed Mar 11, 2024
1 parent 2ba929c commit 0b7d32c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/UI/UI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class UIClass {
void Start();
void Update();

static int getUnitConstructCount(unitType type) {
static unsigned int getUnitConstructCount(unitType type) {
return s_unitConstructCount[type];
}
static void setUnitConstructCount(unitType type, int value) {
s_unitConstructCount[type] = value;
s_unitConstructCount[type] += value;
}

private:
Expand Down
3 changes: 3 additions & 0 deletions src/Scene/DefaultScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Created by 盧威任 on 2/15/24.
//
#include "Scene/DefaultScene.hpp"
#include <iostream>
void DefaultScene::Start() {

LOG_TRACE("Start");
Expand Down Expand Up @@ -53,6 +54,8 @@ void DefaultScene::Start() {
}

void DefaultScene::Update() {
std::cout << UIClass::getUnitConstructCount(unitType::POWER_PLANT)
<< std::endl;
Util::Transform trans;
m_Map.Draw(trans, 0);
m_SceneCamera.Update();
Expand Down

0 comments on commit 0b7d32c

Please sign in to comment.