Move tool stuff to tool.{h,cpp}
[oweals/minetest.git] / src / tool.h
1 /*
2 Minetest-c55
3 Copyright (C) 2011 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef TOOL_HEADER
21 #define TOOL_HEADER
22
23 #include <string>
24
25 struct ToolDiggingProperties
26 {
27         // time = basetime + sum(feature here * feature in MaterialProperties)
28         float basetime;
29         float dt_weight;
30         float dt_crackiness;
31         float dt_crumbliness;
32         float dt_cuttability;
33         float basedurability;
34         float dd_weight;
35         float dd_crackiness;
36         float dd_crumbliness;
37         float dd_cuttability;
38
39         ToolDiggingProperties(float a=0.75, float b=0, float c=0, float d=0, float e=0,
40                         float f=50, float g=0, float h=0, float i=0, float j=0):
41                 basetime(a),
42                 dt_weight(b),
43                 dt_crackiness(c),
44                 dt_crumbliness(d),
45                 dt_cuttability(e),
46                 basedurability(f),
47                 dd_weight(g),
48                 dd_crackiness(h),
49                 dd_crumbliness(i),
50                 dd_cuttability(j)
51         {}
52 };
53
54 std::string tool_get_imagename(const std::string &toolname);
55
56 ToolDiggingProperties tool_get_digging_properties(const std::string &toolname);
57
58 #endif
59