public Animation(IRemoveable root, IWithPosition parent, Sprite sprite, params int[] frames) { Root = root; Parent = parent; TimePerFrame = new ConfigValue <TimeSpan>("animation frame"); Sprite = sprite; Frames = frames; CurrentFrameIndex = new CyclingInteger(frames.Length); DrawInfo = sprite.DrawInfo; }
public static Condition SetActiveTime(this ICondition condition, ConfigValue <TimeSpan> time, IWorldObject owner) { return(new Sustain(new Timer(time, owner), condition)); }
public static T ReadValue <T>(string key) { var cv = new ConfigValue <T>(key); return(cv.Value); }
public MotionMultiplier(ICondition condition, string name) { Condition = condition; DeltaMod = new ConfigValue <float>(name + " delta mod"); TargetMod = new ConfigValue <float>(name + " target mod"); }
public Condition OnceEvery(TimeSpan span) { TimePerState = new ConstValue <TimeSpan>(span); return(new OnceEvery(this)); }
public Timer(ConfigValue <TimeSpan> timePerState, IWorldObject owner) : this(owner) { TimePerState = timePerState; msRemaining = TimePerState.Value.TotalMilliseconds; }