Beispiel #1
0
 /// <summary>
 /// Constructs a MapDirValueSrcWrapper instance.
 /// </summary>
 /// <param name="directionValueSrc">The wrapped direction value source.</param>
 public MapDirValueSrcWrapper(IValueRead <MapDirection> directionValueSrc)
 {
     if (directionValueSrc == null)
     {
         throw new ArgumentNullException("directionValueSrc");
     }
     this.wrappedDirectionValueSrc     = directionValueSrc;
     this.lastKnownWrappedMapDirection = MapDirection.Undefined;
     this.cachedMapDirection           = (MapDirection)RandomService.DefaultGenerator.Next(8);
 }
Beispiel #2
0
 /// <summary>
 /// Constructs an animation player that plays the given animation in the given direction.
 /// </summary>
 /// <param name="animation">The animation to be played.</param>
 /// <param name="dirValueSrc">The direction value source of the animation being played.</param>
 public AnimationPlayer(Animation animation, IValueRead <MapDirection> dirValueSrc)
 {
     if (animation == null)
     {
         throw new ArgumentNullException("animation");
     }
     this.directionValueSrc  = dirValueSrc;
     this.instructionPointer = 0;
     this.animation          = animation;
     this.registers          = new int[REGISTER_COUNT];
     this.currentFrame       = new int[0];
     this.Step();
 }
Beispiel #3
0
 /// <summary>
 /// Attaches the given value to be modified by this modifier.
 /// </summary>
 /// <param name="modifiedValue">The value to attach.</param>
 public void AttachModifiedValue(IValueRead <T> modifiedValue)
 {
     this.modifiedValue = modifiedValue;
 }