Skip to content

Commit

Permalink
Update 0.0.005 -> 0.0.006
Browse files Browse the repository at this point in the history
Add Settlement WorldObjectGlobal class.
Add ability to add settlement to Civ.
Remove old code from Civ_Dwarven.
Remove some debug messages.
Bugfix: INITIAL_YEARS_SIMULATE was simulating 10x the given value.
Remove old code from Tribe.
Add evolveToCiv function in World. Tribes object can be converted into Civ object.
Add ability to remove specific object from World.
Minor dependency improvements.
  • Loading branch information
RyanBabij committed Jul 11, 2018
1 parent b9150ca commit 71c83e7
Show file tree
Hide file tree
Showing 20 changed files with 181 additions and 1,049 deletions.
9 changes: 8 additions & 1 deletion Civ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#ifndef GUILD_CIV_CPP
#define GUILD_CIV_CPP

class Settlement;

#include "Civ.hpp"

Civ::Civ()
Expand All @@ -10,7 +12,7 @@ Civ::Civ()
money=100;
world=0;

nFood=0;
//nFood=0;
}

void Civ::init(World* _world)
Expand All @@ -30,6 +32,11 @@ void Civ::init(World* _world)

}

void Civ::addSettlement(Settlement * _settlement)
{
vSettlement.push(_settlement);
}

// // RETURN THE NUMBER OF NEIGHBORING FOG TILES. (0-8).
// int neighboringFog ( int _x, int _y );
// // RETURN THE NEIGHBORING TILE WITH THE MOST FOG. IF ALL OR SOME TILES ARE EQUALLY FOGGY, RETURN A RANDOM ONE OF THE FOGGIEST ONES.
Expand Down
39 changes: 17 additions & 22 deletions Civ.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
#ifndef GUILD_CIV_HPP
#define GUILD_CIV_HPP

//class Character;
//class World;

//#include "GuildCalendar.hpp"
class Character;
class Settlement;


// CIVMANAGER STORES DATA SHARED ACROSS ALL CIVS.
Expand All @@ -22,15 +20,7 @@ CivManager civManager;
class Civ
{
private:
Vector <std::string> familyNamePool;




//GuildCalendar* calendar; /* Use world pointer. */




public:

Expand All @@ -48,18 +38,15 @@ class Civ
// TRUE IF A CIV CAN SEE THIS TILE, FALSE OTHERWISE.
ArrayS2 <bool> aVisible;

// EACH TILE MAY ONLY BE OWNED BY ONE CIV, THEREFORE THIS ARRAY IS SHARED BETWEEN ALL CIVS.
//static ArrayS2 <Civ*> aOwnership;

/* ABSTRACT TEST STUFF */
int nFood;



// A list of all characters owned by this Civ. Each Character is owned by exactly one Civ.
Vector <Character*> vCharacter;
//Vector <City*> vCity;

// A list of all settlements owned by this Civ. Each Settlement is owned by exactly one Civ.
Vector <Settlement*> vSettlement;


//Vector <Army*> vArmy;
//Vector <Navy*> vNavy;
//Vector <Unit*> vUnit;

std::string name;
int money;
Expand All @@ -70,10 +57,18 @@ class Civ
int colourGreen;
int colourBlue;

enum enumRace { NONE=0, HUMAN=1, DWARVEN=2, ELVEN=3};
int race;

Civ();

// MAKE THE CIV AWARE OF THE EXISTENCE OF THE PASSED CIV.
void addContact(Civ*);

// SETTLEMENT FUNCTIONS

void addSettlement( Settlement * );


void manageArmy();

Expand Down
Loading

0 comments on commit 71c83e7

Please sign in to comment.