OSDN Git Service

[Modify] boostライブラリに依存した処理をコメントアウトによる一時的措置を含めて完了.
[deeangband/Deeangband-new.git] / Deeangband / GameLogger.cpp
1 /*!
2  * @file GameLogger.cpp
3  * @brief GameLogger\83N\83\89\83X\82Ì\92è\8b`
4  * @date 2013/12/11
5  * @author Deskull
6  * 2013 Sikabane Works.
7  */
8
9 #include "stdafx.h"
10 #include "GameLogger.h"
11 #include <iomanip>
12
13 namespace Deeangband
14 {
15         GameLogger::GameLogger(void)
16         {
17                 time_t t = time(0);
18             tm tx;
19                 setlocale(LC_CTYPE, "ja_JP.UTF-8");
20                 localtime_s(&tx, &t);
21                 ofs.open("Deeangband.log");
22                 if(ofs.fail())
23                 {
24                         exit(0);
25                 }
26                 ofs << std::put_time(&tx, "%Y-%m-%d %H:%M:%S =") << "D\'angband \8aJ\8en \n";
27         }
28
29         void GameLogger::PutLog(std::string log)
30         {
31                 time_t t = time(0);
32             tm tx;
33                 setlocale(LC_CTYPE, "ja_JP.UTF-8");
34                 localtime_s(&tx, &t);
35                 ofs << std::put_time(&tx, "%Y-%m-%d %H:%M:%S =") << log << "\n";
36         }
37
38         GameLogger::~GameLogger(void)
39         {
40                 time_t t = time(0);
41             tm tx;
42                 setlocale(LC_CTYPE, "ja_JP.UTF-8");
43                 localtime_s(&tx, &t);
44                 ofs << std::put_time(&tx, "%Y-%m-%d %H:%M:%S =") << "D\'angband \8fI\97¹ \n";
45         }
46
47         void GameLogger::CreatureMoved(ID creatureID, NAME name, DIRECTION dir)
48         {
49                 //GameLogger::PutLog((boost::format("[%1%]%2%\82ª\95û\8cü%3%\82É\88Ú\93®") % creatureID % name.c_str() % dir).str());
50         }
51
52         void GameLogger::CreaturesCombated(NAME attackerName, NAME targetName)
53         {
54                 //GameLogger::PutLog((boost::format("%1%\82ª%2%\82Ö\82Ì\94\92\95º\90í\82É\88Ú\8ds") % attackerName.c_str() % targetName.c_str()).str());
55         }
56
57 }