-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathFloatChangeRepeatPart.hx
More file actions
27 lines (23 loc) · 987 Bytes
/
FloatChangeRepeatPart.hx
File metadata and controls
27 lines (23 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package tweenxcore.structure;
import haxe.ds.Option;
class FloatChangeRepeatPart extends FloatChangePart
{
public var isMinerChange(default, null):Bool;
public var repeatIndex(default, null):Int;
public var repeatLength(default, null):Int;
public inline function new (previousValue:Float, currentValue:Float, repeatIndex:Int, repeatLength:Int, isMinerChange:Bool)
{
super(previousValue, currentValue);
this.repeatIndex = repeatIndex;
this.repeatLength = repeatLength;
this.isMinerChange = isMinerChange;
}
public inline function isFirstEntrance():Bool {
return (repeatIndex == 0 && previous <= 0 && 0 < current) ||
(repeatIndex == repeatLength - 1 && current < 1.0 && 1.0 <= previous);
}
public inline function isLastExit():Bool {
return (repeatIndex == 0 && current <= 0.0 && 0.0 < previous) ||
(repeatIndex == repeatLength - 1 && previous < 1.0 && 1.0 <= current);
}
}