Bug 308215 - do not hide the ships when they can not be placed under the current position
Summary: do not hide the ships when they can not be placed under the current position
Status: RESOLVED FIXED
Alias: None
Product: knavalbattle
Classification: Applications
Component: general (show other bugs)
Version: 2.0
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Roney Gomes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-11 07:41 UTC by Jaime Torres
Modified: 2014-01-27 00:58 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.13.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaime Torres 2012-10-11 07:41:17 UTC
currently, the ship to be placed are hidden when they can not be placed in the current position.
I think it will be better to show the ship, but with some kind of forbidden signal, or another color...
Also to have some text (or icons) in the status line showing the remaining ships to place.

Reproducible: Always
Comment 1 Roney Gomes 2014-01-14 01:45:28 UTC
Git commit a80288ebf8759e0a74b3dd7b5f3c50114b340a4b by Roney Gomes.
Committed on 14/01/2014 at 01:15.
Pushed by roneygomes into branch 'master'.

Do not hide ships when they cannot be placed.

Some methods in the Delegate classes were too much procedural to my
like. I don't see with good eyes a method that should return a bool
returning a pointer instead.

To get rid of this, Delegate::canAddShip() now returns bool and when we
need to get a pointer to the next ship to be placed, nextShip() -- which
became public -- does its job.

This is not everything, the coolest part of this commit is that now
sprites will turn red when a ship can't be placed and green when this is
not the case. Just like some RTS games do. :-)

Just between us, having no sprites at all wasn't very user friendly.
FIXED-IN: 4.13.1
GUI:
DIGEST:

M  +32   -20   src/battlefieldview.cpp
M  +5    -1    src/battlefieldview.h
M  +2    -1    src/delegate.h
M  +9    -9    src/playerentity.cpp
M  +2    -2    src/playerentity.h
M  +3    -8    src/seaview.cpp
M  +15   -0    src/sprite.cpp
M  +2    -0    src/sprite.h

http://commits.kde.org/knavalbattle/a80288ebf8759e0a74b3dd7b5f3c50114b340a4b