Skip to main content

ITpMessaging and ITpPersistence

ITpMessaging is used to implement targets for the Messaging Service.

It's pretty simple:

/// <summary>                                                                     
/// Interface for using TpLib SendMessage methods.                                
/// </summary>                                                                    
/// <typeparam name="T">Type for sending a message</typeparam>                    
public interface ITpMessaging <in T> where T:MessagePacket<T>                     
{                                                                                 
    /// <summary>                                                                 
    /// Send a message of type T                                                  
    /// </summary>                                                                
    /// <param name="sentPacket">The sent packet.</param>                         
    void MessageTarget(T sentPacket);                                             
                                                                                  
    /// <summary>                                                                 
    /// Optional "are you ready?" method that can be used in filtering            
    /// prior to sending a message. Useful in some edge cases. Override           
    /// in implementation if necc. NOTE this is NOT checked internally            
    /// somehow. You have to use a filter and test this.                          
    /// </summary>                                                                
    /// <returns>True if the tile is prepared to get the message.</returns>       
    bool CanAcceptMessage() { return true; }                                      
                                                                                  
}                                                                                 

Message Packets are discussed here.