當前位置: 首頁>>代碼示例>>C#>>正文


C# BigEndianStream.Write方法代碼示例

本文整理匯總了C#中Pdelvo.Minecraft.Network.BigEndianStream.Write方法的典型用法代碼示例。如果您正苦於以下問題:C# BigEndianStream.Write方法的具體用法?C# BigEndianStream.Write怎麽用?C# BigEndianStream.Write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Pdelvo.Minecraft.Network.BigEndianStream的用法示例。


在下文中一共展示了BigEndianStream.Write方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnSend

 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     if (version >= 38)
     {
         writer.Write(Code);
         writer.Write((byte) EntityIds.Count ());
         foreach (int item in EntityIds)
         {
             writer.Write(item);
         }
     }
     else
     {
         if (EntityIds == null || EntityIds.Count () == 0)
         {
             writer.Write(Code);
             writer.Write(0);
         }
         else
             foreach (int item in EntityIds)
             {
                 writer.Write(Code);
                 writer.Write(item);
             }
     }
 }
開發者ID:pdelvo,項目名稱:Pdelvo.Minecraft,代碼行數:35,代碼來源:EntityDestroy.cs

示例2: OnSend

        /// <summary>
        ///   Sends the specified writer.
        /// </summary>
        /// <param name="writer"> The writer. </param>
        /// <param name="version"> The version. </param>
        /// <remarks>
        /// </remarks>
        protected override void OnSend(BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            writer.Write(TeamName);
            writer.Write(Mode);
            if (Mode == 2 || Mode == 0)
            {
                writer.Write(TeamDisplayName);
                writer.Write(TeamPrefix);
                writer.Write(TeamSufix);
                if (version >= 60)
                    writer.Write(FriendlyFire);
                else
                    writer.Write(FriendlyFire != 0);
            }

            Players = Players ?? new string[0];
            writer.Write(PlayerCount);
            if (Mode == 0 || Mode == 3 || Mode == 4)
            {
                foreach (var player in Players)
                {
                    writer.Write(player);
                }
            }
        }
開發者ID:pdelvo,項目名稱:Pdelvo.Minecraft,代碼行數:36,代碼來源:Teams.cs

示例3: OnSend

 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(ResponseType);
 }
開發者ID:splitice,項目名稱:Pdelvo.Minecraft,代碼行數:13,代碼來源:RespawnRequestPacket.cs

示例4: OnSend

 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(Number);
 }
開發者ID:pdelvo,項目名稱:Pdelvo.Minecraft,代碼行數:14,代碼來源:KeepAlive.cs

示例5: OnSend

        /// <summary>
        /// Sends the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="version">The version.</param>
        /// <remarks></remarks>
        protected override void OnSend(BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            if (version >= 32)
            {
                byte d = 0;

                d |= (byte)((Flying ? 1 : 0) << 0);
                d |= (byte)((InstantBuild ? 1 : 0) << 1);
                d |= (byte)((MayFly ? 1 : 0) << 2);
                d |= (byte)((Invulnerable ? 1 : 0) << 3);
                writer.Write(d);
                writer.Write(FlyingSpeed);
                writer.Write(WalkSpeed);
            }
            else
            {
                writer.Write(Flying);
                writer.Write(InstantBuild);
                writer.Write(MayFly);
                writer.Write(Invulnerable);
            }
        }
開發者ID:splitice,項目名稱:Pdelvo.Minecraft,代碼行數:32,代碼來源:AbilityPacket.cs

示例6: OnSend

 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(StatisticId);
     writer.Write(Amount);
 }
開發者ID:splitice,項目名稱:Pdelvo.Minecraft,代碼行數:14,代碼來源:IncrementStatistic.cs

示例7: OnSend

 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(EntityId);
     MetadataInfo.WriteMetadata(InnerData, writer);
 }
開發者ID:pdelvo,項目名稱:Pdelvo.Minecraft,代碼行數:15,代碼來源:EntityMetadata.cs

示例8: OnSend

 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(Health);
     writer.Write(Food);
     writer.Write(FoodSaturation);
 }
開發者ID:splitice,項目名稱:Pdelvo.Minecraft,代碼行數:15,代碼來源:UpdateHealth.cs

示例9: OnSend

 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(WindowId);
     writer.Write(Count);
     InventoryPacket.WritePayload(writer, Items);
 }
開發者ID:pdelvo,項目名稱:Pdelvo.Minecraft,代碼行數:16,代碼來源:WindowItems.cs

示例10: OnSend

 /// <summary>
 ///   Sends the specified writer.
 /// </summary>
 /// <param name="writer"> The writer. </param>
 /// <param name="version"> The version. </param>
 /// <remarks>
 /// </remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(UserEntity);
     writer.Write(TargetEntity);
     writer.Write(LeftClick);
 }
開發者ID:pdelvo,項目名稱:Pdelvo.Minecraft,代碼行數:16,代碼來源:UseEntity.cs

示例11: OnSend

 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(WindowId);
     writer.Write(ProgressBarType);
     writer.Write(Value);
 }
開發者ID:splitice,項目名稱:Pdelvo.Minecraft,代碼行數:15,代碼來源:UpdateProgressBar.cs

示例12: OnSend

        /// <summary>
        ///   Sends the specified writer.
        /// </summary>
        /// <param name="writer"> The writer. </param>
        /// <param name="version"> The version. </param>
        /// <remarks>
        /// </remarks>
        protected override void OnSend(BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            writer.Write(MessageColor);
            writer.WriteClassicString(TextMessage);
        }
開發者ID:pdelvo,項目名稱:Pdelvo.Minecraft,代碼行數:16,代碼來源:Message.cs

示例13: OnSend

 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(EntityId);
     writer.Write(Yaw);
     writer.Write(Pitch);
 }
開發者ID:splitice,項目名稱:Pdelvo.Minecraft,代碼行數:15,代碼來源:EntityLook.cs

示例14: OnSend

 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(WindowId);
     writer.Write(ActionNumber);
     writer.Write(Accepted);
 }
開發者ID:splitice,項目名稱:Pdelvo.Minecraft,代碼行數:15,代碼來源:Transaction.cs

示例15: OnSend

 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new System.ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(PlayerName);
     writer.Write(Online);
     writer.Write(Ping);
 }
開發者ID:splitice,項目名稱:Pdelvo.Minecraft,代碼行數:15,代碼來源:PlayerListItem.cs


注:本文中的Pdelvo.Minecraft.Network.BigEndianStream.Write方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。