コード例 #1
0
ファイル: RLBotInterface.cs プロジェクト: haraldfw/RLBot
        /// <summary>
        /// Sends a quick chat flat message.
        /// </summary>
        /// <param name="playerIndex">The index of the bot's car.</param>
        /// <param name="teamOnly">Flag indicating whether the quick chat message is for the player's team only or not.</param>
        /// <param name="quickChat">The quick chat selection to send.</param>
        public static void SendQuickChatFlat(int playerIndex, bool teamOnly, QuickChatSelection quickChat)
        {
            FlatBufferBuilder builder = new FlatBufferBuilder(50);

            var offset = QuickChat.CreateQuickChat(
                builder,
                quickChat,
                playerIndex,
                teamOnly);

            builder.Finish(offset.Value);
            byte[] bufferBytes = builder.SizedByteArray();
            SendQuickChat(bufferBytes, bufferBytes.Length);
        }
コード例 #2
0
        /// <summary>
        /// Sends a quick chat flat message.
        /// </summary>
        /// <param name="playerIndex">The index of the bot's car.</param>
        /// <param name="teamOnly">Flag indicating whether the quick chat message is for the player's team only or not.</param>
        /// <param name="quickChat">The quick chat selection to send.</param>
        public static void SendQuickChatFlat(int playerIndex, bool teamOnly, QuickChatSelection quickChat)
        {
            FlatBufferBuilder builder = new FlatBufferBuilder(50);

            var offset = QuickChat.CreateQuickChat(
                builder,
                quickChat,
                playerIndex,
                teamOnly);

            builder.Finish(offset.Value);
            byte[] bufferBytes = builder.SizedByteArray();
            int    status      = SendQuickChat(bufferBytes, bufferBytes.Length);

            if (status > 0)
            {
                throw NewRLBotCoreException((RLBotCoreStatus)status);
            }
        }