From 7d5abc9c35e080555d1841234497ad1b06528f3a Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sun, 22 Mar 2015 19:32:29 +0100 Subject: Split struct ability_type into separate header file --- src/ability_type.hpp | 27 +++++++++++++++++++++++++++ src/ability_type_fwd.hpp | 3 +++ src/birth.cc | 1 + src/init1.cc | 1 + src/init2.cc | 1 + src/loadsave.cc | 1 + src/skills.cc | 3 +++ src/squelch/condition.cc | 1 + src/types.h | 25 ------------------------- src/types_fwd.h | 1 - src/variable.hpp | 1 + 11 files changed, 39 insertions(+), 26 deletions(-) create mode 100644 src/ability_type.hpp create mode 100644 src/ability_type_fwd.hpp diff --git a/src/ability_type.hpp b/src/ability_type.hpp new file mode 100644 index 00000000..ea8a921d --- /dev/null +++ b/src/ability_type.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include "h-basic.h" + +/** + * Abilities. + */ +struct ability_type +{ + const char *name; /* Name */ + char *desc; /* Description */ + + const char *action_desc; /* Action Description */ + + s16b action_mkey; /* Action do to */ + + s16b cost; /* Skill points cost */ + + bool_ acquired; /* Do the player actualylg ot it ? */ + + /* Prereqs */ + s16b skills[10]; /* List of prereq skills(10 max) */ + s16b skill_levels[10]; /* List of prereq skills(10 max) */ + s16b stat[6]; /* List of prereq stats */ + s16b need_abilities[10]; /* List of prereq abilities(10 max) */ + s16b forbid_abilities[10]; /* List of forbidden abilities(10 max) */ +}; diff --git a/src/ability_type_fwd.hpp b/src/ability_type_fwd.hpp new file mode 100644 index 00000000..bade8638 --- /dev/null +++ b/src/ability_type_fwd.hpp @@ -0,0 +1,3 @@ +#pragma once + +struct ability_type; diff --git a/src/birth.cc b/src/birth.cc index 81ee4007..573c9ce6 100644 --- a/src/birth.cc +++ b/src/birth.cc @@ -9,6 +9,7 @@ #include "birth.h" #include "angband.h" +#include "ability_type.hpp" #include "corrupt.hpp" #include "cmd4.hpp" #include "cmd5.hpp" diff --git a/src/init1.cc b/src/init1.cc index 93e7d2c0..eb8dc876 100644 --- a/src/init1.cc +++ b/src/init1.cc @@ -1,6 +1,7 @@ #include "init1.hpp" #include "angband.h" +#include "ability_type.hpp" #include "cave.hpp" #include "files.hpp" #include "gods.hpp" diff --git a/src/init2.cc b/src/init2.cc index a30bb15f..7fe78d73 100644 --- a/src/init2.cc +++ b/src/init2.cc @@ -2,6 +2,7 @@ #include "init2.h" #include "angband.h" +#include "ability_type.hpp" #include "cave.hpp" #include "files.hpp" #include "generate.hpp" diff --git a/src/loadsave.cc b/src/loadsave.cc index b21bc723..0de2f3ed 100644 --- a/src/loadsave.cc +++ b/src/loadsave.cc @@ -2,6 +2,7 @@ #include "loadsave.h" #include "angband.h" +#include "ability_type.hpp" #include "birth.hpp" #include "init1.hpp" #include "init2.hpp" diff --git a/src/skills.cc b/src/skills.cc index 787cbfa5..7936b68c 100644 --- a/src/skills.cc +++ b/src/skills.cc @@ -6,7 +6,10 @@ * included in all such copies. */ +#include "skills.hpp" + #include "angband.h" +#include "ability_type.hpp" #include "birth.hpp" #include "cmd2.hpp" #include "cmd3.hpp" diff --git a/src/squelch/condition.cc b/src/squelch/condition.cc index 8d8eb028..fdc777d3 100644 --- a/src/squelch/condition.cc +++ b/src/squelch/condition.cc @@ -5,6 +5,7 @@ #include "tome/squelch/cursor.hpp" #include "tome/squelch/tree_printer.hpp" +#include "ability_type.hpp" #include "angband.h" #include "object1.hpp" #include "object2.hpp" diff --git a/src/types.h b/src/types.h index ff944c0e..f630b79d 100644 --- a/src/types.h +++ b/src/types.h @@ -2496,31 +2496,6 @@ struct timer_type void (*callback)(); /* The C function to call upon firing */ }; -/* - * Abilities - */ -typedef struct ability_type ability_type; -struct ability_type -{ - const char *name; /* Name */ - char *desc; /* Description */ - - const char *action_desc; /* Action Description */ - - s16b action_mkey; /* Action do to */ - - s16b cost; /* Skill points cost */ - - bool_ acquired; /* Do the player actualylg ot it ? */ - - /* Prereqs */ - s16b skills[10]; /* List of prereq skills(10 max) */ - s16b skill_levels[10]; /* List of prereq skills(10 max) */ - s16b stat[6]; /* List of prereq stats */ - s16b need_abilities[10]; /* List of prereq abilities(10 max) */ - s16b forbid_abilities[10]; /* List of forbidden abilities(10 max) */ -}; - /** * Module metadata */ diff --git a/src/types_fwd.h b/src/types_fwd.h index d1dbc7e0..3fa523d6 100644 --- a/src/types_fwd.h +++ b/src/types_fwd.h @@ -71,7 +71,6 @@ struct school_provider_list; struct school_type; struct gf_name_type; struct timer_type; -struct ability_type; struct module_meta_type; struct module_type; diff --git a/src/variable.hpp b/src/variable.hpp index 6ba3cea9..d28f9757 100644 --- a/src/variable.hpp +++ b/src/variable.hpp @@ -1,6 +1,7 @@ #pragma once #include "angband.h" +#include "ability_type_fwd.hpp" extern int max_macrotrigger; extern char *macro_template; -- cgit v1.2.3