OSDN Git Service

インクルードファイル指定と未使用変数警告の修正。 / Fix loading include files and unused value warnings,
[deeangband/Deeangband-new.git] / Deeangband / GameElement.cpp
1 /*!
2 * @file GameElement.cpp
3 * @brief \83Q\81[\83\80\92\86\97v\91f\82Ì\83X\81[\83p\81[\83N\83\89\83X\8eÀ\91\95
4 * @date 2014/01/19
5 * @author Deskull
6 * 2014 Sikabane Works.
7 */
8
9 #include "stdafx.h"
10 #include "GameElement.h"
11
12 namespace Deeangband
13 {
14         GameElement::GameElement(void)
15         {
16                 this->WipeData();
17                 return;
18         }
19
20         GameElement::~GameElement(void)
21         {
22                 this->WipeData();
23                 return;
24         }
25
26         void GameElement::WipeData(void)
27         {
28                 this->name = "";
29                 this->description = "";
30                 this->validGenerated = false;
31         }
32
33         NAME GameElement::GetName()
34         {
35                 return this->name;
36         }
37
38         DESCRIPTION GameElement::GetDescription()
39         {
40                 return this->description;
41         }
42
43         bool GameElement::IsValidGenerated(void)
44         {
45                 return this->validGenerated;
46         }
47
48         std::string GameElement::WeightFormat(WEIGHT weight)
49         {
50                 char buf[20];
51                 sprintf_s(buf, "%6.1fkg", weight);
52                 return std::string(&buf[0]);
53         }
54
55         std::string GameElement::HeightFormat(HEIGHT height)
56         {
57                 char buf[20];
58                 sprintf_s(buf, "%6.2fm", height / 100.0f);
59                 return std::string(&buf[0]);
60         }
61
62 }