New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mapscreatr

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mapscreatr - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

lib/Actor.d.ts

8

lib/index.d.ts

@@ -0,6 +1,6 @@

export * from "./Actor";
export * from "./MapsCreatr";
export * from "./PreActor";
export * from "./PreActorLike";
export * from "./types";
export * from "./IPreThing";
export * from "./IThing";
export * from "./MapsCreatr";
export * from "./PreThing";
//# sourceMappingURL=index.d.ts.map

@@ -11,11 +11,11 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {

};
define(["require", "exports", "./types", "./IPreThing", "./IThing", "./MapsCreatr", "./PreThing"], function (require, exports, types_1, IPreThing_1, IThing_1, MapsCreatr_1, PreThing_1) {
define(["require", "exports", "./Actor", "./MapsCreatr", "./PreActor", "./PreActorLike", "./types"], function (require, exports, Actor_1, MapsCreatr_1, PreActor_1, PreActorLike_1, types_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(Actor_1, exports);
__exportStar(MapsCreatr_1, exports);
__exportStar(PreActor_1, exports);
__exportStar(PreActorLike_1, exports);
__exportStar(types_1, exports);
__exportStar(IPreThing_1, exports);
__exportStar(IThing_1, exports);
__exportStar(MapsCreatr_1, exports);
__exportStar(PreThing_1, exports);
});
//# sourceMappingURL=index.js.map

@@ -1,3 +0,3 @@

import { IObjectMakr } from "objectmakr";
import { IAnalysisContainer, IArea, IAreaRaw, IMacro, IMap, IMapRaw, IMapsCreatrSettings, IPreThingsContainers } from "./types";
import { ObjectMakr } from "objectmakr";
import { AnalysisContainer, Area, AreaRaw, Macro, Map, MapRaw, MapsCreatrSettings, PreActorsContainers } from "./types";
/**

@@ -8,3 +8,3 @@ * Storage container and lazy loader for EightBittr maps.

/**
* ObjectMakr factory used to create Maps, Areas, Locations, and Things.
* ObjectMakr factory used to create Maps, Areas, Locations, and Actors.
*/

@@ -21,7 +21,7 @@ private readonly objectMaker;

/**
* The possible group types processed PreThings may be placed in.
* The possible group types processed PreActors may be placed in.
*/
private readonly groupTypes;
/**
* Macro functions to create PreThings, keyed by String alias.
* Macro functions to create PreActors, keyed by String alias.
*/

@@ -42,7 +42,7 @@ private readonly macros;

*/
constructor(settings: IMapsCreatrSettings);
constructor(settings: MapsCreatrSettings);
/**
* @returns The internal ObjectMakr.
*/
getObjectMaker(): IObjectMakr;
getObjectMaker(): ObjectMakr;
/**

@@ -56,3 +56,3 @@ * @returns The allowed group types.

getMacros(): {
[i: string]: IMacro;
[i: string]: Macro;
};

@@ -67,3 +67,3 @@ /**

getMapsRaw(): {
[i: string]: IMapRaw;
[i: string]: MapRaw;
};

@@ -74,3 +74,3 @@ /**

getMaps(): {
[i: string]: IMap;
[i: string]: Map;
};

@@ -81,3 +81,3 @@ /**

*/
getMapRaw(name: string): IMapRaw;
getMapRaw(name: string): MapRaw;
/**

@@ -90,3 +90,3 @@ * Getter for a map under the maps container. If the map has not yet been

*/
getMap(name: string): IMap;
getMap(name: string): Map;
/**

@@ -100,3 +100,3 @@ * Creates and stores a set of new maps based on the key/value pairs in a

storeMaps(maps: {
[i: string]: IMapRaw;
[i: string]: MapRaw;
}): void;

@@ -112,45 +112,45 @@ /**

*/
storeMap(name: string, mapRaw: IMapRaw): IMap;
storeMap(name: string, mapRaw: MapRaw): Map;
/**
* Given a Area, this processes and returns the PreThings that are to
* Given a Area, this processes and returns the PreActors that are to
* inhabit the Area per its creation instructions.
*
* @returns A container with the parsed PreThings.
* @returns A container with the parsed PreActors.
*/
getPreThings(area: IArea): IPreThingsContainers;
getPreActors(area: Area): PreActorsContainers;
/**
* PreThing switcher: Given a JSON representation of a PreThing, this
* PreActor switcher: Given a JSON representation of a PreActor, this
* determines what to do with it. It may be a location setter (to switch the
* x- and y- location offset), a macro (to repeat some number of actions),
* or a raw PreThing.
* or a raw PreActor.
*
* @param reference A JSON mapping of some number of PreThings.
* @param preThings The PreThing containers within the Area.
* @param reference A JSON mapping of some number of PreActors.
* @param preActors The PreActor containers within the Area.
* @param area The Area to be populated.
* @param map The Map containing the Area.
* @returns The results of analyzePreMacro or analyzePreThing.
* @returns The results of analyzePreMacro or analyzePreActor.
*/
analyzePreSwitch(reference: any, prethings: IAnalysisContainer, area: IArea | IAreaRaw, map: IMap | IMapRaw): any;
analyzePreSwitch(reference: any, preactors: AnalysisContainer, area: Area | AreaRaw, map: Map | MapRaw): any;
/**
* PreThing case: Macro instruction. This calls the macro on the same input,
* PreActor case: Macro instruction. This calls the macro on the same input,
* captures the output, and recursively repeats the analyzePreSwitch driver
* function on the output(s).
*
* @param reference A JSON mapping of some number of PreThings.
* @param preThings The PreThing containers within the Area.
* @param reference A JSON mapping of some number of PreActors.
* @param preActors The PreActor containers within the Area.
* @param area The Area to be populated.
* @param map The Map containing the Area.
*/
analyzePreMacro(reference: any, prethings: IAnalysisContainer, area: IArea | IAreaRaw, map: IMap | IMapRaw): any[] | any;
analyzePreMacro(reference: any, preactors: AnalysisContainer, area: Area | AreaRaw, map: Map | MapRaw): any[] | any;
/**
* Macro case: PreThing instruction. This creates a PreThing from the
* given reference and adds it to its respective group in PreThings (based
* on the PreThing's [keyGroupType] variable).
* Macro case: PreActor instruction. This creates a PreActor from the
* given reference and adds it to its respective group in PreActors (based
* on the PreActor's [keyGroupType] variable).
*
* @param reference A JSON mapping of some number of PreThings.
* @param preThings The PreThing containers within the Area.
* @param area The Area to be populated by these PreThings.
* @param reference A JSON mapping of some number of PreActors.
* @param preActors The PreActor containers within the Area.
* @param area The Area to be populated by these PreActors.
* @param map The Map containing the Area.
*/
analyzePreThing(reference: any, prethings: IAnalysisContainer, area: IArea | IAreaRaw, map: IMap | IMapRaw): any;
analyzePreActor(reference: any, preactors: AnalysisContainer, area: Area | AreaRaw, map: Map | MapRaw): any;
/**

@@ -175,29 +175,29 @@ * Parses the Areas and Locations in a map to make it ready for use.

/**
* "Stretches" an Area's boundaries based on a PreThing. For each direction,
* if the PreThing has a more extreme version of it (higher top, etc.), the
* "Stretches" an Area's boundaries based on a PreActor. For each direction,
* if the PreActor has a more extreme version of it (higher top, etc.), the
* boundary is updated.
*
* @param prething The PreThing stretching the Area's boundaries.
* @param area An Area containing the PreThing.
* @param preactor The PreActor stretching the Area's boundaries.
* @param area An Area containing the PreActor.
*/
private stretchAreaBoundaries;
/**
* Adds a Thing to the specified collection in the Map's Area. If the collection
* Adds an Actor to the specified collection in the Map's Area. If the collection
* doesn't exist yet, it's created.
*
* @param thing The thing that has specified a collection.
* @param actor The actor that has specified a collection.
* @param collectionName The name of the collection.
* @param collectionKey The key under which the collection should store
* the Thing.
* the Actor.
* @param area The Area containing the collection.
*/
private ensureThingCollection;
private ensureActorCollection;
/**
* Creates an Object wrapper around a PreThings Object with versions of each
* child PreThing[] sorted by xloc and yloc, in increasing and decreasing order.
* Creates an Object wrapper around a PreActors Object with versions of each
* child PreActor[] sorted by xloc and yloc, in increasing and decreasing order.
*
* @param prethings A raw container of PreThings.
* @returns A PreThing wrapper with the keys "xInc", "xDec", "yInc", and "yDec".
* @param preactors A raw container of PreActors.
* @returns A PreActor wrapper with the keys "xInc", "xDec", "yInc", and "yDec".
*/
private processPreThingsArrays;
private processPreActorsArrays;
/**

@@ -229,30 +229,30 @@ * Creates an Object pre-populated with one key for each of the Strings in

/**
* Sorter for PreThings that results in increasing horizontal order.
* Sorter for PreActors that results in increasing horizontal order.
*
* @param a A PreThing.
* @param b A PreThing.
* @param a A PreActor.
* @param b A PreActor.
*/
private sortPreThingsXInc;
private sortPreActorsXInc;
/**
* Sorter for PreThings that results in decreasing horizontal order.
* Sorter for PreActors that results in decreasing horizontal order.
*
* @param a A PreThing.
* @param b A PreThing.
* @param a A PreActor.
* @param b A PreActor.
*/
private sortPreThingsXDec;
private sortPreActorsXDec;
/**
* Sorter for PreThings that results in increasing vertical order.
* Sorter for PreActors that results in increasing vertical order.
*
* @param a A PreThing.
* @param b A PreThing.
* @param a A PreActor.
* @param b A PreActor.
*/
private sortPreThingsYInc;
private sortPreActorsYInc;
/**
* Sorter for PreThings that results in decreasing vertical order.
* Sorter for PreActors that results in decreasing vertical order.
*
* @param a A PreThing.
* @param b A PreThing.
* @param a A PreActor.
* @param b A PreActor.
*/
private sortPreThingsYDec;
private sortPreActorsYDec;
}
//# sourceMappingURL=MapsCreatr.d.ts.map

@@ -1,2 +0,2 @@

define(["require", "exports", "./PreThing"], function (require, exports, PreThing_1) {
define(["require", "exports", "./PreActor"], function (require, exports, PreActor_1) {
"use strict";

@@ -126,48 +126,48 @@ Object.defineProperty(exports, "__esModule", { value: true });

/**
* Given a Area, this processes and returns the PreThings that are to
* Given a Area, this processes and returns the PreActors that are to
* inhabit the Area per its creation instructions.
*
* @returns A container with the parsed PreThings.
* @returns A container with the parsed PreActors.
*/
getPreThings(area) {
getPreActors(area) {
const map = area.map;
const creation = area.creation;
const prethings = this.createObjectFromStringArray(this.groupTypes);
const preactors = this.createObjectFromStringArray(this.groupTypes);
area.collections = {};
for (const instruction of creation) {
this.analyzePreSwitch(instruction, prethings, area, map);
this.analyzePreSwitch(instruction, preactors, area, map);
}
return this.processPreThingsArrays(prethings);
return this.processPreActorsArrays(preactors);
}
/**
* PreThing switcher: Given a JSON representation of a PreThing, this
* PreActor switcher: Given a JSON representation of a PreActor, this
* determines what to do with it. It may be a location setter (to switch the
* x- and y- location offset), a macro (to repeat some number of actions),
* or a raw PreThing.
* or a raw PreActor.
*
* @param reference A JSON mapping of some number of PreThings.
* @param preThings The PreThing containers within the Area.
* @param reference A JSON mapping of some number of PreActors.
* @param preActors The PreActor containers within the Area.
* @param area The Area to be populated.
* @param map The Map containing the Area.
* @returns The results of analyzePreMacro or analyzePreThing.
* @returns The results of analyzePreMacro or analyzePreActor.
*/
analyzePreSwitch(reference, prethings, area, map) {
analyzePreSwitch(reference, preactors, area, map) {
// Case: macro
if (reference.macro) {
return this.analyzePreMacro(reference, prethings, area, map);
return this.analyzePreMacro(reference, preactors, area, map);
}
// Case: default (a regular PreThing)
return this.analyzePreThing(reference, prethings, area, map);
// Case: default (a regular PreActor)
return this.analyzePreActor(reference, preactors, area, map);
}
/**
* PreThing case: Macro instruction. This calls the macro on the same input,
* PreActor case: Macro instruction. This calls the macro on the same input,
* captures the output, and recursively repeats the analyzePreSwitch driver
* function on the output(s).
*
* @param reference A JSON mapping of some number of PreThings.
* @param preThings The PreThing containers within the Area.
* @param reference A JSON mapping of some number of PreActors.
* @param preActors The PreActor containers within the Area.
* @param area The Area to be populated.
* @param map The Map containing the Area.
*/
analyzePreMacro(reference, prethings, area, map) {
analyzePreMacro(reference, preactors, area, map) {
if (!{}.hasOwnProperty.call(this.macros, reference.macro)) {

@@ -177,3 +177,3 @@ throw new Error(`A non-existent macro is referenced: '${reference.macro}'.`);

const macro = this.macros[reference.macro];
const outputs = macro(reference, prethings, area, map);
const outputs = macro(reference, preactors, area, map);
// If there is any output, recurse on all components of it, Array or not

@@ -183,7 +183,7 @@ if (outputs) {

for (const instruction of outputs) {
this.analyzePreSwitch(instruction, prethings, area, map);
this.analyzePreSwitch(instruction, preactors, area, map);
}
}
else {
this.analyzePreSwitch(outputs, prethings, area, map);
this.analyzePreSwitch(outputs, preactors, area, map);
}

@@ -194,44 +194,44 @@ }

/**
* Macro case: PreThing instruction. This creates a PreThing from the
* given reference and adds it to its respective group in PreThings (based
* on the PreThing's [keyGroupType] variable).
* Macro case: PreActor instruction. This creates a PreActor from the
* given reference and adds it to its respective group in PreActors (based
* on the PreActor's [keyGroupType] variable).
*
* @param reference A JSON mapping of some number of PreThings.
* @param preThings The PreThing containers within the Area.
* @param area The Area to be populated by these PreThings.
* @param reference A JSON mapping of some number of PreActors.
* @param preActors The PreActor containers within the Area.
* @param area The Area to be populated by these PreActors.
* @param map The Map containing the Area.
*/
analyzePreThing(reference, prethings, area, map) {
const title = reference.thing;
analyzePreActor(reference, preactors, area, map) {
const title = reference.actor;
if (!this.objectMaker.hasClass(title)) {
throw new Error(`A non-existent Thing type is referenced: '${title}'.`);
throw new Error(`A non-existent Actor type is referenced: '${title}'.`);
}
const prething = new PreThing_1.PreThing(this.objectMaker.make(title, reference), reference, this.objectMaker);
const thing = prething.thing;
if (!prething.thing.groupType) {
throw new Error(`A Thing of title '${title}' does not contain a groupType.`);
const preactor = new PreActor_1.PreActor(this.objectMaker.make(title, reference), reference, this.objectMaker);
const actor = preactor.actor;
if (!preactor.actor.groupType) {
throw new Error(`An Actor of title '${title}' does not contain a groupType.`);
}
if (this.groupTypes.indexOf(prething.thing.groupType) === -1) {
throw new Error(`A Thing of title '${title}' contains an unknown groupType: '${prething.thing.groupType}.`);
if (this.groupTypes.indexOf(preactor.actor.groupType) === -1) {
throw new Error(`An Actor of title '${title}' contains an unknown groupType: '${preactor.actor.groupType}.`);
}
prethings[prething.thing.groupType].push(prething);
if (!thing.noBoundaryStretch && area.boundaries) {
this.stretchAreaBoundaries(prething, area);
preactors[preactor.actor.groupType].push(preactor);
if (!actor.noBoundaryStretch && area.boundaries) {
this.stretchAreaBoundaries(preactor, area);
}
// If a Thing is an entrance, then the entrance's location must know the Thing.
if (thing.entrance !== undefined) {
if (typeof map.locations[thing.entrance] !== "undefined") {
if (typeof map.locations[thing.entrance].xloc === "undefined") {
map.locations[thing.entrance].xloc = prething.left;
// If an Actor is an entrance, then the entrance's location must know the Actor.
if (actor.entrance !== undefined) {
if (typeof map.locations[actor.entrance] !== "undefined") {
if (typeof map.locations[actor.entrance].xloc === "undefined") {
map.locations[actor.entrance].xloc = preactor.left;
}
if (typeof map.locations[thing.entrance].yloc === "undefined") {
map.locations[thing.entrance].yloc = prething.top;
if (typeof map.locations[actor.entrance].yloc === "undefined") {
map.locations[actor.entrance].yloc = preactor.top;
}
map.locations[thing.entrance].entrance = prething.thing;
map.locations[actor.entrance].entrance = preactor.actor;
}
}
if (reference.collectionName && area.collections) {
this.ensureThingCollection(thing, reference.collectionName, reference.collectionKey, area);
this.ensureActorCollection(actor, reference.collectionName, reference.collectionKey, area);
}
return prething;
return preactor;
}

@@ -330,27 +330,27 @@ /**

/**
* "Stretches" an Area's boundaries based on a PreThing. For each direction,
* if the PreThing has a more extreme version of it (higher top, etc.), the
* "Stretches" an Area's boundaries based on a PreActor. For each direction,
* if the PreActor has a more extreme version of it (higher top, etc.), the
* boundary is updated.
*
* @param prething The PreThing stretching the Area's boundaries.
* @param area An Area containing the PreThing.
* @param preactor The PreActor stretching the Area's boundaries.
* @param area An Area containing the PreActor.
*/
stretchAreaBoundaries(prething, area) {
stretchAreaBoundaries(preactor, area) {
const boundaries = area.boundaries;
boundaries.top = Math.min(prething.top, boundaries.top);
boundaries.right = Math.max(prething.right, boundaries.right);
boundaries.bottom = Math.max(prething.bottom, boundaries.bottom);
boundaries.left = Math.min(prething.left, boundaries.left);
boundaries.top = Math.min(preactor.top, boundaries.top);
boundaries.right = Math.max(preactor.right, boundaries.right);
boundaries.bottom = Math.max(preactor.bottom, boundaries.bottom);
boundaries.left = Math.min(preactor.left, boundaries.left);
}
/**
* Adds a Thing to the specified collection in the Map's Area. If the collection
* Adds an Actor to the specified collection in the Map's Area. If the collection
* doesn't exist yet, it's created.
*
* @param thing The thing that has specified a collection.
* @param actor The actor that has specified a collection.
* @param collectionName The name of the collection.
* @param collectionKey The key under which the collection should store
* the Thing.
* the Actor.
* @param area The Area containing the collection.
*/
ensureThingCollection(thing, collectionName, collectionKey, area) {
ensureActorCollection(actor, collectionName, collectionKey, area) {
let collection = area.collections[collectionName];

@@ -360,27 +360,27 @@ if (!collection) {

}
thing.collection = collection;
collection[collectionKey] = thing;
actor.collection = collection;
collection[collectionKey] = actor;
}
/**
* Creates an Object wrapper around a PreThings Object with versions of each
* child PreThing[] sorted by xloc and yloc, in increasing and decreasing order.
* Creates an Object wrapper around a PreActors Object with versions of each
* child PreActor[] sorted by xloc and yloc, in increasing and decreasing order.
*
* @param prethings A raw container of PreThings.
* @returns A PreThing wrapper with the keys "xInc", "xDec", "yInc", and "yDec".
* @param preactors A raw container of PreActors.
* @returns A PreActor wrapper with the keys "xInc", "xDec", "yInc", and "yDec".
*/
processPreThingsArrays(prethings) {
processPreActorsArrays(preactors) {
const output = {};
for (const i in prethings) {
const children = prethings[i];
for (const i in preactors) {
const children = preactors[i];
const array = {
push: (prething) => {
this.addArraySorted(array.xInc, prething, this.sortPreThingsXInc);
this.addArraySorted(array.xDec, prething, this.sortPreThingsXDec);
this.addArraySorted(array.yInc, prething, this.sortPreThingsYInc);
this.addArraySorted(array.yDec, prething, this.sortPreThingsYDec);
push: (preactor) => {
this.addArraySorted(array.xInc, preactor, this.sortPreActorsXInc);
this.addArraySorted(array.xDec, preactor, this.sortPreActorsXDec);
this.addArraySorted(array.yInc, preactor, this.sortPreActorsYInc);
this.addArraySorted(array.yDec, preactor, this.sortPreActorsYDec);
},
xDec: this.getArraySorted(children, this.sortPreThingsXDec),
xInc: this.getArraySorted(children, this.sortPreThingsXInc),
yDec: this.getArraySorted(children, this.sortPreThingsYDec),
yInc: this.getArraySorted(children, this.sortPreThingsYInc),
xDec: this.getArraySorted(children, this.sortPreActorsXDec),
xInc: this.getArraySorted(children, this.sortPreActorsXInc),
yDec: this.getArraySorted(children, this.sortPreActorsYDec),
yInc: this.getArraySorted(children, this.sortPreActorsYInc),
};

@@ -445,35 +445,35 @@ output[i] = array;

/**
* Sorter for PreThings that results in increasing horizontal order.
* Sorter for PreActors that results in increasing horizontal order.
*
* @param a A PreThing.
* @param b A PreThing.
* @param a A PreActor.
* @param b A PreActor.
*/
sortPreThingsXInc(a, b) {
sortPreActorsXInc(a, b) {
return a.left === b.left ? a.top - b.top : a.left - b.left;
}
/**
* Sorter for PreThings that results in decreasing horizontal order.
* Sorter for PreActors that results in decreasing horizontal order.
*
* @param a A PreThing.
* @param b A PreThing.
* @param a A PreActor.
* @param b A PreActor.
*/
sortPreThingsXDec(a, b) {
sortPreActorsXDec(a, b) {
return b.right === a.right ? b.bottom - a.bottom : b.right - a.right;
}
/**
* Sorter for PreThings that results in increasing vertical order.
* Sorter for PreActors that results in increasing vertical order.
*
* @param a A PreThing.
* @param b A PreThing.
* @param a A PreActor.
* @param b A PreActor.
*/
sortPreThingsYInc(a, b) {
sortPreActorsYInc(a, b) {
return a.top === b.top ? a.left - b.left : a.top - b.top;
}
/**
* Sorter for PreThings that results in decreasing vertical order.
* Sorter for PreActors that results in decreasing vertical order.
*
* @param a A PreThing.
* @param b A PreThing.
* @param a A PreActor.
* @param b A PreActor.
*/
sortPreThingsYDec(a, b) {
sortPreActorsYDec(a, b) {
return b.bottom === a.bottom ? b.right - a.right : b.bottom - a.bottom;

@@ -480,0 +480,0 @@ }

@@ -1,7 +0,7 @@

import { IObjectMakr } from "objectmakr";
import { IPreThing, IPreThingSettings } from "./IPreThing";
import { ObjectMakr } from "objectmakr";
import { PreActorLike, PreActorSettings } from "./PreActorLike";
/**
* A raw JSON-friendly description of a map.
*/
export interface IMapRaw {
export interface MapRaw {
/**

@@ -15,4 +15,4 @@ * The name of the map.

locations: {
[i: string]: ILocationRaw;
[i: number]: ILocationRaw;
[i: string]: LocationRaw;
[i: number]: LocationRaw;
};

@@ -23,4 +23,4 @@ /**

areas: {
[i: string]: IAreaRaw;
[i: number]: IAreaRaw;
[i: string]: AreaRaw;
[i: number]: AreaRaw;
};

@@ -31,5 +31,5 @@ }

*/
export interface IAreaRaw {
export interface AreaRaw {
/**
* Commands to place PreThings in the area.
* Commands to place PreActorLikes in the area.
*/

@@ -41,3 +41,3 @@ creation: any[];

*/
export interface ILocationRaw {
export interface LocationRaw {
/**

@@ -55,3 +55,3 @@ * The entrance method used to enter the location.

*/
export interface IMap {
export interface Map {
/**

@@ -65,4 +65,4 @@ * Whether the Map has had its areas and locations set.

areas: {
[i: string]: IArea;
[i: number]: IArea;
[i: string]: Area;
[i: number]: Area;
};

@@ -77,3 +77,3 @@ /**

*/
export interface IArea {
export interface Area {
/**

@@ -86,5 +86,5 @@ * The user-friendly label for this Area.

*/
map: IMap;
map: Map;
/**
* A list of PreThing and macro commands to build this area from scratch.
* A list of PreActorLike and macro commands to build this area from scratch.
*/

@@ -94,3 +94,3 @@ creation: any[];

* Groups that may be requested by creation commands to store generated
* Things, so they may reference each other during gameplay.
* Actors, so they may reference each other during gameplay.
*/

@@ -100,13 +100,13 @@ collections?: any;

* The boundaries for the map; these all start at 0 and are stretched by
* PreThings placed inside.
* PreActorLikes placed inside.
*/
boundaries: IBoundaries;
boundaries: Boundaries;
/**
* Optional listing of Things to provide to place at the end of the Area.
* Optional listing of Actors to provide to place at the end of the Area.
*/
afters?: (string | IPreThingSettings)[];
afters?: (string | PreActorSettings)[];
/**
* Optional listing of Things to provide to stretch across the Area.
* Optional listing of Actors to provide to stretch across the Area.
*/
stretches?: (string | IPreThingSettings)[];
stretches?: (string | PreActorSettings)[];
}

@@ -116,3 +116,3 @@ /**

*/
export interface IBoundaries {
export interface Boundaries {
top: number;

@@ -126,3 +126,3 @@ right: number;

*/
export interface ILocation {
export interface Location {
/**

@@ -135,3 +135,3 @@ * The user-friendly label for this Location.

*/
area: IArea;
area: Area;
/**

@@ -144,42 +144,42 @@ * The source name for the keyed entry Function used for this Location.

*/
entry?: IEntrance;
entry?: Entrance;
}
/**
* Parsed PreThings from an Area's creation's command analysis.
* Parsed PreActorLikes from an Area's creation's command analysis.
*/
export interface IPreThingsRawContainer {
[i: string]: IPreThing[];
export interface PreActorsRawContainer {
[i: string]: PreActorLike[];
}
/**
* A collection of PreThings sorted in all four directions.
* A collection of PreActorLikes sorted in all four directions.
*/
export interface IPreThingsContainer {
export interface PreActorsContainer {
/**
* PreThings sorted in increasing horizontal order.
* PreActorLikes sorted in increasing horizontal order.
*/
xInc: IPreThing[];
xInc: PreActorLike[];
/**
* PreThings sorted in decreasing horizontal order.
* PreActorLikes sorted in decreasing horizontal order.
*/
xDec: IPreThing[];
xDec: PreActorLike[];
/**
* PreThings sorted in increasing vertical order.
* PreActorLikes sorted in increasing vertical order.
*/
yInc: IPreThing[];
yInc: PreActorLike[];
/**
* PreThings sorted in decreasing vertical order.
* PreActorLikes sorted in decreasing vertical order.
*/
yDec: IPreThing[];
yDec: PreActorLike[];
/**
* Adds a PreThing to each sorted collection.
* Adds a PreActorLike to each sorted collection.
*
* @param prething A Prething to add.
* @param preactorLike A PreactorLike to add.
*/
push(prething: IPreThing): void;
push(preactorLike: PreActorLike): void;
}
/**
* A collection of PreThing containers, keyed by group name.
* A collection of PreActorLike containers, keyed by group name.
*/
export interface IPreThingsContainers {
[i: string]: IPreThingsContainer;
export interface PreActorsContainers {
[i: string]: PreActorsContainer;
}

@@ -189,3 +189,3 @@ /**

*/
export declare type IAnalysisContainer = IPreThingsContainers | IPreThingsRawContainer;
export declare type AnalysisContainer = PreActorsContainers | PreActorsRawContainer;
/**

@@ -196,30 +196,30 @@ * A Function used to enter a Map Location.

*/
export declare type IEntrance = (location: ILocation) => void;
export declare type Entrance = (location: Location) => void;
/**
* Available macros, keyed by name.
*/
export interface IMacros {
[i: string]: IMacro;
export interface Macros {
[i: string]: Macro;
}
/**
* A Function to automate placing other PreThings or macros in an Area.
* A Function to automate placing other PreActorLikes or macros in an Area.
*
* @param reference The JSON-friendly reference causing the macro.
* @param prethings The container of PreThings this is adding to.
* @param area The container Area containing the PreThings.
* @param preactorLikes The container of PreActorLikes this is adding to.
* @param area The container Area containing the PreActorLikes.
* @param map The container Map containing the Area.
* @returns A single PreThing or macro descriptor, or Array thereof.
* @returns A single PreActorLike or macro descriptor, or Array thereof.
*/
export declare type IMacro = (reference: any, prethings: IAnalysisContainer, area: IArea | IAreaRaw, map: IMap | IMapRaw) => IPreThing | IPreThing[] | any;
export declare type Macro = (reference: any, preactorLikes: AnalysisContainer, area: Area | AreaRaw, map: Map | MapRaw) => PreActorLike | PreActorLike[] | any;
/**
* Settings to initialize a new IMapsCreatr.
* Settings to initialize a new MapsCreatr.
*/
export interface IMapsCreatrSettings {
export interface MapsCreatrSettings {
/**
* An ObjectMakr used to create Maps and Things. Note that it must store
* full properties of Things, for quick size lookups.
* An ObjectMakr used to create Maps and Actors. Note that it must store
* full properties of Actors, for quick size lookups.
*/
objectMaker: IObjectMakr;
objectMaker: ObjectMakr;
/**
* The names of groups Things may be in.
* The names of groups Actors may be in.
*/

@@ -226,0 +226,0 @@ groupTypes?: string[];

@@ -11,8 +11,8 @@ {

"dependencies": {
"itemsholdr": "^0.8.0",
"objectmakr": "^0.8.0"
"itemsholdr": "^0.8.1",
"objectmakr": "^0.8.1"
},
"description": "Storage container and lazy loader for EightBittr maps.",
"devDependencies": {
"shenanigans-manager": "^0.8.0"
"shenanigans-manager": "^0.8.1"
},

@@ -39,3 +39,3 @@ "license": "MIT",

"types": "./lib/index.d.ts",
"version": "0.8.0"
"version": "0.8.1"
}

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

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