コード例 #1
0
        private void SetStateHeader(ByteArrayReader reader)
        {
            IsSensor        = reader.ReadBool();
            IsStatic        = reader.ReadBool();
            ColorMask       = reader.ReadColor();
            TimeAlive       = reader.ReadTimeSpan();
            Size            = reader.ReadVector();
            Position        = reader.ReadVector();
            LinearVelocity  = reader.ReadVector();
            Rotation        = reader.ReadFloat();
            AngularVelocity = reader.ReadFloat();
            Restitution     = reader.ReadFloat();
            Health          = reader.ReadFloat();

            SetTypeStateHeader(reader);
        }
コード例 #2
0
        private Team MakeFullStateTeam(ByteArrayReader reader)
        {
            short id          = reader.ReadShort();
            var   color       = reader.ReadColor();
            var   playerCount = reader.ReadUShort();
            var   teamName    = reader.ReadString();
            var   objective   = reader.ReadString();

            return(new Team()
            {
                TeamId = id,
                TeamColor = color,
                Players = new GamePlayer[playerCount],
                Objective = objective,
                TeamName = teamName
            });
        }