EaseEmotionManager.m 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /************************************************************
  2. * * Hyphenate CONFIDENTIAL
  3. * __________________
  4. * Copyright (C) 2016 Hyphenate Inc. All rights reserved.
  5. *
  6. * NOTICE: All information contained herein is, and remains
  7. * the property of Hyphenate Inc.
  8. * Dissemination of this information or reproduction of this material
  9. * is strictly forbidden unless prior written permission is obtained
  10. * from Hyphenate Inc.
  11. */
  12. #import "EaseEmotionManager.h"
  13. @implementation EaseEmotionManager
  14. - (id)initWithType:(EMEmotionType)Type
  15. emotionRow:(NSInteger)emotionRow
  16. emotionCol:(NSInteger)emotionCol
  17. emotions:(NSArray*)emotions
  18. {
  19. self = [super init];
  20. if (self) {
  21. _emotionType = Type;
  22. _emotionRow = emotionRow;
  23. _emotionCol = emotionCol;
  24. NSMutableArray *tempEmotions = [NSMutableArray array];
  25. for (id name in emotions) {
  26. if ([name isKindOfClass:[NSString class]]) {
  27. EaseEmotion *emotion = [[EaseEmotion alloc] initWithName:@"" emotionId:name emotionThumbnail:name emotionOriginal:name emotionOriginalURL:@"" emotionType:EMEmotionDefault];
  28. [tempEmotions addObject:emotion];
  29. }
  30. }
  31. _emotions = tempEmotions;
  32. _tagImage = nil;
  33. }
  34. return self;
  35. }
  36. - (id)initWithType:(EMEmotionType)Type
  37. emotionRow:(NSInteger)emotionRow
  38. emotionCol:(NSInteger)emotionCol
  39. emotions:(NSArray*)emotions
  40. tagImage:(UIImage*)tagImage
  41. {
  42. self = [super init];
  43. if (self) {
  44. _emotionType = Type;
  45. _emotionRow = emotionRow;
  46. _emotionCol = emotionCol;
  47. _emotions = emotions;
  48. _tagImage = tagImage;
  49. }
  50. return self;
  51. }
  52. @end
  53. @implementation EaseEmotion
  54. - (id)initWithName:(NSString*)emotionTitle
  55. emotionId:(NSString*)emotionId
  56. emotionThumbnail:(NSString*)emotionThumbnail
  57. emotionOriginal:(NSString*)emotionOriginal
  58. emotionOriginalURL:(NSString*)emotionOriginalURL
  59. emotionType:(EMEmotionType)emotionType
  60. {
  61. self = [super init];
  62. if (self) {
  63. _emotionTitle = emotionTitle;
  64. _emotionId = emotionId;
  65. _emotionThumbnail = emotionThumbnail;
  66. _emotionOriginal = emotionOriginal;
  67. _emotionOriginalURL = emotionOriginalURL;
  68. _emotionType = emotionType;
  69. }
  70. return self;
  71. }
  72. @end