[C++]_S28-TextRPG

신치우·2025년 6월 1일

CPP

목록 보기
62/62


source file 내부에 보면 폴더별로 정리되어 트리모양의 구조를 갖고 있는 것으로 보이지만, 가상의 트리일 뿐 실제로는 해당 프로젝트가 있는 폴더 안에 다같이 우르르 들어있음.

순환구조 : A 파일에서 B 파일을 include하고 B파일에서 A 파일을 include하게 되는것 -> 빌드시 무조건 에러 발생

main.cpp(textRPG.cpp)를 포함한 총 6개의 cpp 파일과 5개의 header 파일로 구성.
관련 파일 이름

textRPG.cpp
Creature.cpp - .h
Monster.cpp -
.h
Player.cpp - .h
Field.cpp -
.h
Game.cpp - *.h

Git hub Link 위 파일 확인 가능

#include <iostream>
using namespace std;
#include "Game.h"

// 오늘의 주제 : TextRPG #4


int main()
{
	srand((unsigned int)time(nullptr));
	// 여기는 실제 코드가 running 하는 부분이기 때문에 include가 필요
	Game game;
	game.Init();

	while (true)
	{
		game.Update();
	}

	return 0;
}
profile
https://shin8037.tistory.com/

0개의 댓글