[Kde-games-devel] Review Request 114871: [knavalbattle] To enable two phase place ships, to be able to restart placing them from scratch
Jaime Torres Amate
jtamate at gmail.com
Thu Jan 16 12:24:07 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114871/
-----------------------------------------------------------
(Updated Jan. 16, 2014, 12:24 p.m.)
Status
------
This change has been marked as submitted.
Review request for KDE Games and Roney Gomes.
Repository: knavalbattle
Description
-------
This patch depends on the utilities for multiple ships patch (only because of the canAddShipsOfShize(size) method).
There are now two phases in the game, also used in the seaview status, placing and playing. Placing can be restarted several times without disturbing the other player.
Before:
controller called entity start and waited for 2 answers.
Now:
controller calls entity startPlacing and waits for 2 ready() signals, then it calls start and waits for 2 more answers.
if a player can not finish placing its ships, a restartPlacingShips() signal is emited (and not the ready() signal). It reaches playfield where a messagebox is displayed to restart or abort the game (missing, I'm not sure about this option).
This patch only affects the human player (the AI, so fast, will retry automatically until a good placement is reached).
For the network player, it assumes the other player has finished placing its ships, but still needs another message (received when the other player finishes placing ships) to start shooting.
Another possibility is to make use of an Undo function (but I always played in paper with pen, not pencil)
Diffs
-----
src/aientity.h d8fc057
src/aientity.cpp b085786
src/controller.h 0165b02
src/controller.cpp df44ff4
src/entity.h fa45a35
src/mainwindow.cpp 42e04b4
src/networkentity.h bfcfdf4
src/networkentity.cpp 6609022
src/playerentity.h aae134e
src/playerentity.cpp 230f1ec
src/playfield.h 431b740
src/playfield.cpp 1ea0955
src/seaview.h b3099be
src/seaview.cpp 34d44c3
src/uientity.h 952003b
src/uientity.cpp e629879
Diff: https://git.reviewboard.kde.org/r/114871/diff/
Testing
-------
Finally, it works in local and remote games.
The normal game workflow can be tested without any modification.
The restart workflow can be tested with a little modification in the canAddShipsOfShize(size) to return false sometimes.
I'm reworking the multiple ships patch to make it much more flexible in the number of ships, their size and the board size for network games.
Thanks,
Jaime Torres Amate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20140116/8645c0ae/attachment-0001.html>
More information about the kde-games-devel
mailing list