Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions src/CSI2372_FinalProject_Build1.cbp

This file was deleted.

62 changes: 0 additions & 62 deletions src/CSI2372_FinalProject_Build1.depend

This file was deleted.

44 changes: 0 additions & 44 deletions src/CSI2372_FinalProject_Build1.layout

This file was deleted.

Binary file removed src/bin/Debug/CSI2372_FinalProject_Build1.exe
Binary file not shown.
23 changes: 14 additions & 9 deletions src/include/GameBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "TileFactory.h"


template<class T, class J, unsigned int N> class GameBoard
template<class T, class J, unsigned int N, unsigned int M> class GameBoard
{
private:
std::map<string,J> pMap;
Expand All @@ -13,7 +13,19 @@ template<class T, class J, unsigned int N> class GameBoard
public:
enum Move {UP, DOWN, LEFT, RIGHT};
/** Default constructor */
GameBoard():tf(TileFactory.get()){}
GameBoard():tf(TileFactory.get(n*m)){
std::vector<const T&> a;
for(int i =0; i< N;i++){
a = std::vector<const T&>;
tVec.push(a);
}

for(int i = 0; i<N;i++){
for(int j =0); j<M;++){
tVec[]
}
}
}
/** Default destructor */
virtual ~GameBoard() {}
/** Copy constructor
Expand Down Expand Up @@ -82,14 +94,7 @@ template<class T, class J, unsigned int N> class GameBoard
}catch (...) {
add(tf.next(), x, y);
}
<<<<<<< HEAD
=======
catch ( ... ) {
add(tf.next(), x, y);
}
>>>>>>> bb93509898a631b4e5e63991d86aef511ba5c30b

}

protected:
private:
Expand Down
8 changes: 4 additions & 4 deletions src/include/Player.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef PLAYER_H
#define PLAYER_H

#include <string>

class Player
{
Expand All @@ -13,7 +13,7 @@ class Player
unsigned int _spice,
unsigned int _cart,
unsigned int _food,
string name);
std::string _name);

bool canAct() const; // returns true if food > 0
bool pay( Player& player );
Expand Down Expand Up @@ -49,14 +49,14 @@ class Player
void Setfood(unsigned int val);
void Addfood(unsigned int val);

string getName() { return name; }
std::string getName() { return name; }

unsigned int Getusedcartspace();
unsigned int Addusedcartspace(unsigned int val);

protected:
private:
string name;
std::string name;
int x;
int y;
unsigned int gold;
Expand Down
2 changes: 1 addition & 1 deletion src/include/Tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Tile
/** Default destructor */
virtual ~Tile();

bool operator == (const Tile &t);
bool operator == (const Tile &t)const;

virtual bool action(Player& player){ return false;}

Expand Down
16 changes: 16 additions & 0 deletions src/include/sdf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef SDF_H
#define SDF_H


class sdf
{
public:
/** Default constructor */
sdf();
/** Default destructor */
virtual ~sdf();
protected:
private:
};

#endif // SDF_H
61 changes: 0 additions & 61 deletions src/main.cpp

This file was deleted.

8 changes: 5 additions & 3 deletions src/src/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ Player::Player(unsigned int _gold,
unsigned int _jewel,
unsigned int _spice,
unsigned int _cart,
unsigned int _food)
unsigned int _food,
std::string _name)
:
gold(_gold),
ruby(_ruby),
fabric(_fabric),
jewel(_jewel),
spice(_spice),
cart(_cart),
food(_food)
food(_food),
name(_name)
{
//ctor
}
Expand Down Expand Up @@ -58,7 +60,7 @@ void Player::eat() {
}
}

bool Player::canAct() {
bool Player::canAct() const{
if(food > 0) {
return true;
}
Expand Down
6 changes: 5 additions & 1 deletion src/src/Tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ Tile::Tile()
Tile::~Tile()
{
//dtor
}
}

bool Tile::operator==(const Tile &t)const{
return this == &t;
}
3 changes: 2 additions & 1 deletion src/src/TileFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@ TileFactory::~TileFactory()
}

Tile* TileFactory::next(){
return 0;//tiles.pop_back();
Tile * tile = tiles.back();
return tile;
}
11 changes: 11 additions & 0 deletions src/src/sdf.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "sdf.h"

sdf::sdf()
{
//ctor
}

sdf::~sdf()
{
//dtor
}