Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
805f3e8f
Commit
805f3e8f
authored
Mar 03, 2012
by
NicolasPerrenoud
Committed by
Max-Wilhelm Bruker
Jun 02, 2012
Browse files
merged from NicolasPerrenoud
parent
71579632
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/handzone.cpp
View file @
805f3e8f
...
...
@@ -39,19 +39,31 @@ void HandZone::addCardImpl(CardItem *card, int x, int /*y*/)
card
->
update
();
}
void
HandZone
::
handleDropEvent
(
const
QList
<
CardDragItem
*>
&
dragItems
,
CardZone
*
startZone
,
const
QPoint
&
/*
dropPoint
*/
)
void
HandZone
::
handleDropEvent
(
const
QList
<
CardDragItem
*>
&
dragItems
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
)
{
QPoint
point
=
dropPoint
+
scenePos
().
toPoint
();
int
x
=
-
1
;
if
(
settingsCache
->
getHorizontalHand
())
{
for
(
x
=
0
;
x
<
cards
.
size
();
x
++
)
if
(
point
.
x
()
<
((
CardItem
*
)
cards
.
at
(
x
))
->
scenePos
().
x
())
break
;
}
else
{
for
(
x
=
0
;
x
<
cards
.
size
();
x
++
)
if
(
point
.
y
()
<
((
CardItem
*
)
cards
.
at
(
x
))
->
scenePos
().
y
())
break
;
}
Command_MoveCard
cmd
;
cmd
.
set_start_player_id
(
startZone
->
getPlayer
()
->
getId
());
cmd
.
set_start_zone
(
startZone
->
getName
().
toStdString
());
cmd
.
set_target_player_id
(
player
->
getId
());
cmd
.
set_target_zone
(
getName
().
toStdString
());
cmd
.
set_x
(
cards
.
size
()
);
cmd
.
set_x
(
x
);
cmd
.
set_y
(
-
1
);
for
(
int
i
=
0
;
i
<
dragItems
.
size
();
++
i
)
cmd
.
mutable_cards_to_move
()
->
add_card
()
->
set_card_id
(
dragItems
[
i
]
->
getId
());
player
->
sendGameCommand
(
cmd
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment