Added new convenience methods for Game implementations.
5 // Created by Jens Alfke on 7/3/08.
6 // Copyright 2008 Jens Alfke. All rights reserved.
9 #import <Foundation/Foundation.h>
13 /** A mostly-passive object used to represent a player. */
14 @interface Player : NSObject <NSCoding>
17 NSString *_name, *_uuid, *_address, *_addressType;
21 - (id) initWithGame: (Game*)game;
22 - (id) initWithName: (NSString*)name;
24 - (id) initWithCoder: (NSCoder*)decoder;
25 - (void) encodeWithCoder: (NSCoder*)coder;
27 @property (readonly) Game *game;
28 @property (copy) NSString *name, // Display name
29 *UUID, // Address Book UUID
30 *address, // Contact address
31 *addressType; // Contact address type (an AB property type)
32 @property (readonly) int index; // Player's index in the Game's -players array
33 @property (readwrite,getter=isLocal) BOOL local; // Is the player on this computer? (Defaults to YES)
34 @property (readonly, getter=isCurrent) BOOL current; // Is it this player's turn?
35 @property (readonly, getter=isFriendly) BOOL friendly; // Is this player the current player or an ally?
36 @property (readonly, getter=isUnfriendly) BOOL unfriendly; // Is this player an opponent of the current player?
37 @property (readonly) Player *nextPlayer, *previousPlayer; // The next/previous player in sequence
38 @property (readonly) CGImageRef icon;
43 @interface CALayer (Game)
45 /** Called on any CALayer in the game's layer tree, will return the current Game object. */
46 @property (readonly) Game *game;