SFS2X Objective-C API  1.7.13
iOS / macOS / tvOS
SFSUserManager.h
1 //
2 // SFSUserManager.h
3 // SFS2X
4 //
5 // Original development by Infosfer Game Technologies Ltd. | http://www.infosfer.com.
6 //
7 // Maintained and developed by A51 Integrated.
8 // Copyright 2012 A51 Integrated | http://a51integrated.com. All rights reserved.
9 //
10 
11 
12 #import <Foundation/Foundation.h>
13 #import "IUserManager.h"
14 
15 @class SmartFox2XClient;
16 @class Logger;
17 
18 /** Manages the local Users.
19 
20  The client side API only see the Users that are joined in the same Rooms of the current User.
21  */
22 @interface SFSUserManager : NSObject <IUserManager>{
23 @private
24  NSMutableDictionary *_usersByName;
25  NSMutableDictionary *_usersById;
26 @protected
27  Logger *_log;
28  __weak SmartFox2XClient* _smartFox;
29  NSObject* _globalLock;
30 }
31 /**
32  Get the total number of Users
33  */
34 @property (readonly) NSInteger userCount;
35 
36 -(id)initWithSfs:(SmartFox2XClient *)sfs;
37 -(void)_addUser:(id <User>)user;
38 
39 /**
40  Checks if a specific User name exists in the local User list
41  */
42 -(BOOL)containsUserName:(NSString *)userName;
43 
44 /**
45  Checks if a specific User id exists in the local User list
46  */
47 -(BOOL)containsUserId:(NSInteger)userId;
48 
49 /**
50  Checks if a specific User object exists in the local User list
51  */
52 -(BOOL)containsUser:(id <User>)user;
53 
54 /**
55  Get a User object from its name
56  */
57 -(id <User>)getUserByName:(NSString *)userName;
58 
59 /**
60  Get a User object from its id
61  */
62 -(id <User>)getUserById:(NSInteger)userId;
63 
64 /**
65  Get the full list of Users
66  */
67 -(NSArray *)getUserList;
68 
69 -(void)replaceAll:(NSArray*)userList;
70 
71 
72 @end
SFSUserManager
Definition: SFSUserManager.h:22
SmartFox2XClient
Definition: SmartFox2XClient.h:113