# ManualMotionDispatcher

Drive tweens manually, with storage organized by motion type. Pass its Scheduler to the builder and advance it in seconds with Update.

Namespace: MeatMotion

Assembly: MeatMotion

```csharp
public sealed class ManualMotionDispatcher
```

[Runtime/Scheduling/ManualMotionDispatcher.cs · L9](../../../source/Runtime/Scheduling/ManualMotionDispatcher.cs.html#L9)

## Set the clock in a test

Add `using MeatMotion;`. Time is absolute, while Update takes a delta in seconds. The two writes produce 3 then 4.

```csharp
float value = 0f;
var clock = new ManualMotionDispatcher();
MMotion.Create(0f, 10f, 1f).WithScheduler(clock.Scheduler)
    .Bind(v => value = v);
clock.Time = 0.3;
clock.Update(0.1);
clock.Reset();
```

## Default

Return the shared manual dispatcher.

```csharp
public static readonly ManualMotionDispatcher Default;
```

[Runtime/Scheduling/ManualMotionDispatcher.cs · L24](../../../source/Runtime/Scheduling/ManualMotionDispatcher.cs.html#L24)

## Scheduler

Scheduler for binding motions to this dispatcher's manual clock.

```csharp
public IMotionScheduler Scheduler { get; }
```

[Runtime/Scheduling/ManualMotionDispatcher.cs · L25](../../../source/Runtime/Scheduling/ManualMotionDispatcher.cs.html#L25)

## ManualMotionDispatcher

Create a dispatcher with its own clock and Scheduler.

```csharp
public ManualMotionDispatcher()
```

[Runtime/Scheduling/ManualMotionDispatcher.cs · L32](../../../source/Runtime/Scheduling/ManualMotionDispatcher.cs.html#L32)

## Time

Read the manual clock in seconds. Writing advances it by the difference from the current time.

```csharp
public double Time { get; set; }
```

[Runtime/Scheduling/ManualMotionDispatcher.cs · L33](../../../source/Runtime/Scheduling/ManualMotionDispatcher.cs.html#L33)

## Update

Advance the clock and bring each per-type world up to that time. A newly created world starts at zero and catches up on its first update. Recursive updates and non-finite times are rejected.

```csharp
public void Update(double deltaTime)
```

Parameters

- `deltaTime` (`double`) Seconds to advance from the preceding update.

[Runtime/Scheduling/ManualMotionDispatcher.cs · L48](../../../source/Runtime/Scheduling/ManualMotionDispatcher.cs.html#L48)

## Reset

Reset the manual clock to zero and clear its storage without invoking callbacks.

```csharp
public void Reset()
```

[Runtime/Scheduling/ManualMotionDispatcher.cs · L69](../../../source/Runtime/Scheduling/ManualMotionDispatcher.cs.html#L69)

## EnsureStorageCapacity

Reserve the manual storage for this value, options and adapter combination.

```csharp
public void EnsureStorageCapacity<TValue, TOptions, TAdapter>(int capacity)
    where TValue : unmanaged
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<TValue, TOptions>
```

Parameters

- `capacity` (`int`) Number of entries to reserve.

[Runtime/Scheduling/ManualMotionDispatcher.cs · L79](../../../source/Runtime/Scheduling/ManualMotionDispatcher.cs.html#L79)
