Skip to content

Commit

Permalink
docs: Partial API ref and doc updates for trackedevent
Browse files Browse the repository at this point in the history
  • Loading branch information
jcowman2 committed Jan 12, 2019
1 parent 6cc4ff6 commit c6dc1ba
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,26 @@ Parameter | Description

### `TrackedEvent`

**_Interface_**

An [`EventFunction`](#eventfunction) that is tracked by the game instance.

```ts
interface TrackedEvent<StateType = any> extends EventFunction<StateType> {
(game: GameInstance<StateType>): TrackedEvent<StateType> | EventFunction<StateType>
eventName: string
target: EventFunction<StateType>
then(...events: Array<TrackedEvent<StateType>>): EventQueue<StateType>
thenq(...events: Array<TrackedEvent<StateType>>): EventQueue<StateType>
}
```

#### Description

In order for Regal to behave properly, all modifications of game state should take place inside tracked events.

#### Description

### `enqueue`

### `noop`
Expand Down
4 changes: 2 additions & 2 deletions src/events/event-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export type EventFunction<StateType = any> = (
/**
* An `EventFunction` that is tracked by the game instance.
*
* In order for Regal to behave properly, all modifications made by the game
* developer to a `GameInstance` should be done through tracked events.
* In order for Regal to behave properly, all modifications of game state
* should take place inside tracked events.
*
* @template StateType The `GameInstance` state type. Optional, defaults to `any`.
* @param game The game instance to be modified.
Expand Down

0 comments on commit c6dc1ba

Please sign in to comment.