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

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