예제 #1
0
        //////////////////////////////////////////////////////////////////////////////

        #region Commands

        private DemoCmd Read(BitReadBuffer buffer)
        {
            DemoCmdType cmdType = (DemoCmdType)buffer.ReadUInt32(BitsPerCmdType);
            DemoCmd     cmd     = FindCmd(cmdType);

            if (cmd == null)
            {
                throw new Exception("Unexpected command: " + cmdType);
            }
            cmd.Read(buffer);
            return(cmd);
        }
예제 #2
0
        private bool ReadTick()
        {
            while (m_buffer.BitsAvailable > 0)
            {
                DemoCmd cmd        = Read(m_buffer);
                bool    shouldStop = cmd.Execute();
                if (shouldStop)
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #3
0
        //////////////////////////////////////////////////////////////////////////////

        #region Commands

        private void Write(DemoCmd cmd)
        {
            m_buffer.Write((uint)cmd.cmdType, BitsPerCmdType);
            cmd.Write(m_buffer);
        }