forked from rnixik/durak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer_actions.go
31 lines (24 loc) · 934 Bytes
/
player_actions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
// PlayerActionNameAttack - Attack with card
const PlayerActionNameAttack = "attack"
// PlayerActionNameDefend - Defend with card
const PlayerActionNameDefend = "defend"
// PlayerActionNamePickUp - Pick up cards from desk
const PlayerActionNamePickUp = "pick_up"
// PlayerActionNameComplete - Complete round
const PlayerActionNameComplete = "complete"
// PlayerAction contains command message from a player to a game.
type PlayerAction struct {
Name string `json:"name"`
Data interface{} `json:"data"`
player *Player
}
// AttackActionData contains data of command message to attack with card from a player to a game.
type AttackActionData struct {
Card *Card `json:"card"`
}
// DefendActionData contains data of command message to defend a card with card from a player to a game.
type DefendActionData struct {
AttackingCard *Card `json:"attackingCard"`
DefendingCard *Card `json:"defendingCard"`
}