Ejemplo n.º 1
0
 MessagePacket::MessagePacket(const dtGame::Message& message)
    : GNE::Packet(MessagePacket::ID)
    , mDestination("")
    , mSource(message.GetSource().GetUniqueId())
    , mSendingActor(message.GetSendingActorId())
    , mAboutActor(message.GetAboutActorId())
 {
    BuildFromMessage(message);
 }
Ejemplo n.º 2
0
   void MessagePacket::BuildFromMessage(const dtGame::Message& message)
   {
      // Get the Id from the message
      mMessageId = message.GetMessageType().GetId();

      // If the message has a destination, encapsulate
      if (message.GetDestination() != NULL)
      {
         mDestination = message.GetDestination()->GetUniqueId();
      }

      // encapsulate source
      mSource = message.GetSource().GetUniqueId();

      // encapsulate actor Id's
      mSendingActor = message.GetSendingActorId();
      mAboutActor = message.GetAboutActorId();

      // Get the MessageParameters from the message
      message.ToString(mMessageParameters);
   }
Ejemplo n.º 3
0
void FireActor::PlayFireSound(const dtGame::Message& msg)
{
   // Check to see if the actor is the door to the fire room
   dtGame::GameActorProxy* proxy = GetGameActorProxy().GetGameManager()->FindGameActorById(msg.GetAboutActorId());
   if (proxy == NULL)
   {
      return;
   }

   HatchActor* ha = dynamic_cast<HatchActor*>(proxy->GetActor());
   if (ha == NULL)
   {
      return;
   }

   // Hatch item was activated/deactivated, play/stop the sound
   ha->IsActivated() ? mItemUseSnd->Play() : mItemUseSnd->Stop();
}