Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 public static Condition SetActiveTime(this ICondition condition, ConfigValue <TimeSpan> time, IWorldObject owner)
 {
     return(new Sustain(new Timer(time, owner), condition));
 }
Ejemplo n.º 3
0
        public static T ReadValue <T>(string key)
        {
            var cv = new ConfigValue <T>(key);

            return(cv.Value);
        }
Ejemplo n.º 4
0
 public MotionMultiplier(ICondition condition, string name)
 {
     Condition = condition;
     DeltaMod  = new ConfigValue <float>(name + " delta mod");
     TargetMod = new ConfigValue <float>(name + " target mod");
 }
Ejemplo n.º 5
0
 public Condition OnceEvery(TimeSpan span)
 {
     TimePerState = new ConstValue <TimeSpan>(span);
     return(new OnceEvery(this));
 }
Ejemplo n.º 6
0
 public Timer(ConfigValue <TimeSpan> timePerState, IWorldObject owner) : this(owner)
 {
     TimePerState = timePerState;
     msRemaining  = TimePerState.Value.TotalMilliseconds;
 }