Ejemplo n.º 1
0
        public static QBlock Read(BinaryReader br)
        {
            QBlock block = new QBlock();

            int length = br.ReadInt32();

            block.AngleX = br.ReadSingle();
            block.AngleY = br.ReadSingle();
            block.AngleZ = br.ReadSingle();

            long end = br.BaseStream.Position + length;

            while (br.BaseStream.Position < end)
            {
                QMessage msg = QMessage.Read(br);
                block.Messages.Add(msg);
            }

            return(block);
        }
Ejemplo n.º 2
0
        public void Apply(QMessage msg)
        {
            switch (msg.ID)
            {
            case QMessageID.Centerprint:
                Centerprint(msg as QCenterprintMessage);
                break;

            case QMessageID.FoundSecret:
                Stats[StatIndex.FoundSecrets]++;
                break;

            case QMessageID.KilledMonster:
                Stats[StatIndex.KilledMonsters]++;
                break;

            case QMessageID.Print:
                Print(msg as QPrintMessage);
                break;

            case QMessageID.SpawnBaseline:
                SpawnBaseline(msg as QSpawnBaselineMessage);
                break;

            case QMessageID.TempEntity:
                TempEntity(msg as QTempEntityMessage);
                break;

            case QMessageID.UpdateEntity:
                UpdateEntity(msg as QUpdateEntityMessage);
                break;

            case QMessageID.UpdateStat:
                UpdateStat(msg as QUpdateStatMessage);
                break;
            }
        }