コード例 #1
0
ファイル: Battle.cs プロジェクト: niuniuzhu/KOW
        private void DecodeSnapshot(Google.Protobuf.ByteString data)
        {
            Google.Protobuf.CodedInputStream reader = new Google.Protobuf.CodedInputStream(data.ToByteArray());
            reader.ReadInt32();             //frame
            reader.ReadBool();              //marktoend
            reader.ReadDouble();            //seed

            int count = reader.ReadInt32(); //champions

            for (int i = 0; i < count; i++)
            {
                int  id   = reader.ReadInt32();
                Team team = this.GetTeam(i);
                team.DecodeSnapshot(id, reader);
            }

            count = reader.ReadInt32();            //champions
            for (int i = 0; i < count; i++)
            {
                ulong    rid      = reader.ReadUInt64();
                Champion champion = this.GetChampion(rid);
                champion.DecodeSnapshot(rid, false, reader);
            }
        }