School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,474 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,719 people online right now. Registration is fast and FREE... Join Now!




Setting Specific Geographical Areas

 

Setting Specific Geographical Areas, Wondering what would be a good way...

metaphorical

17 Jun, 2009 - 03:44 PM
Post #1

New D.I.C Head
*

Joined: 4 May, 2009
Posts: 13


My Contributions
I was wondering if anyone else who has created games in C++
could help me with something. blink.gif

Me and a cohort, that I was introduced to on this site, are creating
an in the console text strategy game with what we would like to
have 12 continents that you can fight to take over, like in risk
almost. Now, I was wondering what would be a good way to
set up the continents in the code. w00t.gif

They need certain things like a way to set up the diplomacy of each
continent in comparison to the players, etc. crazy.gif

But, as I said before I am just curious about what someone who has
done this before would recommend on setting up the continents. biggrin.gif

Thanks in advance.

User is offlineProfile CardPM
+Quote Post


bsaunders

RE: Setting Specific Geographical Areas

17 Jun, 2009 - 04:59 PM
Post #2

D.I.C Addict
****

Joined: 18 Jan, 2009
Posts: 554



Thanked: 42 times
My Contributions
Maybe you can declare a Continent class that describes a single continent.
User is offlineProfile CardPM
+Quote Post

Gorian

RE: Setting Specific Geographical Areas

17 Jun, 2009 - 05:32 PM
Post #3

DIC: Preparing for the Zomie Apocalypse...
Group Icon

Joined: 28 Jun, 2008
Posts: 595



Thanked: 7 times
Dream Kudos: 125
My Contributions
perhaps something like this:

cpp


class Province {
string name;
float size;
//etc
};

class Continent {
string name;
float size;
float DiplomacyRating;
Province provinces[100];
};
Continent continent1, continent2, continent3;


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 02:57AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month