Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wyrm-engine

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wyrm-engine - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

dist/esm5/interfaces/IEncounterState.js

16

dist/esm5/Encounter.js

@@ -77,2 +77,18 @@ "use strict";

};
Encounter.prototype.getState = function () {
var teamA = this.encounterConfig.teamA
.map(function (character) { return lodash_1.omit(character, 'controllerCallback'); })
.map(lodash_1.cloneDeep);
var teamB = this.encounterConfig.teamB
.map(function (character) { return lodash_1.omit(character, 'controllerCallback'); })
.map(lodash_1.cloneDeep);
return {
id: this.encounterConfig.id,
teamA: teamA,
teamB: teamB,
};
};
Encounter.prototype.loadState = function (state) {
this.encounterConfig = lodash_1.cloneDeep(state);
};
Encounter.prototype.getRoundOrder = function () {

@@ -79,0 +95,0 @@ var allCharacters = __spreadArrays(this.encounterConfig.teamA.filter(function (char) { return char.currentHp > 0; }), this.encounterConfig.teamB.filter(function (char) { return char.currentHp > 0; }));

3

dist/types/Encounter.d.ts
import { IAction } from './interfaces/IAction';
import { IEncounterConfig } from './interfaces/IEncounterConfig';
import { IEcounterLog } from './interfaces/IEncounterLog';
import { IEncounterState } from './interfaces/IEncounterState';
export declare class Encounter {

@@ -14,2 +15,4 @@ private encounterConfig;

getEncounterLogs(): IEcounterLog;
getState(): IEncounterState;
loadState(state: IEncounterConfig): void;
private getRoundOrder;

@@ -16,0 +19,0 @@ private pickCharacterBasingOnInitiative;

@@ -6,2 +6,3 @@ export * from './IAction';

export * from './IEncounterLog';
export * from './IEncounterState';
export * from './IEngineCharacter';

@@ -8,0 +9,0 @@ export * from './IEngineConfig';

import { IAction } from './interfaces/IAction';
import { IEncounterConfig } from './interfaces/IEncounterConfig';
import { IEcounterLog } from './interfaces/IEncounterLog';
import { IEncounterState } from './interfaces/IEncounterState';
export declare class Encounter {

@@ -14,2 +15,4 @@ private encounterConfig;

getEncounterLogs(): IEcounterLog;
getState(): IEncounterState;
loadState(state: IEncounterConfig): void;
private getRoundOrder;

@@ -16,0 +19,0 @@ private pickCharacterBasingOnInitiative;

@@ -6,2 +6,3 @@ export * from './IAction';

export * from './IEncounterLog';
export * from './IEncounterState';
export * from './IEngineCharacter';

@@ -8,0 +9,0 @@ export * from './IEngineConfig';

2

package.json

@@ -5,3 +5,3 @@ {

"email": "momatoku@gmail.com",
"version": "1.1.0",
"version": "1.2.0",
"description": "Fully typed game engine library designed to simulate battles between virtual characters",

@@ -8,0 +8,0 @@ "main": "./bundles/index.umd.js",

@@ -471,2 +471,15 @@ # wyrm-engine

#### Encounter state
It is possible to obtain/load the encounter's state via `getState` and `loadState` functions.
Please note that state does not include callbacks defined during creation of encounter.
Those can be re-added during load:
```typescript
const state = encounter.getState();
encounter.loadState({
...state,
logMessageCallback: console.log
})
```
## Customising engine

@@ -473,0 +486,0 @@ Work in progress :)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc