Beispiel #1
0
        public bool TryGetMotion(Class castClass, out CastableMotion motion)
        {
            motion = null;

            if (Effects?.Animations?.OnCast?.Player == null)
            {
                return(false);
            }

            var m = Effects.Animations.OnCast.Player.Where(e => e.Class.Contains(castClass));

            if (m.Count() == 0)
            {
                m = Effects.Animations.OnCast.Player.Where(e => e.Class.Count == 0);
            }

            if (m.Count() == 0)
            {
                return(false);
            }
            else
            {
                motion = m.First();
            }

            return(true);
        }
Beispiel #2
0
 /// <summary>
 /// Deserializes xml markup from file into an CastableMotion object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output CastableMotion object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out CastableMotion obj, out Exception exception)
 {
     exception = null;
     obj       = default(CastableMotion);
     try
     {
         obj = LoadFromFile(fileName);
         return(true);
     }
     catch (Exception ex)
     {
         exception = ex;
         return(false);
     }
 }
Beispiel #3
0
 /// <summary>
 /// Deserializes workflow markup into an CastableMotion object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output CastableMotion object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string input, out CastableMotion obj, out Exception exception)
 {
     exception = null;
     obj       = default(CastableMotion);
     try
     {
         obj = Deserialize(input);
         return(true);
     }
     catch (Exception ex)
     {
         exception = ex;
         return(false);
     }
 }
Beispiel #4
0
        public static bool LoadFromFile(string fileName, out CastableMotion obj)
        {
            Exception exception = null;

            return(LoadFromFile(fileName, out obj, out exception));
        }
Beispiel #5
0
        public static bool Deserialize(string input, out CastableMotion obj)
        {
            Exception exception = null;

            return(Deserialize(input, out obj, out exception));
        }