Exemple #1
0
 public AnimationRule(String object_id, AnimationFramingType animation_type, Location target, bool moveRelative, int frame, Location startPos = null, int startFrame = 0, int tweenCurve = 0)
 {
     this.object_id    = object_id;
     this.anim_type    = animation_type;
     this.target       = target;
     this.moveRelative = moveRelative;
     this.frame        = frame;
     this.startPos     = startPos;
     this.start        = startFrame;
     this.curve        = tweenCurve;
 }
Exemple #2
0
        public virtual AnimationRule loadInDataRule(String d)
        {
            String[]             splitData = d.Split(' ');
            String               object_id = splitData[0];
            AnimationFramingType type      = AnimationFramingType.getAnimationTypeByID(splitData[1]);

            bool   relative     = false;
            String locationData = splitData[2];

            relative = locationData.StartsWith("r");
            if (relative)
            {
                locationData = locationData.Replace("r", "");
            }
            Location target = Location.ValueOf(locationData);

            int      frame            = 0;
            Location startingLocation = null;
            int      start            = 0;
            int      curve            = 0;

            if (splitData.Length > 3)
            {
                frame = Convert.ToInt32(splitData[3]);
            }
            if (splitData.Length > 4)
            {
                startingLocation = Location.ValueOf(splitData[4]);
            }
            if (splitData.Length > 5)
            {
                start = Convert.ToInt32(splitData[5]);
            }
            if (splitData.Length > 6)
            {
                curve = Convert.ToInt32(splitData[6]);
            }

            AnimationRule rule = new AnimationRule(object_id, type, target, relative, frame, startingLocation, start, curve);

            if (this.getObject(object_id) != null)
            {
                rule.originalLocation = this.getObject(object_id).getLocation().clone();
            }

            return(rule);
        }