Skip to content
Snippets Groups Projects
Commit f603fe07 authored by Ian Prins's avatar Ian Prins
Browse files

fix linker erros, various

parent afd08392
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,16 @@
#include "include/coord.h"
#include "include/item.h"
std::vector<ARMOR_TUPLE_TYPE > Armor::typeVector = {
ARMOR_TUPLE_TYPE {"Leather Armor", 3},
ARMOR_TUPLE_TYPE {"Ring Mail", 3},
ARMOR_TUPLE_TYPE {"Scale Mail", 4},
ARMOR_TUPLE_TYPE {"Chain Mail", 5},
ARMOR_TUPLE_TYPE {"Banded Mail", 6},
ARMOR_TUPLE_TYPE {"Splint Mail", 6},
ARMOR_TUPLE_TYPE {"Plate Mail", 7}
};
Armor::Armor(Coord location)
: Armor(location, Item::Context::FLOOR, rand() % Armor::typeVector.size()) {}
......
......@@ -16,18 +16,8 @@ class Armor : public Item {
int getRating();
private:
static std::vector<ARMOR_TUPLE_TYPE> typeVector;
static std::vector<ARMOR_TUPLE_TYPE > typeVector;
int enchantProtection;
int rating;
};
std::vector<ARMOR_TUPLE_TYPE> Armor::typeVector = {
ARMOR_TUPLE_TYPE {"Leather Armor", 3},
ARMOR_TUPLE_TYPE {"Ring Mail", 3},
ARMOR_TUPLE_TYPE {"Scale Mail", 4},
ARMOR_TUPLE_TYPE {"Chain Mail", 5},
ARMOR_TUPLE_TYPE {"Banded Mail", 6},
ARMOR_TUPLE_TYPE {"Splint Mail", 6},
ARMOR_TUPLE_TYPE {"Plate Mail", 7}
};
\ No newline at end of file
......@@ -39,4 +39,3 @@ class Item : public Feature {
int type;
};
std::map<std::string, std::map<int, bool> > Item::identified;
......@@ -26,7 +26,7 @@ class Monster : public Mob {
int turn(Level*);
private:
static std::map<char, MONSTER_TUPLE_TYPE> templateMap;
static std::map<char, MONSTER_TUPLE_TYPE > templateMap;
enum Behaviour {AGGRESSIVE, FLYING, REGENERATIVE, GREEDY, INVISIBLE};
......@@ -36,7 +36,7 @@ class Monster : public Mob {
};
// Monster Template Values
std::map<char, MONSTER_TUPLE_TYPE> Monster::templateMap = {
std::map<char, MONSTER_TUPLE_TYPE > Monster::templateMap = {
{'A', MONSTER_TUPLE_TYPE { 2, 0,{std::make_pair( 0, 0)}, 20, "A", 5,std::make_pair( 5,8), "Aquator",std::make_pair( 8,17)}},
{'B', MONSTER_TUPLE_TYPE { 3, 0,{std::make_pair( 1, 2)}, 1, "F", 1,std::make_pair( 1,8), "Bat",std::make_pair( 1, 8)}},
{'C', MONSTER_TUPLE_TYPE { 4, 15,{std::make_pair( 1, 6),
......
......@@ -21,29 +21,7 @@ class Potion : public Item {
bool activate(Mob*);
private:
static std::vector<POTION_TUPLE_TYPE> typeVector;
static std::vector<POTION_TUPLE_TYPE > typeVector;
static std::vector<std::string> nameVector;
};
std::vector<POTION_TUPLE_TYPE> Potion::typeVector = {
POTION_TUPLE_TYPE {"Potion of Increase Strength"},
POTION_TUPLE_TYPE {"Potion of Restore Strength"},
POTION_TUPLE_TYPE {"Potion of Healing"},
POTION_TUPLE_TYPE {"Potion of Extra Healing"},
POTION_TUPLE_TYPE {"Potion of Poison"},
POTION_TUPLE_TYPE {"Potion of Raise Level"},
POTION_TUPLE_TYPE {"Potion of Blindness"},
POTION_TUPLE_TYPE {"Potion of Hallucination"},
POTION_TUPLE_TYPE {"Potion of Detect Monster"},
POTION_TUPLE_TYPE {"Potion of Detect Things"},
POTION_TUPLE_TYPE {"Potion of Confusion"},
POTION_TUPLE_TYPE {"Potion of Levitation"},
POTION_TUPLE_TYPE {"Potion of Haste Self"},
POTION_TUPLE_TYPE {"Potion of See Invisible"}
};
std::vector<std::string> Potion::nameVector = {
"Blue Potion", "Red Potion", "Green Potion", "Grey Potion", "Brown Potion",
"Clear Potion", "Pink Potion", "White Potion", "Purple Potion", "Black Potion",
"Yellow Potion", "Plaid Potion", "Burgundy Potion", "Beige Potion"
};
\ No newline at end of file
......@@ -19,26 +19,7 @@ class Ring : public Item {
bool activate(Level*);
private:
static std::vector<RING_TUPLE_TYPE> typeVector;
static std::vector<RING_TUPLE_TYPE > typeVector;
static std::vector<std::string> nameVector;
};
std::vector<RING_TUPLE_TYPE> Ring::typeVector = {
RING_TUPLE_TYPE {"Ring of Stealth"},
RING_TUPLE_TYPE {"Ring of Teleportation"},
RING_TUPLE_TYPE {"Ring of Regeneration"},
RING_TUPLE_TYPE {"Ring of Slow Digestion"},
RING_TUPLE_TYPE {"Ring of Add Strength"},
RING_TUPLE_TYPE {"Ring of Sustain Strength"},
RING_TUPLE_TYPE {"Ring of Dexterity"},
RING_TUPLE_TYPE {"Ring of Adornment"},
RING_TUPLE_TYPE {"Ring of See Invisible"},
RING_TUPLE_TYPE {"Ring of Maintain Armor"},
RING_TUPLE_TYPE {"Ring of Searching"}
};
std::vector<std::string> Ring::nameVector = {
"Diamond Ring", "Stibotantalite Ring", "Lapi-Lazuli Ring", "Ruby Ring", "Emerald Ring",
"Sapphire Ring", "Amethyst Ring", "Quartz Ring", "Tiger-Eye Ring", "Opal Ring",
"Agate Ring", "Turquoise Ring", "Pearl Ring", "Garnet Ring"
};
\ No newline at end of file
......@@ -20,36 +20,8 @@ class Scroll : public Item {
bool activate(Level*);
private:
static std::vector<SCROLL_TUPLE_TYPE> typeVector;
static std::vector<SCROLL_TUPLE_TYPE > typeVector;
static std::vector<std::string> nameVector;
static std::vector<std::string> syllableVector;
};
std::vector<SCROLL_TUPLE_TYPE> Scroll::typeVector = {
SCROLL_TUPLE_TYPE {"Scroll of Protect Armor"},
SCROLL_TUPLE_TYPE {"Scroll of Hold Monster"},
SCROLL_TUPLE_TYPE {"Scroll of Enchant Weapon"},
SCROLL_TUPLE_TYPE {"Scroll of Enchant Armor"},
SCROLL_TUPLE_TYPE {"Scroll of Identify"},
SCROLL_TUPLE_TYPE {"Scroll of Teleportation"},
SCROLL_TUPLE_TYPE {"Scroll of Sleep"},
SCROLL_TUPLE_TYPE {"Scroll of Scare Monster"},
SCROLL_TUPLE_TYPE {"Scroll of Remove Curse"},
SCROLL_TUPLE_TYPE {"Scroll of Create Monster"},
SCROLL_TUPLE_TYPE {"Scroll of Aggravate Monster"},
SCROLL_TUPLE_TYPE {"Scroll of Magic Mapping"},
SCROLL_TUPLE_TYPE {"Scroll of Confuse Monster"}
};
std::vector<std::string> Scroll::nameVector;
std::vector<std::string> Scroll::syllableVector = {
"Blech", "Foo", "Barf", "Rech", "Bar",
"Quo", "Bloto", "Oh", "Caca", "Blorp",
"Erp", "Festr", "Rot", "Slie", "Snorf",
"Iky", "Yuky", "Ooze", "Ah", "Bahl",
"Zep", "Druhl", "Flem", "Behil", "Arek",
"Mep", "Zihr", "Grit", "Kona", "Kini",
"Ichi", "Tims", "Ogr", "Oo", "Ighr",
"Coph", "Swerr", "Mihln", "Poxi"
};
\ No newline at end of file
......@@ -21,31 +21,9 @@ class Wand : public Item {
int getCharges();
private:
static std::vector<WAND_TUPLE_TYPE> typeVector;
static std::vector<WAND_TUPLE_TYPE > typeVector;
static std::vector<std::string> nameVector;
int charges;
};
std::vector<WAND_TUPLE_TYPE> Wand::typeVector = {
WAND_TUPLE_TYPE {"Wand of Teleport Away"},
WAND_TUPLE_TYPE {"Wand of Slow Monster"},
WAND_TUPLE_TYPE {"Wand of Invisibility"},
WAND_TUPLE_TYPE {"Wand of Polymorph"},
WAND_TUPLE_TYPE {"Wand of Haste Monster"},
WAND_TUPLE_TYPE {"Wand of Magic Missile"},
WAND_TUPLE_TYPE {"Wand of Cancellation"},
WAND_TUPLE_TYPE {"Wand of Do Nothing"},
WAND_TUPLE_TYPE {"Wand of Drain Life"},
WAND_TUPLE_TYPE {"Wand of Cold"},
WAND_TUPLE_TYPE {"Wand of Fire"}
};
std::vector<std::string> Wand::nameVector = {
"Steel Wand", "Bronze Wand", "Gold Wand", "Silver Wand", "Copper Wand",
"Nickel Wand", "Cobalt Wand", "Tin Wand", "Iron Wand", "Magnesium Wand",
"Chrome Wand", "Carbon Wand", "Platinum Wand", "Silicon Wand", "Titanium Wand",
"Teak Wand", "Oak Wand", "Cherry Wand", "Birch Wand", "Pine Wand",
"Cedar Wand", "Redwood Wand", "Balsa Wand", "Ivory Wand", "Walnut Wand",
"Maple Wand", "Mahogany Wand", "Elm Wand", "Palm Wand", "Wooden Wand"
};
\ No newline at end of file
......@@ -18,7 +18,7 @@ class Weapon : public Item {
bool isMelee();
private:
static std::vector<WEAPON_TUPLE_TYPE> typeVector;
static std::vector<WEAPON_TUPLE_TYPE > typeVector;
std::pair<int, int> damage;
int enchantDamage;
......@@ -26,13 +26,3 @@ class Weapon : public Item {
bool melee;
};
std::vector<WEAPON_TUPLE_TYPE> Weapon::typeVector = {
WEAPON_TUPLE_TYPE {"Short Bow", std::make_pair(0, 0), false, false},
WEAPON_TUPLE_TYPE {"Darts", std::make_pair(1, 1), true, true},
WEAPON_TUPLE_TYPE {"Arrows", std::make_pair(1, 2), true, true},
WEAPON_TUPLE_TYPE {"Daggers", std::make_pair(1, 3), true, true},
WEAPON_TUPLE_TYPE {"Shurikens", std::make_pair(1, 4), true, true},
WEAPON_TUPLE_TYPE {"Mace", std::make_pair(2, 3), true, false},
WEAPON_TUPLE_TYPE {"Long Sword", std::make_pair(3, 4), true, false},
WEAPON_TUPLE_TYPE {"Two-Handed Sword", std::make_pair(4, 5), true, false}
};
\ No newline at end of file
......@@ -4,6 +4,8 @@
#include "include/item.h"
std::map<std::string, std::map<int, bool> > Item::identified;
Item::Item(char symbol, Coord location, Item::Context context, std::string className, std::string name, std::string pseudoName, int type, bool canStack, bool canThrow)
: Feature(symbol, location),
canStack(canStack),
......@@ -66,4 +68,4 @@ bool Item::isThrowable() {
void Item::setIdentified(bool newValue) {
Item::identified[this->className][this->type] = newValue;
}
\ No newline at end of file
}
......@@ -6,6 +6,29 @@
#include "include/item.h"
#include "include/potion.h"
std::vector<std::string> Potion::nameVector = {
"Blue Potion", "Red Potion", "Green Potion", "Grey Potion", "Brown Potion",
"Clear Potion", "Pink Potion", "White Potion", "Purple Potion", "Black Potion",
"Yellow Potion", "Plaid Potion", "Burgundy Potion", "Beige Potion"
};
std::vector<POTION_TUPLE_TYPE > Potion::typeVector = {
POTION_TUPLE_TYPE {"Potion of Increase Strength"},
POTION_TUPLE_TYPE {"Potion of Restore Strength"},
POTION_TUPLE_TYPE {"Potion of Healing"},
POTION_TUPLE_TYPE {"Potion of Extra Healing"},
POTION_TUPLE_TYPE {"Potion of Poison"},
POTION_TUPLE_TYPE {"Potion of Raise Level"},
POTION_TUPLE_TYPE {"Potion of Blindness"},
POTION_TUPLE_TYPE {"Potion of Hallucination"},
POTION_TUPLE_TYPE {"Potion of Detect Monster"},
POTION_TUPLE_TYPE {"Potion of Detect Things"},
POTION_TUPLE_TYPE {"Potion of Confusion"},
POTION_TUPLE_TYPE {"Potion of Levitation"},
POTION_TUPLE_TYPE {"Potion of Haste Self"},
POTION_TUPLE_TYPE {"Potion of See Invisible"}
};
void Potion::initializeMap() {
std::random_shuffle(Potion::nameVector.begin(), Potion::nameVector.end());
}
......@@ -20,4 +43,4 @@ bool Potion::activate(Mob* mob) {
// TODO
return true;
}
\ No newline at end of file
}
......@@ -6,6 +6,26 @@
#include "include/item.h"
#include "include/ring.h"
std::vector<RING_TUPLE_TYPE > Ring::typeVector = {
RING_TUPLE_TYPE {"Ring of Stealth"},
RING_TUPLE_TYPE {"Ring of Teleportation"},
RING_TUPLE_TYPE {"Ring of Regeneration"},
RING_TUPLE_TYPE {"Ring of Slow Digestion"},
RING_TUPLE_TYPE {"Ring of Add Strength"},
RING_TUPLE_TYPE {"Ring of Sustain Strength"},
RING_TUPLE_TYPE {"Ring of Dexterity"},
RING_TUPLE_TYPE {"Ring of Adornment"},
RING_TUPLE_TYPE {"Ring of See Invisible"},
RING_TUPLE_TYPE {"Ring of Maintain Armor"},
RING_TUPLE_TYPE {"Ring of Searching"}
};
std::vector<std::string> Ring::nameVector = {
"Diamond Ring", "Stibotantalite Ring", "Lapi-Lazuli Ring", "Ruby Ring", "Emerald Ring",
"Sapphire Ring", "Amethyst Ring", "Quartz Ring", "Tiger-Eye Ring", "Opal Ring",
"Agate Ring", "Turquoise Ring", "Pearl Ring", "Garnet Ring"
};
void Ring::initializeMap() {
std::random_shuffle(Ring::nameVector.begin(), Ring::nameVector.end());
}
......@@ -20,4 +40,4 @@ bool Ring::activate(Level* level) {
// TODO
return true;
}
\ No newline at end of file
}
......@@ -6,6 +6,35 @@
#include "include/item.h"
#include "include/scroll.h"
std::vector<SCROLL_TUPLE_TYPE > Scroll::typeVector = {
SCROLL_TUPLE_TYPE {"Scroll of Protect Armor"},
SCROLL_TUPLE_TYPE {"Scroll of Hold Monster"},
SCROLL_TUPLE_TYPE {"Scroll of Enchant Weapon"},
SCROLL_TUPLE_TYPE {"Scroll of Enchant Armor"},
SCROLL_TUPLE_TYPE {"Scroll of Identify"},
SCROLL_TUPLE_TYPE {"Scroll of Teleportation"},
SCROLL_TUPLE_TYPE {"Scroll of Sleep"},
SCROLL_TUPLE_TYPE {"Scroll of Scare Monster"},
SCROLL_TUPLE_TYPE {"Scroll of Remove Curse"},
SCROLL_TUPLE_TYPE {"Scroll of Create Monster"},
SCROLL_TUPLE_TYPE {"Scroll of Aggravate Monster"},
SCROLL_TUPLE_TYPE {"Scroll of Magic Mapping"},
SCROLL_TUPLE_TYPE {"Scroll of Confuse Monster"}
};
std::vector<std::string> Scroll::nameVector;
std::vector<std::string> Scroll::syllableVector = {
"Blech", "Foo", "Barf", "Rech", "Bar",
"Quo", "Bloto", "Oh", "Caca", "Blorp",
"Erp", "Festr", "Rot", "Slie", "Snorf",
"Iky", "Yuky", "Ooze", "Ah", "Bahl",
"Zep", "Druhl", "Flem", "Behil", "Arek",
"Mep", "Zihr", "Grit", "Kona", "Kini",
"Ichi", "Tims", "Ogr", "Oo", "Ighr",
"Coph", "Swerr", "Mihln", "Poxi"
};
void Scroll::initializeMap() {
for (int type = 0 ; type < static_cast<int>(Scroll::typeVector.size()) ; type++) {
std::string scrollName = "Scroll titled '";
......@@ -32,4 +61,4 @@ bool Scroll::activate(Level* level) {
// TODO
return true;
}
\ No newline at end of file
}
......@@ -6,6 +6,29 @@
#include "include/item.h"
#include "include/wand.h"
std::vector<WAND_TUPLE_TYPE > Wand::typeVector = {
WAND_TUPLE_TYPE {"Wand of Teleport Away"},
WAND_TUPLE_TYPE {"Wand of Slow Monster"},
WAND_TUPLE_TYPE {"Wand of Invisibility"},
WAND_TUPLE_TYPE {"Wand of Polymorph"},
WAND_TUPLE_TYPE {"Wand of Haste Monster"},
WAND_TUPLE_TYPE {"Wand of Magic Missile"},
WAND_TUPLE_TYPE {"Wand of Cancellation"},
WAND_TUPLE_TYPE {"Wand of Do Nothing"},
WAND_TUPLE_TYPE {"Wand of Drain Life"},
WAND_TUPLE_TYPE {"Wand of Cold"},
WAND_TUPLE_TYPE {"Wand of Fire"}
};
std::vector<std::string> Wand::nameVector = {
"Steel Wand", "Bronze Wand", "Gold Wand", "Silver Wand", "Copper Wand",
"Nickel Wand", "Cobalt Wand", "Tin Wand", "Iron Wand", "Magnesium Wand",
"Chrome Wand", "Carbon Wand", "Platinum Wand", "Silicon Wand", "Titanium Wand",
"Teak Wand", "Oak Wand", "Cherry Wand", "Birch Wand", "Pine Wand",
"Cedar Wand", "Redwood Wand", "Balsa Wand", "Ivory Wand", "Walnut Wand",
"Maple Wand", "Mahogany Wand", "Elm Wand", "Palm Wand", "Wooden Wand"
};
void Wand::initializeMap() {
std::random_shuffle(Wand::nameVector.begin(), Wand::nameVector.end());
}
......@@ -25,4 +48,4 @@ bool Wand::activate(Level* level) {
int Wand::getCharges() {
return this->charges;
}
\ No newline at end of file
}
......@@ -5,6 +5,17 @@
#include "include/item.h"
#include "include/weapon.h"
std::vector<WEAPON_TUPLE_TYPE > Weapon::typeVector = {
WEAPON_TUPLE_TYPE {"Short Bow", std::make_pair(0, 0), false, false},
WEAPON_TUPLE_TYPE {"Darts", std::make_pair(1, 1), true, true},
WEAPON_TUPLE_TYPE {"Arrows", std::make_pair(1, 2), true, true},
WEAPON_TUPLE_TYPE {"Daggers", std::make_pair(1, 3), true, true},
WEAPON_TUPLE_TYPE {"Shurikens", std::make_pair(1, 4), true, true},
WEAPON_TUPLE_TYPE {"Mace", std::make_pair(2, 3), true, false},
WEAPON_TUPLE_TYPE {"Long Sword", std::make_pair(3, 4), true, false},
WEAPON_TUPLE_TYPE {"Two-Handed Sword", std::make_pair(4, 5), true, false}
};
Weapon::Weapon(Coord location)
: Weapon(location, Item::Context::FLOOR, rand() % Weapon::typeVector.size()) {}
......@@ -27,4 +38,4 @@ std::tuple<int, int, int> Weapon::getDamage() {
bool Weapon::isMelee() {
return this->melee;
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment