Пример #1
0
        public AvatarController(IAvatar avatar)
        {
            m_avatar = avatar;
            m_avatarControls = new AvatarControls(int.MaxValue);

            avatar.NewMessage += avatar_NewMessage;
        }
 public void CanSetPropertiesFrwd()
 {
     IAvatarControls avatarControls = new AvatarControls(0, 0.5f, 0.0f, -0.4f, true, true, true);
     m_avatarController.SetActions(avatarControls);
     Assert.Equal(m_avatar.DesiredSpeed, 0.5f);
     Assert.Equal(m_avatar.DesiredLeftRotation, -0.4f);
     Assert.True(m_avatar.Interact);
     Assert.True(m_avatar.PickUp);
     Assert.True(m_avatar.UseTool);
 }
 public void CanSetProperties45()
 {
     IAvatarControls avatarControls = new AvatarControls(0, 1f, 1f, -0.4f, true, true, true);
     m_avatarController.SetActions(avatarControls);
     Assert.Equal(m_avatar.DesiredSpeed, 1f);
     Assert.Equal(m_avatar.Direction, -MathHelper.Pi / 4, 2);
     Assert.Equal(m_avatar.DesiredLeftRotation, -0.4f);
     Assert.True(m_avatar.Interact);
     Assert.True(m_avatar.PickUp);
     Assert.True(m_avatar.UseTool);
 }
Пример #4
0
 public void ResetControls()
 {
     m_avatarControls = new AvatarControls(int.MaxValue);
     m_avatar.ResetControls();
 }