Package com.prineside.tdi2.managers
Class MessageManager
java.lang.Object
com.prineside.tdi2.Manager.ManagerWithListeners<MessageManager.MessageManagerListener>
com.prineside.tdi2.managers.MessageManager
- All Implemented Interfaces:
 Disposable,Manager
public final class MessageManager
extends Manager.ManagerWithListeners<MessageManager.MessageManagerListener>
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic interfacestatic classNested classes/interfaces inherited from interface com.prineside.tdi2.Manager
Manager.ManagerAdapter, Manager.ManagerWithListeners<T> - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(MessageManager.Message message) Add a message and notify listeners.voiddeleteMessage(MessageManager.Message message) Delete the message and remember its id in the list of deleted messages.getMessage(String id) Get a message with the id specifiedintintbooleanbooleanbooleanisMessageRead(String id) booleanvoidmarkMessageRead(MessageManager.Message message) Mark a message as read.voidvoidvoidremoveMessage(MessageManager.Message message) Remove message and do not store its id in the list of deleted messages.voidvoidsetup()Вызывается, когда объекты всех менеджеров созданы и можно к ним обращатьсяMethods inherited from class com.prineside.tdi2.Manager.ManagerWithListeners
addListener, dispose, postRender, preRender, removeListener, test 
- 
Constructor Details
- 
MessageManager
public MessageManager() 
 - 
 - 
Method Details
- 
setup
public void setup()Description copied from interface:ManagerВызывается, когда объекты всех менеджеров созданы и можно к ним обращаться- Specified by:
 setupin interfaceManager- Overrides:
 setupin classManager.ManagerWithListeners<MessageManager.MessageManagerListener>
 - 
processLocalMessages
public void processLocalMessages() - 
getMessages
- Returns:
 - sorted (by date) list of messages that has not been deleted yet
 
 - 
isMessageRead
- Parameters:
 id- id of the message- Returns:
 - true if message has been read by the player
 
 - 
markMessageRead
Mark a message as read. Notifies the server and listeners.- Parameters:
 message- message to mark as read
 - 
isMessageEverDeleted
- Parameters:
 id- id of the message- Returns:
 - true if message has been manually deleted by the player. Can return false if message not exists and has not been deleted - to check if message exists, use getMessage() and check for null
 
 - 
isMessageItemsReceived
 - 
deleteMessage
Delete the message and remember its id in the list of deleted messages. Notifies the server. If message is notDeletable, does nothing and prints an error.- Parameters:
 message- message to delete
 - 
requestMessagesFromServer
public void requestMessagesFromServer() - 
removeMessage
Remove message and do not store its id in the list of deleted messages. Notifies listeners. Does not notify the server. - 
addMessage
Add a message and notify listeners. If message with the same id already exists, it will be replaced- Parameters:
 message- message to add
 - 
getMessage
Get a message with the id specified- Parameters:
 id- id of the message- Returns:
 - Message or null if message not exists
 
 - 
getUnreadMessageCount
public int getUnreadMessageCount() - 
getTotalMessageCount
public int getTotalMessageCount() - 
receiveMessageItems
 - 
isRequestingServer
public boolean isRequestingServer() 
 -