This project is due on 9/22 at midnight.
Submission Directory: project04 in your pair’s GitHub repository.
Your first task is to design and implement an Acquire board data representation. The design choices are up to you. For a minimal external API, see task 2. Satisfying task 2 may or may not suffice for all other clients of this library.
Your second task is to implement and deliver a test harness, dubbed board-tester that responds to requests in the form of XML elements with responses. It should come with a subfolder, board-tests, with up to 10 test cases specified as a pair of file: inN.xml and outN.xml for N = 0, ..., 9. Each test case that exposes a flaw in some other code base gets you a bonus point.
There are five kinds of requests. To the first kind of request, a board service replies with a response; to the last four requests, it replies with a Board, a common form of data. If a query makes no sense or results in an erroneous operation on the board, the service may also reply with an Error.
inspect = <query row=Row column=Column> Board </query> singleton = <singleton row=Row column=Column> Board </singleton> growing = <growing row=Row column=Column> Board </growing> founding = <founding row=Row column=Column label=Label> Board </founding> merging = <merging row=Row column=Column label=Label> Board </merging>
singleton = <singleton /> founding = <founding /> growing = <growing name=Label /> merging = <merging acquirer=Label acquired1=Label /> <merging acquirer=Label acquired1=Label acquired2=Label /> <merging acquirer=Label acquired1=Label acquired2=Label acquired3=Label /> impossible = <impossible msg=String /> error = <error msg=String />
Board = <board> Tile ... Hotel ... </board> Hotel = <hotel name=Label>Tile ...</hotel> Tile = <tile column=Column row=Row /> Label = "American" | ... | "Worldwide" Row = "A" | ... | "I" Column = "1" | ... | "12"
A <query row=Row column=Column>Board</query> request determines what kind of effect the placement of tile (Column,Row) would have.
A singleton, growing, founding, and merging request call for the placement of tile (Column,Row) and the indicated effect. The founding request includes the hotel that is to be founded; the merging request specifies which hotel acquires all others involved in the merger.
Your final task is to design a data representation for the complete game information of an Acquire game. Imagine a game administrator that initializes the state representation and uses it to keep track of the state of a game as it is played.
Equip this data representation with an external interface that supports the complete execution of a game. Think of the game as a "state machine" and of game turns as "state transitions." In addition to a game administrator, also consider how an "artificial intelligence" may use this representation of games.