Overview

= BattleshipAI =

BattleshipAI is a simple Cocoa program that pits two or more Battleship-playing Cocoa bundles 
for supremacy on the high seas.

The intent is for you to build your own Cocoa bundle that conforms to the 
BattleshipPluginProtocoland pit your bundle against someone else's. 

May the best plugin win!

Website:  http://bitbucket.org/philippec/battleshipai/

= BUILDING IT =

Once you have the code, open BattleshipAI.xcodeproj and hit "Build". It should build 
one or more sample plugins (.battleship), the Unit Test Bundle and the application. 
It should also run all Unit Tests and run the static analyzer on all files

System requirements:
    - Mac OS X 10.6+ (may build on 10.5)
    - Apple's Xcode tools, version 3.2+
		- Currently builds on Intel-only (because that's the only thing I test against)

= CONTRIBUTING =

Patches and pull requests are welcome!

To contribute changes to BattleshipAI, you can either create a patch on your local system 
or fork the project. 

Please note that BattleshipAI runs Unit Tests and the clang Static Analyzer on every build.
It also has a lot of warnings activated, and warnings as errors. Please do not submit a
patch if it does not build.
If you think that a certain warning should be activated, let me know and we will discuss it.
If you must change a unit test, be ready with a valid reason! It is possible to change a 
unit test (for instance, when behavior has changed and a certain test no longer makes sense),
but this is the exception rather than the rule.

== Patches ==

For a small change, you can simply clone my repository and make all the changes you want.
Once you have one (or more) change you want to send me, create patch files like this:
	hg diff -c <revision number> > description_of_patch.diff
and send me the file "description_of_patch.diff" along with a comment describing the patch.

You can send multiple patches, just make sure to tell me which order they should be applied in.

You can also send hg bundles, if you want. Explanations here:
	http://www.soton.ac.uk/~fangohr/computing/hg.html#use-mercurial-without-access-to-server-using-bundles

== Forks ==

For a more involved change, or if you want to be credited in the history, create a fork
of the project, clone it yourself and make your modifications. Then, push your modifications
back to your fork and send me a "pull request" (there is a button in Mercurial just for this
purpose).
I will get a notification and review your change. If it's all good, I will pull your fork in and
you will see it in the main history. Congratulations!

== Collaborators ==

If you would like commit access to the BattleshipAI repository, that can be arranged too.
But start with a patch or fork, please!

== Coding Standard ==

I like my code to have a certain look, so I would appreciate it if you could take the time to 
format your code to look like mine before submitting a patch. This includes:

* Indentation: use tabs for indentation, two spaces per tab
* Curly braces ('{' and '}') get their own line, and everything within braces is indented once:
	if (i > 0)
	{
		NSLog(@"I is positive");
	}
* Parentheses ('(') need a space before, but not after.
  Square brackets ('[') don't need a space:
	if (_grid[i] > 0) /* ... */
* Pointers: put the '*' next to the variable name, not to the type:
	NSObject *obj;
* Operators ('+', '<' , '&&', etc...) need a space before and after
* Objective-C member variables are prefixed by an underscore ('_')
* Macros, constants, inlines are ALL_CAPS_WITH_UNDERSCORES
* One blank line is enough between functions and functional groups
* Objective-C function declarations: put one space between name, 
  type and argument. If type is a pointer, no need for a space
  between type and asterisk:
	- (void) applicationWillTerminate: (NSNotification*) notification
* Header files: try to minimize the #include dependencies by using
  '@class' to forward-declare a class if you don't need anything else
  from that header.

= LICENSE =

BattleshipAI is licensed under the terms of the MIT license reproduced 
below. This means that BattleshipAI is free software and can be used for 
both academic and commercial purposes at absolutely no cost.
Just thank me in your credits. 

===============================================================================

Copyright (c) 2009 Philippe Casgrain (http://developer.casgrain.com/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

Except as contained in this notice, the name(s) of the above copyright holders 
shall not be used in advertising or otherwise to promote the sale, use or other 
dealings in this Software without prior written authorization.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

===============================================================================