コード例 #1
0
        /// <summary>
        /// </summary>
        /// <param name="character">
        /// </param>
        /// <param name="messageDataFiller">
        /// </param>
        /// <returns>
        /// </returns>
        /// <exception cref="NotImplementedException">
        /// </exception>
        protected override T Create(ICharacter character, MessageDataFiller messageDataFiller)
        {
            T temp = new T();

            messageDataFiller(temp);
            return(temp);
        }
コード例 #2
0
 /// <summary>
 /// </summary>
 /// <param name="character">
 /// </param>
 /// <param name="messageDataFiller">
 /// </param>
 /// <param name="announceToPlayfield">
 /// </param>
 /// <exception cref="NotImplementedException">
 /// </exception>
 protected override void Send(
     ICharacter character,
     MessageDataFiller messageDataFiller,
     bool announceToPlayfield = false)
 {
     if ((this.Direction == MessageHandlerDirection.All) ||
         (this.Direction == MessageHandlerDirection.OutboundOnly))
     {
         T mb = this.Create(character, messageDataFiller);
         character.Send(mb, announceToPlayfield);
     }
     else
     {
         throw new NotImplementedException("This message handler cannot send outboud messages");
     }
 }
コード例 #3
0
 /// <summary>
 /// </summary>
 /// <param name="character">
 /// </param>
 /// <param name="messageDataFiller">
 /// </param>
 /// <param name="announceToPlayfield">
 /// </param>
 /// <exception cref="NotImplementedException">
 /// </exception>
 protected void SendToPlayfield(ICharacter character, MessageDataFiller messageDataFiller)
 {
     this.Send(character, messageDataFiller, true);
 }
コード例 #4
0
 /// <summary>
 /// </summary>
 /// <param name="character">
 /// </param>
 /// <param name="messageDataFiller">
 /// </param>
 /// <param name="announceToPlayfield">
 /// </param>
 protected abstract void Send(
     ICharacter character,
     MessageDataFiller messageDataFiller,
     bool announceToPlayfield = false);
コード例 #5
0
 /// <summary>
 /// </summary>
 /// <param name="character">
 /// </param>
 /// <param name="messageDataFiller">
 /// </param>
 /// <returns>
 /// </returns>
 protected abstract T Create(ICharacter character, MessageDataFiller messageDataFiller);