File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ public override void Teardown()
3434
3535 public override void Update ( )
3636 {
37- _expressionMapper ? . UpdateVRCFTEyeData ( ) ;
3837 Thread . Sleep ( 10 ) ;
3938 }
4039 }
Original file line number Diff line number Diff line change 22
33namespace ETVRTrackingModule . ExpressionStrategies ;
44
5- public interface IExpressionMapper
5+ public interface ImappingStategy
66{
77 public static string GetParamToMap ( string oscAddress )
88 {
Original file line number Diff line number Diff line change 55
66namespace ETVRTrackingModule . ExpressionStrategies ;
77
8- public class V1Mapper : IExpressionMapper
8+ public class V1Mapper : ImappingStategy
99{
1010 private Dictionary < string , float > _parameterValues = new ( )
1111 {
@@ -25,7 +25,7 @@ public V1Mapper(ILogger logger)
2525
2626 public void handleOSCMessage ( OSCMessage message )
2727 {
28- var paramToMap = IExpressionMapper . GetParamToMap ( message . address ) ;
28+ var paramToMap = ImappingStategy . GetParamToMap ( message . address ) ;
2929 if ( _parameterValues . ContainsKey ( paramToMap ) )
3030 {
3131 _parameterValues [ paramToMap ] = message . value ;
Original file line number Diff line number Diff line change 33
44namespace ETVRTrackingModule . ExpressionStrategies ;
55
6- public class V2Mapper : IExpressionMapper
6+ public class V2Mapper : ImappingStategy
77{
88 private Dictionary < string , float > parameterValues = new ( )
99 {
@@ -25,7 +25,7 @@ public V2Mapper(ILogger logger)
2525 }
2626 public void handleOSCMessage ( OSCMessage message )
2727 {
28- string paramToMap = IExpressionMapper . GetParamToMap ( message . address ) ;
28+ string paramToMap = ImappingStategy . GetParamToMap ( message . address ) ;
2929 if ( parameterValues . ContainsKey ( paramToMap ) )
3030 {
3131 parameterValues [ paramToMap ] = message . value ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ namespace ETVRTrackingModule
66{
77 public class ExpressionsMapper
88 {
9- private IExpressionMapper _mappingStrategy ;
9+ private ImappingStategy _mappingStrategy ;
1010
1111 ILogger _logger ;
1212 public ExpressionsMapper ( ILogger logger )
@@ -20,14 +20,15 @@ public void MapMessage(OSCMessage msg)
2020 if ( ! msg . success )
2121 return ;
2222
23- var nextStrategy = IsV2Param ( msg ) ? ( IExpressionMapper ) new V2Mapper ( _logger ) : new V1Mapper ( _logger ) ;
23+ var nextStrategy = IsV2Param ( msg ) ? ( ImappingStategy ) new V2Mapper ( _logger ) : new V1Mapper ( _logger ) ;
2424
2525 if ( _mappingStrategy . GetType ( ) != nextStrategy . GetType ( ) )
2626 {
2727 _logger . LogInformation ( $ "Detected differing strategy, changing from { _mappingStrategy . GetType ( ) } to { nextStrategy . GetType ( ) } ") ;
2828 _mappingStrategy = nextStrategy ;
2929 }
3030 _mappingStrategy . handleOSCMessage ( msg ) ;
31+ _mappingStrategy . UpdateVRCFTEyeData ( ref UnifiedTracking . Data . Eye , ref UnifiedTracking . Data . Shapes ) ;
3132 }
3233
3334 private bool IsV2Param ( OSCMessage oscMessage )
@@ -36,10 +37,5 @@ private bool IsV2Param(OSCMessage oscMessage)
3637 _logger . LogInformation ( $ "is V2 param: { isv2Param . ToString ( ) } ") ;
3738 return isv2Param ;
3839 }
39-
40- public void UpdateVRCFTEyeData ( )
41- {
42- _mappingStrategy . UpdateVRCFTEyeData ( ref UnifiedTracking . Data . Eye , ref UnifiedTracking . Data . Shapes ) ;
43- }
4440 }
4541}
You can’t perform that action at this time.
0 commit comments