-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move all components to component prop inside the cache.engine * move things around
- Loading branch information
Showing
16 changed files
with
237 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { MapComponentDefinition, MapResult, ISchema } from '@dcl/sdk/ecs' | ||
|
||
/** | ||
* @public | ||
* SDK methods that the library receives on the initPlayersQueue | ||
*/ | ||
export let Player: MapComponentDefinition< | ||
MapResult<{ | ||
address: ISchema<string> | ||
joinedAt: ISchema<number> | ||
startPlayingAt: ISchema<number> | ||
active: ISchema<boolean> | ||
}> | ||
> | ||
/** | ||
* @internal | ||
*/ | ||
export function setPlayerComponent(playerComponent: typeof Player) { | ||
Player = playerComponent | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
import { IEngine } from '@dcl/sdk/ecs' | ||
import { IEngine, TransformType } from '@dcl/sdk/ecs' | ||
import type playersType from '@dcl/sdk/players' | ||
import type { syncEntity as SyncEntityType } from '@dcl/sdk/network' | ||
|
||
import * as queue from './queue' | ||
import * as gameConfig from './gameConfig' | ||
import { startPlayersQueue } from './queue' | ||
import * as gameConfig from './config' | ||
import { setSDK } from './sdk' | ||
import { initEnvironment } from './environment' | ||
import { addEnvironment } from './environment' | ||
|
||
export type IConfig = { | ||
export type IOptions = { | ||
gameId: string | ||
environment: string | ||
gameTimeoutMs?: number | ||
sceneRotation?: number | ||
queueDisplay?: TransformType | ||
} | ||
|
||
export let engine: IEngine | ||
export function initLibrary( | ||
engine: IEngine, | ||
syncEntity: typeof SyncEntityType, | ||
players: typeof playersType, | ||
config: IConfig | ||
options: IOptions | ||
) { | ||
setSDK({ engine, syncEntity, players, config }) | ||
initEnvironment() | ||
queue.initPlayersQueue() | ||
setSDK({ engine, syncEntity, players, config: options }) | ||
addEnvironment() | ||
startPlayersQueue() | ||
gameConfig.init() | ||
} | ||
export * from './sdk' | ||
export * as queueDisplay from './queueDisplay' | ||
|
||
export * as ui from './ui' | ||
export { queue } | ||
export { SCENE_PARENT } from './gameConfig' | ||
export * as queue from './queue' | ||
export { sceneParentEntity } from './config' | ||
export * as utilities from './utilities' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.