rendered paste bodycard.h->
class card{
//friend class deck; //uhh might not need this
public:
//enums
enum CardColor {eWhite, eRed, eGreen, ePurple};
enum CardCount {eZero, eOne, eTwo, eThree};
enum CardShape {eNone, eOvals, eSquiggles, eDiamonds};
enum CardShade {eBlank, eSolid, eOpen, eStripped};
//constructors
card();
card(CardColor,CardCount,CardShape,CardShade);
//~card();
//get functions
CardColor getColor(){return color;}
CardCount getCount(){return count;}
CardShape getShape(){return shape;}
CardShade getShade(){return shade;}
bool getIsUsed(){return isUsed;}
//set functions
void setColor(CardColor newColor){color = newColor;}
void setCount(CardCount newCount){count = newCount;}
void setShape(CardShape newShape){shape = newShape;}
void setShade(CardShade newShade){shade = newShade;}
private:
bool isUsed;
CardColor color;
CardCount count;
CardShape shape;
CardShade shade;
};
card.cpp->
#include "card.h"
card::card(){
color = eWhite;
count = eZero;
shape = eNone;
shade = eBlank;
isUsed = false;
}
card::card(CardColor newColor, CardCount newCount, CardShape newShape, CardShade newShade)
{
setColor(newColor);
setCount(newCount);
setShape(newShape);
setShade(newShade);
isUsed = false;
}
nullSet.cpp ->
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <cctype>
#include "card.cpp"
#include <fstream>
#include <string>
//#include "logic.cpp"
//#indlude "display.cpp"
// i will move these
void fillDeck(std::vector<card>::iterator &);
void makeRandom(std::vector<card>::iterator &);
int main(){
std::vector<card> deck(81);
std::vector<card>::iterator deckIter;
deckIter = deck.begin();
fillDeck(deckIter);
makeRandom(deckIter);
// set up table - 12 cards
//display
//prompt
return 0;
}
void fillDeck(std::vector<card>::iterator &localIter)
{
//card::CardColor eRed,eGreen=eGreen,ePurple=ePurple;
std::vector<card::CardColor>::iterator it1;
std::vector<card::CardColor> CardColors;
CardColors.push_back(eRed);
CardColors.push_back(eGreen);
CardColors.push_back(ePurple);
card::CardCount eOne,eTwo,eThree;
std::vector<card::CardCount>::iterator it2;
std::vector<card::CardCount> CardCounts;
CardCounts.push_back(eOne);
CardCounts.push_back(eTwo);
CardCounts.push_back(eThree);
card::CardShape eOvals,eSquiggles,eDiamonds;
std::vector<card::CardShape>::iterator it3;
std::vector<card::CardShape> CardShapes;
CardShapes.push_back(eOvals);
CardShapes.push_back(eSquiggles);
CardShapes.push_back(eDiamonds);
card::CardShade eSolid=eSolid,eOpen,eStripped;
std::vector<card::CardShade>::iterator it4;
std::vector<card::CardShade> CardShades;
CardShades.push_back(eSolid);
CardShades.push_back(eOpen);
CardShades.push_back(eStripped);
for(it1 = CardColors.begin(); it1 != CardColors.end(); it1++)
{
for(it2 = CardCounts.begin(); it2 != CardCounts.end(); it2++)
{
for(it3 = CardShapes.begin(); it3 != CardShapes.end(); it3++)
{
for(it4 = CardShades.begin(); it4 != CardShades.end(); it4++)
{
std::cout <<*it1<<" "<<*it2<<" "<<*it3<<" "<<*it4<<std::endl;
//myCard = new card::card(*it1,*it2,*it3,*it4);
//*localIter=myCard;
//localIter++;
//delete myCard;
}
}
}
}
}
void makeRandom(std::vector<card>::iterator &localIter)
{
}
output>
-1 0 -1 0
-1 0 -1 0
-1 0 -1 -1073742560
-1 0 2036621151 0
-1 0 2036621151 0
-1 0 2036621151 -1073742560
-1 0 115 0
-1 0 115 0
-1 0 115 -1073742560
-1 0 -1 0
-1 0 -1 0
-1 0 -1 -1073742560
-1 0 2036621151 0
-1 0 2036621151 0
-1 0 2036621151 -1073742560
-1 0 115 0
-1 0 115 0
-1 0 115 -1073742560
-1 0 -1 0
-1 0 -1 0
-1 0 -1 -1073742560
-1 0 2036621151 0
-1 0 2036621151 0
-1 0 2036621151 -1073742560
-1 0 115 0
-1 0 115 0
-1 0 115 -1073742560
-1073742684 0 -1 0
-1073742684 0 -1 0
-1073742684 0 -1 -1073742560
-1073742684 0 2036621151 0
-1073742684 0 2036621151 0
-1073742684 0 2036621151 -1073742560
-1073742684 0 115 0
-1073742684 0 115 0
-1073742684 0 115 -1073742560
-1073742684 0 -1 0
-1073742684 0 -1 0
-1073742684 0 -1 -1073742560
-1073742684 0 2036621151 0
-1073742684 0 2036621151 0
-1073742684 0 2036621151 -1073742560
-1073742684 0 115 0
-1073742684 0 115 0
-1073742684 0 115 -1073742560
-1073742684 0 -1 0
-1073742684 0 -1 0
-1073742684 0 -1 -1073742560
-1073742684 0 2036621151 0
-1073742684 0 2036621151 0
-1073742684 0 2036621151 -1073742560
-1073742684 0 115 0
-1073742684 0 115 0
-1073742684 0 115 -1073742560
-1073742740 0 -1 0
-1073742740 0 -1 0
-1073742740 0 -1 -1073742560
-1073742740 0 2036621151 0
-1073742740 0 2036621151 0
-1073742740 0 2036621151 -1073742560
-1073742740 0 115 0
-1073742740 0 115 0
-1073742740 0 115 -1073742560
-1073742740 0 -1 0
-1073742740 0 -1 0
-1073742740 0 -1 -1073742560
-1073742740 0 2036621151 0
-1073742740 0 2036621151 0
-1073742740 0 2036621151 -1073742560
-1073742740 0 115 0
-1073742740 0 115 0
-1073742740 0 115 -1073742560
-1073742740 0 -1 0
-1073742740 0 -1 0
-1073742740 0 -1 -1073742560
-1073742740 0 2036621151 0
-1073742740 0 2036621151 0
-1073742740 0 2036621151 -1073742560
-1073742740 0 115 0
-1073742740 0 115 0
-1073742740 0 115 -1073742560