-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
50 lines (42 loc) · 1.26 KB
/
Player.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// Player.h
// liar
//
// Created by Scott Nielsen on 1/18/11.
// Copyright 2011 Scott Nielsen. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "GCDAsyncSocket.h"
#import "Game.h"
@interface Player : NSObject <GCDAsyncSocketDelegate> {
GCDAsyncSocket *socket;
long _tag;
NSString *name;
Game *game;
BOOL ready;
BOOL connected;
int dice_count;
NSArray *dice;
}
@property (assign) long tag;
@property (retain) NSString *name;
@property (retain) Game *game;
@property (assign) BOOL ready;
@property (assign) BOOL connected;
@property (retain) NSArray *dice;
- (id)initWithSocket:(GCDAsyncSocket *)sock tag:(long)tag;
- (void)write:(NSString *)msg;
- (void)sendChat:(NSString *)message fromPlayer:(Player *)player;
- (void)sendNameWithConnection:(int)conn player:(Player *)player;
- (void)sendStartMessage;
- (void)sendBidCount:(int)count value:(int)value fromPlayer:(Player *)player;
- (void)sendChallengeFromPlayer:(Player *)player;
- (void)sendLoseDice:(int)count fromPlayer:(Player *)player;
- (void)sendLoseDiceAllExceptPlayer:(Player *)player;
- (void)sendResultForPlayer:(Player *)player;
- (void)sendWinner:(Player *)player;
- (void)resetDice;
- (void)loseDice:(int)lost;
- (void)roll;
- (void)yourTurn;
@end