1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
|
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
#ifndef _abilities_h_
#define _abilities_h_
#include "abilities.h"
class Card
{
public:
string name;
int conv_mana_cost;
string specific_mana;
int power, toughness;
string type;
char color; //R, B, U, G, or W
int can_block;
bool tapped;
bool attacking;
bool blocking;
bool revealed_to_opponent;
string owner;
int power_modified;
int toughness_modified;
int plus_1_1_counters;
int minus_1_1_counters;
int cast_preference_value;
int cast_later_value;
int attack_preference_value;
int attack_later_value;
int block_preference_value;
int block_later_value;
int discard_preference_value;
int discard_later_value;
int number_preference_values;
vector<Ability *> abilities;
Card( string na = "", int co = 0, string sp = "", int po = 0, int to = 0, string ty = "", char col = 'N',
int can_b = 1, bool tap = false, bool atta = false, bool bloc = false, bool reve = false, int powe_mod = 0,
int toug_mod = 0, int plus_1_1 = 0, int minu_1_1 = 0,
int cast_pref_valu = 0, int cast_late_valu = 0, int atta_pref_valu = 0, int atta_late_valu = 0,
int bloc_pref_valu = 0, int bloc_late_valu = 0, int disc_pref_valu = 0, int disc_late_valu = 0,
int numb_pref_valu = 8 )
{
name = na;
conv_mana_cost = co;
specific_mana = sp;
power = po;
toughness = to;
type = ty;
color = col;
can_block = can_b;
tapped = tap;
attacking = atta;
blocking = bloc;
revealed_to_opponent = reve;
power_modified = powe_mod;
toughness_modified = toug_mod;
plus_1_1_counters = plus_1_1;
minus_1_1_counters = minu_1_1;
cast_preference_value = cast_pref_valu;
cast_later_value = cast_late_valu;
attack_preference_value = atta_pref_valu;
attack_later_value = atta_late_valu;
block_preference_value = bloc_pref_valu;
block_later_value = bloc_late_valu;
discard_preference_value = disc_pref_valu;
discard_later_value = disc_late_valu;
number_preference_values = numb_pref_valu;
}
};
class Deck
{
public:
string name; //used to search for a specific deck
vector<Card *> cardsInDeck;
Deck( string na = "", int nu = 0 )
{
name = na;
}
};
void fillKnownCardsVector(vector<Card *> *);
void fillKnownDecksVector(vector<Deck *> *, vector<Card *> );
void playMatch(vector<Card *> );
void assign_values(Card *);
int main(int argc, char *argv[])
{
vector<Card *> KnownCardsVector;
vector<Deck *> KnownDecksVector;
fillKnownCardsVector( &KnownCardsVector );
fillKnownDecksVector(&KnownDecksVector, KnownCardsVector);
cout << KnownCardsVector[0]->abilities[0]->type;
system("PAUSE");
playMatch(KnownDecksVector[0]->cardsInDeck);
system("PAUSE");
return EXIT_SUCCESS;
}
void fillKnownCardsVector(vector<Card *> *KnownCardsVector)
{
Card *card08 = new Card( "Mountain", 0, "None", 0, 0, "Basic Land", 'R' );
card08->abilities.clear();
card08->abilities.push_back(new Tap_For_R); //work?
KnownCardsVector->push_back(card08);
}
void fillKnownDecksVector(vector<Deck *> *KnownDecksVector, vector<Card *> KnownCardsVector)
{
KnownDecksVector->clear();
Deck *deck01 = new Deck( "Mountains" );
KnownDecksVector->push_back(deck01); //[0] in KnownDecksVector
//60x Mountain
for (int i=0; i<60; i++)
{
deck01->cardsInDeck.push_back(KnownCardsVector[7]); //1 Mountain
}
}
void playMatch(vector<Card *> card_vector01)
{
assign_values(card_vector01[0]);
}
void assign_values(Card *card01)
{
for (int l=0; l < (card01->abilities.size() + 0); l++)
{
//loop just to illustrate the point
}
}
#endif
|