Example #1
0
        public static Sword FromString(string inputStr, string TagID)
        {
            string[] forms = inputStr
                             .Split('|')
                             .ToArray();
            Sword resultSword = new Sword(TagID);

            try
            {
                if (forms.Length > 1)
                {
                    foreach (var formstring in forms.Take(forms.Length - 1))
                    {
                        if (formstring.Length == 0 || formstring == null)
                        {
                            continue;
                        }
                        resultSword.LearnForm(Form.FromString(formstring));
                    }
                }
                var details = forms.Last().Split('#');
                resultSword.EnGardeOrientation = AdvancedRollingAverage <Quaternion> .Create <Quaternion>(10, new Quaternion().FromString(details[0]), float.Parse(details[1]));
            }
            catch (Exception)
            {
                Log.Error("Sword Specifics", $"Error loading sword from string.  String was: {inputStr}, Tag ID was {TagID}.");
                throw;
            }
            return(resultSword);
        }
 protected override async Task startActionAsync()
 {
     AverageAttitude = AdvancedRollingAverage <Quaternion> .Create <Quaternion>(10, await FrameShiftFunctions.OrientationWhenReady(AttitudeProvider));
 }
Example #3
0
 protected static void _defaultUpdate(T newValue, AdvancedRollingAverage <T> self)
 {
 }