public void UpdateInfo(BallInfo?info) { if (info == null) { return; } Info = info.Value; var physics = Info.Physics; if (physics != null) { var location = physics.Value.Location; Location = location != null?VectorMapper.Map(location.Value) : null; var velocity = physics.Value.Velocity; Velocity = velocity != null?VectorMapper.Map(velocity.Value) : null; } LatestTouch = Info.LatestTouch; }
public void UpdateInfo(PlayerInfo?info) { if (info == null) { return; } Info = info.Value; var physics = Info.Physics; if (physics != null) { var location = physics.Value.Location; Location = location != null?VectorMapper.Map(location.Value) : null; var velocity = physics.Value.Velocity; Velocity = velocity != null?VectorMapper.Map(velocity.Value) : null; var rotation = physics.Value.Rotation; if (rotation != null) { Rotation = rotation.Value; } } Boost = Info.Boost; Jumped = Info.Jumped; DoubleJumped = Info.DoubleJumped; HasWheelContact = Info.HasWheelContact; IsSuperSonic = Info.IsSupersonic; IsBot = Info.IsBot; IsDemolished = Info.IsDemolished; Name = Info.Name; Team = Info.Team; if (Info.ScoreInfo != null) { Score = Info.ScoreInfo.Value; } }