Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Alternative Civs > Clash of Civilizations > Documentation for the code so far...
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
04.Sep: `FC` 2.0.5 COMPLETED AND RELEASED
27.Jul: `FC` 2.0.4 COMPLETED AND RELEASED
16.Jul: `FC` 2.0.3 COMPLETED AND RELEASED

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Mark_Everson is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Arrow  Old Post 09-08-1999 06:12 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Documentation for the code so far... Support Apolyton, buy Civilization III: Complete

This is automatically generated documentation courtesy of the Javadoc feature of java. If you start at the tree link you'll see all the classes.

I have only so far put descriptions in TF (task force), Unit (military unit), UnitType and UnitStats . For the rest of the files you will get variable and method (routine) names only.

[This message has been edited by Mark_Everson (edited August 11, 1999).]

mca is offline mca
Chieftain
Odense, Denmark
Jan 1970
time: 06:13
Post  Old Post 02-09-1999 01:45
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Avatar Enlargement: We've got the solution

I just browsed through the four commented classes and wondered about the TF.getTFInfo method: Why did you put five or so "getters" (attack, defence, money, goods, food) into one method? What is the reason that there's not a separate method for each?

Martin
[This message has been edited by mca (edited September 01, 1999).]

Mark_Everson is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Post  Old Post 02-09-1999 05:23 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Lose 30 kilos (of popups)

Martin:

I just don't like having zillions of getter and setter methods lying around. It could've gone the other way too. I killed 3 fewer {s and }s doing it my way .

BTW, glad you're interested in helping to code up the map module. It will be so great to have quasi-realistic maps instead of weird stringy ones like in civ2 .

mca is offline mca
Chieftain
Odense, Denmark
Jan 1970
time: 06:13
Post  Old Post 02-09-1999 14:53
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Avatar Enlargement: We've got the solution

Well, I'll be annoying and ask "why not put all getters into just a few methods, then?" Like this:

float getFloatInfo(int)
int getIntInfo(int)
String getStringInfo(int)

or just one method:

Object getInfo(int) //

If you turn all the int arguments into Strings, scripting languages would also have an easy time.

Martin
[This message has been edited by mca (edited September 02, 1999).]

Mark_Everson is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Thumbs up  Old Post 02-09-1999 17:16 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Enter the AD-FREE zone

I could have done it like that too. Frankly, I'm a hack-and-slash non-professional programmer, so I don't have 'usual' ways to do a lot of things already figured out. I experimented with different varieties of getters in the new mil code just to see if I liked them. For intra-class information I usually just use the bare variables themselves. So typically I only bother with getters for things when the outside world needs access.

Your point about 'generic' getter methods being good for use with a macro language is interesting. I hadn't gotten that far in my thought processes. (Its first thing in the morning here so I haven't evaluated what you're saying in detail yet ) If you'd like to make other suggestions, I and the rest of the coding group would be glad to hear them. A good suggestion now could save us a lot of work later.

-Mark

mca is offline mca
Chieftain
Odense, Denmark
Jan 1970
time: 06:13
Post  Old Post 02-09-1999 19:38
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

For usual ways of doing a lot of things already figured out, I have found the book "Design Patterns: Elements of Reusable Object-Oriented Software" by Gamma et al. from Addison-Wesley (ISBN 0-201-63361-2) to be a great source of exactly that. I highly recommend it.

Martin

F_Smith is offline F_Smith
Prince
Austin, Tx 78728
May 1999
time: 05:13
Post  Old Post 02-09-1999 19:45
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton or Terrorists Win

May I disagree?

I believe each 'parameter' (or whatever you like to call variables in a class that can be set/retrieved by the macro code) should have an independent 'get' method and 'set' method.

The 'IO' component should allow for access to each of these by reading the 'macro' code and then calling the required method.

For example, (assuming we were using XML), if you wanted to create a civ you'd write a text file something like:

[Civ]
[Population]100[/Population]
[Location]20, 30[/Location]
[OtherParam]Blah blah[/OtherParam]
[/Civ]

I've substituted '[' in place of '<', since the browser interperets the '<' and '>' as a tag.

The 'IO' component would read this in, parse the tags and route the values accordingly.
[This message has been edited by F_Smith (edited September 02, 1999).]

mca is offline mca
Chieftain
Odense, Denmark
Jan 1970
time: 06:13
Post  Old Post 02-09-1999 19:55
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton, buy Civilization 2

Re getters and setters:
I must admit that I don't like the idea "generic" getters/setter much, even though I was the one to bring it up. F_Smith makes an excellent suggestion in the "Coding organization for Clash" thread: to use the Bean component model. Also, the Java reflection API can be used by the scripting language to get/set/etc, AFAIK.

Martin

Mark_Everson is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
Arrow  Old Post 03-09-1999 09:34 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Avatar Enlargement: We've got the solution

Gentlemen:

Your comments are good ones. I think the main issue is to get us together for an ICQ chat over the weekend and hash this out. I would also like to have JimC there, and of course Blade Runner.

We just need to talk it thru and take note of strengths and weaknesses of each approach. The cases where we don't know the real value / limitations of a particular approach, we'll have to design some simple tests to do soon.

We need to put this decision behind us quickly, or we're going to risk wasting a Lot of coding time.

I will start a new thread on this topic to arrange a time to meet.

Specifically, the notion of using reflection to make generic getters and setters is really attractive to me. Anyone know what the Time penalty is? It could be Very steep.

On XML, does it have loop and branching structures in it? Frankly for simply Setting up parameters for a game I would like to see an off-line editor that scenario designers can use to change all the parameters in the game. I think that would be Much more valuable than XML support.

I really don't know much about beans yet, but am interested in hearing how they could help us.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:13.
Apolyton Time is 00:13.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0405 seconds (88.61% PHP - 11.39% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net