[Freeciv-Dev] [patch #1942] refactor first portion of ai_airlift into find_neediest_airlift_city
Update of patch #1942 (project freeciv): Status: Ready For Test = Done Open/Closed:Open = Closed ___ Reply to this item at: http://gna.org/patch/?1942 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1942] refactor first portion of ai_airlift into find_neediest_airlift_city
Follow-up Comment #3, patch #1942 (project freeciv): Other things (not so important): * line 127 contains only spaces (necessary) ; * new header comment length usually is 77 characters (to fill the line). ___ Reply to this item at: http://gna.org/patch/?1942 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1942] refactor first portion of ai_airlift into find_neediest_airlift_city
Follow-up Comment #4, patch #1942 (project freeciv): Alright, new patch attached fixing comment header length to 77 chars. I copied from the header for ai_airlift which is 75. I left the empty line on line 127 as it separates the variable initialization for that block from the use of it. This fits with how ai_airlift has it laid out. If this is enough of a problem to block applying the patch I can submit a 4th revision. (file #10294) ___ Additional Item Attachment: File name: 0003-refactor-first-portion-of-ai_airlift-into-find_needi.patch Size:3 KB ___ Reply to this item at: http://gna.org/patch/?1942 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1942] refactor first portion of ai_airlift into find_neediest_airlift_city
Follow-up Comment #5, patch #1942 (project freeciv): Bah, the empty line had spaces in it, removed those 4 in this patch. I read that as empty line. ;) (file #10296) ___ Additional Item Attachment: File name: 0004-refactor-first-portion-of-ai_airlift-into-find_needi.patch Size:3 KB ___ Reply to this item at: http://gna.org/patch/?1942 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1942] refactor first portion of ai_airlift into find_neediest_airlift_city
Update of patch #1942 (project freeciv): Status:None = Ready For Test Assigned to:None = pepeto ___ Reply to this item at: http://gna.org/patch/?1942 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1942] refactor first portion of ai_airlift into find_neediest_airlift_city
Follow-up Comment #1, patch #1942 (project freeciv): The patch looks correct, except for coding style: static struct city* find_neediest_airlift_city(const struct player *pplayer) { * '*' should be preceded of a space and not followed. Not documented yet (I will add this) but respected as an implicit agreement. * '{' should appear into the new line. See http://freeciv.wikia.com/wiki/Coding_Style#Bracing It should looks to: static struct city *find_neediest_airlift_city(const struct player *pplayer) { ___ Reply to this item at: http://gna.org/patch/?1942 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1942] refactor first portion of ai_airlift into find_neediest_airlift_city
Follow-up Comment #2, patch #1942 (project freeciv): Thanks for the input, consistant style is important. Both are easy enough to fix. - I changed my emacs code template for C functions to have a new line before that '{' brace. No clue why I missed that detail, the rest of the functions follow it! Regardless I can go back to not thinking about that particular detail ;). - I'll have to work on remembering to associate the '*' with the variable and not with the type. This is mostly a C++ habit I'll have to remember to drop for this ;). I'll do my best, if I slip again please prod me ^-^. Current patch is: 0002-refactor-first-portion-of-ai_airlift-into-find_needi.patch I plan to submit more patches like this one as I get to know the ai code. As I read and document what is already here I'm gathering some questions about the current behavior of the AI as well as some ideas to make it smarter. I will do this as time permits, I just got a brand new cochlear implant turned on today, and I must spend time learning how to hear with it ;). (file #10273) ___ Additional Item Attachment: File name: 0002-refactor-first-portion-of-ai_airlift-into-find_needi.patch Size:3 KB ___ Reply to this item at: http://gna.org/patch/?1942 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1942] refactor first portion of ai_airlift into find_neediest_airlift_city
URL: http://gna.org/patch/?1942 Summary: refactor first portion of ai_airlift into find_neediest_airlift_city Project: Freeciv Submitted by: nixeagle Submitted on: Thursday 09/09/2010 at 03:58 Category: ai Priority: 1 - Later Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: ___ Details: New function combines original two loops into one loop and returns the city with the greatest need of an airlift. Resulting code does the same exact thing as before, but reading and understanding what the code does is much easier for this one portion of the function. -- Above is the commit summery I made to my local git repository. A little more detail, this is my first ever patch to this project. I'm interested in hacking on and improving the game ai portions. To start I thought I'd start reading through the code and fixing up what I can while I work on groking the code base. Please note that this patch is not strongly tested. I've checked that it does not obviously break the ai, but I'm not setup yet for proper regression tests. I will be by this weekend. I've tried my best to adhere to the coding standards. However I don't yet have a project specific emacs configuration, so please poke me if something is not quite right. Finally while I know the coding style wants no variable initializations at the same time as the declarations... I'm really not sure how that is to be done in find_neediest_airlift_city, and I see some other areas disregard this particular rule. I'm all ears though :). ___ File Attachments: --- Date: Thursday 09/09/2010 at 03:58 Name: 0001-refactor-first-portion-of-ai_airlift-into-find_needi.patch Size: 3kB By: nixeagle simple refactor. http://gna.org/patch/download.php?file_id=10260 ___ Reply to this item at: http://gna.org/patch/?1942 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev