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

areaspawnr

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

areaspawnr - npm Package Compare versions

Comparing version 0.5.4 to 0.6.0

2

docs/assets/js/search.js

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

var typedoc = typedoc || {};typedoc.search = typedoc.search || {};typedoc.search.data = {"kinds":{"1":"External module","32":"Variable","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","2097152":"Object literal"},"rows":[{"id":0,"kind":1,"name":"\"IAreaSpawnr\"","url":"modules/_iareaspawnr_.html","classes":"tsd-kind-external-module"},{"id":1,"kind":256,"name":"ICommandAdder","url":"interfaces/_iareaspawnr_.icommandadder.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IAreaSpawnr\""},{"id":2,"kind":256,"name":"IAreaSpawnrSettings","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IAreaSpawnr\""},{"id":3,"kind":1024,"name":"MapsCreator","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#mapscreator","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":4,"kind":1024,"name":"MapScreener","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#mapscreener","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":5,"kind":1024,"name":"onSpawn","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#onspawn","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":6,"kind":65536,"name":"__type","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#onspawn.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings.onSpawn"},{"id":7,"kind":1024,"name":"onUnspawn","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#onunspawn","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":8,"kind":65536,"name":"__type","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#onunspawn.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings.onUnspawn"},{"id":9,"kind":1024,"name":"screenAttributes","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#screenattributes","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":10,"kind":1024,"name":"stretchAdd","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#stretchadd","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":11,"kind":1024,"name":"afterAdd","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#afteradd","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":12,"kind":1024,"name":"commandScope","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#commandscope","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":13,"kind":256,"name":"IAreaSpawnr","url":"interfaces/_iareaspawnr_.iareaspawnr.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IAreaSpawnr\""},{"id":14,"kind":2048,"name":"getMapsCreator","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getmapscreator","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":15,"kind":2048,"name":"getMapScreener","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getmapscreener","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":16,"kind":2048,"name":"getScreenAttributes","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getscreenattributes","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":17,"kind":2048,"name":"getMapName","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getmapname","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":18,"kind":2048,"name":"getMap","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getmap","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":19,"kind":2048,"name":"getMaps","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getmaps","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":20,"kind":2048,"name":"getArea","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getarea","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":21,"kind":2048,"name":"getAreaName","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getareaname","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":22,"kind":2048,"name":"getLocation","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getlocation","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":23,"kind":2048,"name":"getLocationEntered","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getlocationentered","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":24,"kind":2048,"name":"getPreThings","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getprethings","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":25,"kind":2048,"name":"setCommandScope","url":"interfaces/_iareaspawnr_.iareaspawnr.html#setcommandscope","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":26,"kind":2048,"name":"setMap","url":"interfaces/_iareaspawnr_.iareaspawnr.html#setmap","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":27,"kind":2048,"name":"setLocation","url":"interfaces/_iareaspawnr_.iareaspawnr.html#setlocation","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":28,"kind":2048,"name":"setStretches","url":"interfaces/_iareaspawnr_.iareaspawnr.html#setstretches","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":29,"kind":2048,"name":"setAfters","url":"interfaces/_iareaspawnr_.iareaspawnr.html#setafters","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":30,"kind":2048,"name":"spawnArea","url":"interfaces/_iareaspawnr_.iareaspawnr.html#spawnarea","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":31,"kind":2048,"name":"unspawnArea","url":"interfaces/_iareaspawnr_.iareaspawnr.html#unspawnarea","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":32,"kind":1,"name":"\"AreaSpawnr\"","url":"modules/_areaspawnr_.html","classes":"tsd-kind-external-module"},{"id":33,"kind":128,"name":"AreaSpawnr","url":"classes/_areaspawnr_.areaspawnr.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"AreaSpawnr\""},{"id":34,"kind":2097152,"name":"directionKeys","url":"classes/_areaspawnr_.areaspawnr.html#directionkeys","classes":"tsd-kind-object-literal tsd-parent-kind-class tsd-is-static","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":35,"kind":32,"name":"xInc","url":"classes/_areaspawnr_.areaspawnr.html#directionkeys.xinc","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionKeys"},{"id":36,"kind":32,"name":"xDec","url":"classes/_areaspawnr_.areaspawnr.html#directionkeys.xdec","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionKeys"},{"id":37,"kind":32,"name":"yInc","url":"classes/_areaspawnr_.areaspawnr.html#directionkeys.yinc","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionKeys"},{"id":38,"kind":32,"name":"yDec","url":"classes/_areaspawnr_.areaspawnr.html#directionkeys.ydec","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionKeys"},{"id":39,"kind":2097152,"name":"directionOpposites","url":"classes/_areaspawnr_.areaspawnr.html#directionopposites","classes":"tsd-kind-object-literal tsd-parent-kind-class tsd-is-static","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":40,"kind":32,"name":"xInc","url":"classes/_areaspawnr_.areaspawnr.html#directionopposites.xinc-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionOpposites"},{"id":41,"kind":32,"name":"xDec","url":"classes/_areaspawnr_.areaspawnr.html#directionopposites.xdec-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionOpposites"},{"id":42,"kind":32,"name":"yInc","url":"classes/_areaspawnr_.areaspawnr.html#directionopposites.yinc-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionOpposites"},{"id":43,"kind":32,"name":"yDec","url":"classes/_areaspawnr_.areaspawnr.html#directionopposites.ydec-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionOpposites"},{"id":44,"kind":1024,"name":"MapsCreator","url":"classes/_areaspawnr_.areaspawnr.html#mapscreator","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":45,"kind":1024,"name":"MapScreener","url":"classes/_areaspawnr_.areaspawnr.html#mapscreener","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":46,"kind":1024,"name":"screenAttributes","url":"classes/_areaspawnr_.areaspawnr.html#screenattributes","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":47,"kind":1024,"name":"mapCurrent","url":"classes/_areaspawnr_.areaspawnr.html#mapcurrent","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":48,"kind":1024,"name":"areaCurrent","url":"classes/_areaspawnr_.areaspawnr.html#areacurrent","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":49,"kind":1024,"name":"locationEntered","url":"classes/_areaspawnr_.areaspawnr.html#locationentered","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":50,"kind":1024,"name":"mapName","url":"classes/_areaspawnr_.areaspawnr.html#mapname","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":51,"kind":1024,"name":"prethings","url":"classes/_areaspawnr_.areaspawnr.html#prethings","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":52,"kind":1024,"name":"onSpawn","url":"classes/_areaspawnr_.areaspawnr.html#onspawn","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":53,"kind":65536,"name":"__type","url":"classes/_areaspawnr_.areaspawnr.html#onspawn.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"AreaSpawnr\".AreaSpawnr.onSpawn"},{"id":54,"kind":1024,"name":"onUnspawn","url":"classes/_areaspawnr_.areaspawnr.html#onunspawn","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":55,"kind":65536,"name":"__type","url":"classes/_areaspawnr_.areaspawnr.html#onunspawn.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"AreaSpawnr\".AreaSpawnr.onUnspawn"},{"id":56,"kind":1024,"name":"stretches","url":"classes/_areaspawnr_.areaspawnr.html#stretches","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":57,"kind":1024,"name":"stretchAdd","url":"classes/_areaspawnr_.areaspawnr.html#stretchadd","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":58,"kind":1024,"name":"afters","url":"classes/_areaspawnr_.areaspawnr.html#afters","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":59,"kind":1024,"name":"afterAdd","url":"classes/_areaspawnr_.areaspawnr.html#afteradd","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":60,"kind":1024,"name":"commandScope","url":"classes/_areaspawnr_.areaspawnr.html#commandscope","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":61,"kind":512,"name":"constructor","url":"classes/_areaspawnr_.areaspawnr.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":62,"kind":2048,"name":"getMapsCreator","url":"classes/_areaspawnr_.areaspawnr.html#getmapscreator","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":63,"kind":2048,"name":"getMapScreener","url":"classes/_areaspawnr_.areaspawnr.html#getmapscreener","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":64,"kind":2048,"name":"getScreenAttributes","url":"classes/_areaspawnr_.areaspawnr.html#getscreenattributes","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":65,"kind":2048,"name":"getMapName","url":"classes/_areaspawnr_.areaspawnr.html#getmapname","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":66,"kind":2048,"name":"getMap","url":"classes/_areaspawnr_.areaspawnr.html#getmap","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":67,"kind":2048,"name":"getMaps","url":"classes/_areaspawnr_.areaspawnr.html#getmaps","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":68,"kind":2048,"name":"getArea","url":"classes/_areaspawnr_.areaspawnr.html#getarea","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":69,"kind":2048,"name":"getAreaName","url":"classes/_areaspawnr_.areaspawnr.html#getareaname","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":70,"kind":2048,"name":"getLocation","url":"classes/_areaspawnr_.areaspawnr.html#getlocation","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":71,"kind":2048,"name":"getLocationEntered","url":"classes/_areaspawnr_.areaspawnr.html#getlocationentered","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":72,"kind":2048,"name":"getPreThings","url":"classes/_areaspawnr_.areaspawnr.html#getprethings","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":73,"kind":2048,"name":"setCommandScope","url":"classes/_areaspawnr_.areaspawnr.html#setcommandscope","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":74,"kind":2048,"name":"setMap","url":"classes/_areaspawnr_.areaspawnr.html#setmap","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":75,"kind":2048,"name":"setLocation","url":"classes/_areaspawnr_.areaspawnr.html#setlocation","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":76,"kind":2048,"name":"setStretches","url":"classes/_areaspawnr_.areaspawnr.html#setstretches","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":77,"kind":2048,"name":"setAfters","url":"classes/_areaspawnr_.areaspawnr.html#setafters","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":78,"kind":2048,"name":"spawnArea","url":"classes/_areaspawnr_.areaspawnr.html#spawnarea","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":79,"kind":2048,"name":"unspawnArea","url":"classes/_areaspawnr_.areaspawnr.html#unspawnarea","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":80,"kind":2048,"name":"applySpawnAction","url":"classes/_areaspawnr_.areaspawnr.html#applyspawnaction","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":81,"kind":2048,"name":"findPreThingsSpawnStart","url":"classes/_areaspawnr_.areaspawnr.html#findprethingsspawnstart","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":82,"kind":2048,"name":"findPreThingsSpawnEnd","url":"classes/_areaspawnr_.areaspawnr.html#findprethingsspawnend","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":83,"kind":2048,"name":"getDirectionEnd","url":"classes/_areaspawnr_.areaspawnr.html#getdirectionend","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"}]};
var typedoc = typedoc || {};typedoc.search = typedoc.search || {};typedoc.search.data = {"kinds":{"1":"External module","32":"Variable","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","2097152":"Object literal"},"rows":[{"id":0,"kind":1,"name":"\"IAreaSpawnr\"","url":"modules/_iareaspawnr_.html","classes":"tsd-kind-external-module"},{"id":1,"kind":256,"name":"ICommandAdder","url":"interfaces/_iareaspawnr_.icommandadder.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IAreaSpawnr\""},{"id":2,"kind":256,"name":"IAreaSpawnrSettings","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IAreaSpawnr\""},{"id":3,"kind":1024,"name":"mapsCreatr","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#mapscreatr","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":4,"kind":1024,"name":"mapScreenr","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#mapscreenr","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":5,"kind":1024,"name":"onSpawn","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#onspawn","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":6,"kind":65536,"name":"__type","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#onspawn.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings.onSpawn"},{"id":7,"kind":1024,"name":"onUnspawn","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#onunspawn","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":8,"kind":65536,"name":"__type","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#onunspawn.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings.onUnspawn"},{"id":9,"kind":1024,"name":"screenAttributes","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#screenattributes","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":10,"kind":1024,"name":"stretchAdd","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#stretchadd","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":11,"kind":1024,"name":"afterAdd","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#afteradd","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":12,"kind":1024,"name":"commandScope","url":"interfaces/_iareaspawnr_.iareaspawnrsettings.html#commandscope","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnrSettings"},{"id":13,"kind":256,"name":"IAreaSpawnr","url":"interfaces/_iareaspawnr_.iareaspawnr.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"IAreaSpawnr\""},{"id":14,"kind":2048,"name":"getScreenAttributes","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getscreenattributes","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":15,"kind":2048,"name":"getMapName","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getmapname","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":16,"kind":2048,"name":"getMap","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getmap","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":17,"kind":2048,"name":"getMaps","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getmaps","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":18,"kind":2048,"name":"getArea","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getarea","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":19,"kind":2048,"name":"getAreaName","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getareaname","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":20,"kind":2048,"name":"getLocation","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getlocation","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":21,"kind":2048,"name":"getLocationEntered","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getlocationentered","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":22,"kind":2048,"name":"getPreThings","url":"interfaces/_iareaspawnr_.iareaspawnr.html#getprethings","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":23,"kind":2048,"name":"setCommandScope","url":"interfaces/_iareaspawnr_.iareaspawnr.html#setcommandscope","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":24,"kind":2048,"name":"setMap","url":"interfaces/_iareaspawnr_.iareaspawnr.html#setmap","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":25,"kind":2048,"name":"setLocation","url":"interfaces/_iareaspawnr_.iareaspawnr.html#setlocation","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":26,"kind":2048,"name":"setStretches","url":"interfaces/_iareaspawnr_.iareaspawnr.html#setstretches","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":27,"kind":2048,"name":"setAfters","url":"interfaces/_iareaspawnr_.iareaspawnr.html#setafters","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":28,"kind":2048,"name":"spawnArea","url":"interfaces/_iareaspawnr_.iareaspawnr.html#spawnarea","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":29,"kind":2048,"name":"unspawnArea","url":"interfaces/_iareaspawnr_.iareaspawnr.html#unspawnarea","classes":"tsd-kind-method tsd-parent-kind-interface","parent":"\"IAreaSpawnr\".IAreaSpawnr"},{"id":30,"kind":1,"name":"\"AreaSpawnr\"","url":"modules/_areaspawnr_.html","classes":"tsd-kind-external-module"},{"id":31,"kind":128,"name":"AreaSpawnr","url":"classes/_areaspawnr_.areaspawnr.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"AreaSpawnr\""},{"id":32,"kind":2097152,"name":"directionKeys","url":"classes/_areaspawnr_.areaspawnr.html#directionkeys","classes":"tsd-kind-object-literal tsd-parent-kind-class tsd-is-static","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":33,"kind":32,"name":"xInc","url":"classes/_areaspawnr_.areaspawnr.html#directionkeys.xinc","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionKeys"},{"id":34,"kind":32,"name":"xDec","url":"classes/_areaspawnr_.areaspawnr.html#directionkeys.xdec","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionKeys"},{"id":35,"kind":32,"name":"yInc","url":"classes/_areaspawnr_.areaspawnr.html#directionkeys.yinc","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionKeys"},{"id":36,"kind":32,"name":"yDec","url":"classes/_areaspawnr_.areaspawnr.html#directionkeys.ydec","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionKeys"},{"id":37,"kind":2097152,"name":"directionOpposites","url":"classes/_areaspawnr_.areaspawnr.html#directionopposites","classes":"tsd-kind-object-literal tsd-parent-kind-class tsd-is-static","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":38,"kind":32,"name":"xInc","url":"classes/_areaspawnr_.areaspawnr.html#directionopposites.xinc-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionOpposites"},{"id":39,"kind":32,"name":"xDec","url":"classes/_areaspawnr_.areaspawnr.html#directionopposites.xdec-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionOpposites"},{"id":40,"kind":32,"name":"yInc","url":"classes/_areaspawnr_.areaspawnr.html#directionopposites.yinc-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionOpposites"},{"id":41,"kind":32,"name":"yDec","url":"classes/_areaspawnr_.areaspawnr.html#directionopposites.ydec-1","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"AreaSpawnr\".AreaSpawnr.directionOpposites"},{"id":42,"kind":1024,"name":"mapsCreator","url":"classes/_areaspawnr_.areaspawnr.html#mapscreator","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":43,"kind":1024,"name":"mapScreenr","url":"classes/_areaspawnr_.areaspawnr.html#mapscreenr","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":44,"kind":1024,"name":"screenAttributes","url":"classes/_areaspawnr_.areaspawnr.html#screenattributes","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":45,"kind":1024,"name":"mapCurrent","url":"classes/_areaspawnr_.areaspawnr.html#mapcurrent","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":46,"kind":1024,"name":"areaCurrent","url":"classes/_areaspawnr_.areaspawnr.html#areacurrent","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":47,"kind":1024,"name":"locationEntered","url":"classes/_areaspawnr_.areaspawnr.html#locationentered","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":48,"kind":1024,"name":"mapName","url":"classes/_areaspawnr_.areaspawnr.html#mapname","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":49,"kind":1024,"name":"prethings","url":"classes/_areaspawnr_.areaspawnr.html#prethings","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":50,"kind":1024,"name":"onSpawn","url":"classes/_areaspawnr_.areaspawnr.html#onspawn","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":51,"kind":65536,"name":"__type","url":"classes/_areaspawnr_.areaspawnr.html#onspawn.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"AreaSpawnr\".AreaSpawnr.onSpawn"},{"id":52,"kind":1024,"name":"onUnspawn","url":"classes/_areaspawnr_.areaspawnr.html#onunspawn","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":53,"kind":65536,"name":"__type","url":"classes/_areaspawnr_.areaspawnr.html#onunspawn.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"AreaSpawnr\".AreaSpawnr.onUnspawn"},{"id":54,"kind":1024,"name":"stretches","url":"classes/_areaspawnr_.areaspawnr.html#stretches","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":55,"kind":1024,"name":"stretchAdd","url":"classes/_areaspawnr_.areaspawnr.html#stretchadd","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":56,"kind":1024,"name":"afters","url":"classes/_areaspawnr_.areaspawnr.html#afters","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":57,"kind":1024,"name":"afterAdd","url":"classes/_areaspawnr_.areaspawnr.html#afteradd","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":58,"kind":1024,"name":"commandScope","url":"classes/_areaspawnr_.areaspawnr.html#commandscope","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":59,"kind":512,"name":"constructor","url":"classes/_areaspawnr_.areaspawnr.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":60,"kind":2048,"name":"getScreenAttributes","url":"classes/_areaspawnr_.areaspawnr.html#getscreenattributes","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":61,"kind":2048,"name":"getMapName","url":"classes/_areaspawnr_.areaspawnr.html#getmapname","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":62,"kind":2048,"name":"getMap","url":"classes/_areaspawnr_.areaspawnr.html#getmap","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":63,"kind":2048,"name":"getMaps","url":"classes/_areaspawnr_.areaspawnr.html#getmaps","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":64,"kind":2048,"name":"getArea","url":"classes/_areaspawnr_.areaspawnr.html#getarea","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":65,"kind":2048,"name":"getAreaName","url":"classes/_areaspawnr_.areaspawnr.html#getareaname","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":66,"kind":2048,"name":"getLocation","url":"classes/_areaspawnr_.areaspawnr.html#getlocation","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":67,"kind":2048,"name":"getLocationEntered","url":"classes/_areaspawnr_.areaspawnr.html#getlocationentered","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":68,"kind":2048,"name":"getPreThings","url":"classes/_areaspawnr_.areaspawnr.html#getprethings","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":69,"kind":2048,"name":"setCommandScope","url":"classes/_areaspawnr_.areaspawnr.html#setcommandscope","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":70,"kind":2048,"name":"setMap","url":"classes/_areaspawnr_.areaspawnr.html#setmap","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":71,"kind":2048,"name":"setLocation","url":"classes/_areaspawnr_.areaspawnr.html#setlocation","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":72,"kind":2048,"name":"setStretches","url":"classes/_areaspawnr_.areaspawnr.html#setstretches","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":73,"kind":2048,"name":"setAfters","url":"classes/_areaspawnr_.areaspawnr.html#setafters","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":74,"kind":2048,"name":"spawnArea","url":"classes/_areaspawnr_.areaspawnr.html#spawnarea","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":75,"kind":2048,"name":"unspawnArea","url":"classes/_areaspawnr_.areaspawnr.html#unspawnarea","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":76,"kind":2048,"name":"applySpawnAction","url":"classes/_areaspawnr_.areaspawnr.html#applyspawnaction","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":77,"kind":2048,"name":"findPreThingsSpawnStart","url":"classes/_areaspawnr_.areaspawnr.html#findprethingsspawnstart","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":78,"kind":2048,"name":"findPreThingsSpawnEnd","url":"classes/_areaspawnr_.areaspawnr.html#findprethingsspawnend","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"},{"id":79,"kind":2048,"name":"getDirectionEnd","url":"classes/_areaspawnr_.areaspawnr.html#getdirectionend","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-private","parent":"\"AreaSpawnr\".AreaSpawnr"}]};

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

import { IArea, ILocation, IMap, IMapsCreatr, IPreThingsContainers } from "mapscreatr/lib/imapscreatr";
import { IPreThingSettings } from "mapscreatr/lib/iprething";
import { IMapScreenr } from "mapscreenr/lib/imapscreenr";
import { IArea, ILocation, IMap, IPreThingsContainers } from "mapscreatr/lib/IMapsCreatr";
import { IPreThingSettings } from "mapscreatr/lib/IPreThing";
import { IAreaSpawnr, IAreaSpawnrSettings } from "./IAreaSpawnr";

@@ -12,3 +11,3 @@ /**

*/
static directionKeys: {
static readonly directionKeys: {
[i: string]: string;

@@ -19,13 +18,13 @@ };

*/
static directionOpposites: {
static readonly directionOpposites: {
[i: string]: string;
};
/**
* MapsCreatr container for Maps from which this obtains Thing settings.
* Storage container and lazy loader for GameStartr maps.
*/
private MapsCreator;
private mapsCreator;
/**
* MapScreenr container for attributes copied from Areas.
*/
private MapScreener;
private mapScreenr;
/**

@@ -90,10 +89,2 @@ * The names of attributes to be copied to the MapScreenr during setLocation.

/**
* @returns The internal MapsCreator.
*/
getMapsCreator(): IMapsCreatr;
/**
* @returns The internal MapScreener.
*/
getMapScreener(): IMapScreenr;
/**
* @returns The attribute names to be copied to MapScreener.

@@ -169,4 +160,5 @@ */

* @param name The key of the Location to start in.
* @returns The newly set Location.
*/
setLocation(name: string): void;
setLocation(name: string): ILocation;
/**

@@ -173,0 +165,0 @@ * Applies the stretchAdd Function to each given "stretch" command and

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

define(["require","exports"],function(t,e){"use strict";var r=function(){function t(t){if(!t)throw new Error("No settings given to AreaSpawnr.");if(!t.MapsCreator)throw new Error("No MapsCreator provided to AreaSpawnr.");if(!t.MapScreener)throw new Error("No MapScreener provided to AreaSpawnr.");this.MapsCreator=t.MapsCreator,this.MapScreener=t.MapScreener,this.onSpawn=t.onSpawn,this.onUnspawn=t.onUnspawn,this.screenAttributes=t.screenAttributes||[],this.stretchAdd=t.stretchAdd,this.afterAdd=t.afterAdd,this.commandScope=t.commandScope}return t.prototype.getMapsCreator=function(){return this.MapsCreator},t.prototype.getMapScreener=function(){return this.MapScreener},t.prototype.getScreenAttributes=function(){return this.screenAttributes},t.prototype.getMapName=function(){return this.mapName},t.prototype.getMap=function(t){return"undefined"!=typeof t?this.MapsCreator.getMap(t):this.mapCurrent},t.prototype.getMaps=function(){return this.MapsCreator.getMaps()},t.prototype.getArea=function(){return this.areaCurrent},t.prototype.getAreaName=function(){return this.areaCurrent.name},t.prototype.getLocation=function(t){return this.areaCurrent.map.locations[t]},t.prototype.getLocationEntered=function(){return this.locationEntered},t.prototype.getPreThings=function(){return this.prethings},t.prototype.setCommandScope=function(t){this.commandScope=t},t.prototype.setMap=function(t,e){if(this.mapCurrent=this.getMap(t),!this.mapCurrent)throw new Error("Unknown Map in setMap: '"+t+"'.");return this.mapName=t,arguments.length>1&&this.setLocation(e),this.mapCurrent},t.prototype.setLocation=function(t){var e=this.mapCurrent.locations[t];if(!e)throw new Error("Unknown location in setLocation: '"+t+"'.");this.locationEntered=e,this.areaCurrent=e.area,this.areaCurrent.boundaries={top:0,right:0,bottom:0,left:0};for(var r=0;r<this.screenAttributes.length;r+=1){var n=this.screenAttributes[r];this.MapScreener.variables[n]=this.areaCurrent[n]}this.prethings=this.MapsCreator.getPreThings(e.area),this.areaCurrent.stretches&&this.setStretches(this.areaCurrent.stretches),this.areaCurrent.afters&&this.setAfters(this.areaCurrent.afters)},t.prototype.setStretches=function(t){if(!this.stretchAdd)throw new Error("Cannot call setStretches without a stretchAdd.");this.stretches=t;for(var e=0;e<t.length;e+=1)this.stretchAdd.call(this.commandScope||this,t[e],e,t)},t.prototype.setAfters=function(t){if(!this.afterAdd)throw new Error("Cannot call setAfters without an afterAdd.");this.afters=t;for(var e=0;e<t.length;e+=1)this.afterAdd.call(this.commandScope||this,t[e],e,t)},t.prototype.spawnArea=function(t,e,r,n,o){this.onSpawn&&this.applySpawnAction(this.onSpawn,!0,t,e,r,n,o)},t.prototype.unspawnArea=function(t,e,r,n,o){this.onUnspawn&&this.applySpawnAction(this.onUnspawn,!1,t,e,r,n,o)},t.prototype.applySpawnAction=function(t,e,r,n,o,i,s){for(var a in this.prethings)if(this.prethings.hasOwnProperty(a)){var p=this.prethings[a][r];if(0!==p.length)for(var h=p.length/2|0,c=this.findPreThingsSpawnStart(r,p,h,n,o,i,s),u=this.findPreThingsSpawnEnd(r,p,h,n,o,i,s),f=c;f<=u;f+=1){var d=p[f];d.spawned!==e&&(d.spawned=e,t.call(this.commandScope,d))}}},t.prototype.findPreThingsSpawnStart=function(e,r,n,o,i,s,a){for(var p=t.directionKeys[e],h=this.getDirectionEnd(p,o,i,s,a),c=0;c<r.length;c+=1)if(r[c][p]>=h)return c;return r.length},t.prototype.findPreThingsSpawnEnd=function(e,r,n,o,i,s,a){for(var p=t.directionKeys[e],h=t.directionKeys[t.directionOpposites[e]],c=this.getDirectionEnd(h,o,i,s,a),u=r.length-1;u>=0;u-=1)if(r[u][p]<=c)return u;return-1},t.prototype.getDirectionEnd=function(t,e,r,n,o){switch(t){case"top":return e;case"right":return r;case"bottom":return n;case"left":return o;default:throw new Error("Unknown directionKey: '"+t+"'.")}},t.directionKeys={xInc:"left",xDec:"right",yInc:"top",yDec:"bottom"},t.directionOpposites={xInc:"xDec",xDec:"xInc",yInc:"yDec",yDec:"yInc"},t}();e.AreaSpawnr=r});
define(["require","exports"],function(t,r){"use strict";var e=function(){function t(t){if(!t)throw new Error("No settings given to AreaSpawnr.");if(!t.mapsCreatr)throw new Error("No mapsCreatr provided to AreaSpawnr.");if(!t.mapScreenr)throw new Error("No mapsCreatr provided to AreaSpawnr.");this.mapsCreator=t.mapsCreatr,this.mapScreenr=t.mapScreenr,this.onSpawn=t.onSpawn,this.onUnspawn=t.onUnspawn,this.screenAttributes=t.screenAttributes||[],this.stretchAdd=t.stretchAdd,this.afterAdd=t.afterAdd,this.commandScope=t.commandScope}return t.prototype.getScreenAttributes=function(){return this.screenAttributes},t.prototype.getMapName=function(){return this.mapName},t.prototype.getMap=function(t){return"undefined"==typeof t?this.mapCurrent:this.mapsCreator.getMap(t)},t.prototype.getMaps=function(){return this.mapsCreator.getMaps()},t.prototype.getArea=function(){return this.areaCurrent},t.prototype.getAreaName=function(){return this.areaCurrent.name},t.prototype.getLocation=function(t){return this.areaCurrent.map.locations[t]},t.prototype.getLocationEntered=function(){return this.locationEntered},t.prototype.getPreThings=function(){return this.prethings},t.prototype.setCommandScope=function(t){this.commandScope=t},t.prototype.setMap=function(t,r){if(this.mapCurrent=this.getMap(t),!this.mapCurrent)throw new Error("Unknown Map in setMap: '"+t+"'.");return this.mapName=t,arguments.length>1&&this.setLocation(r),this.mapCurrent},t.prototype.setLocation=function(t){var r=this.mapCurrent.locations[t];if(!r)throw new Error("Unknown location in setLocation: '"+t+"'.");this.locationEntered=r,this.areaCurrent=r.area,this.areaCurrent.boundaries={top:0,right:0,bottom:0,left:0};for(var e=0,n=this.screenAttributes;e<n.length;e++){var o=n[e];this.mapScreenr.variables[o]=this.areaCurrent[o]}return this.prethings=this.mapsCreator.getPreThings(r.area),this.areaCurrent.stretches&&this.setStretches(this.areaCurrent.stretches),this.areaCurrent.afters&&this.setAfters(this.areaCurrent.afters),r},t.prototype.setStretches=function(t){if(!this.stretchAdd)throw new Error("Cannot call setStretches without a stretchAdd.");this.stretches=t;for(var r=0;r<t.length;r+=1)this.stretchAdd.call(this.commandScope||this,t[r],r,t)},t.prototype.setAfters=function(t){if(!this.afterAdd)throw new Error("Cannot call setAfters without an afterAdd.");this.afters=t;for(var r=0;r<t.length;r+=1)this.afterAdd.call(this.commandScope||this,t[r],r,t)},t.prototype.spawnArea=function(t,r,e,n,o){this.onSpawn&&this.applySpawnAction(this.onSpawn,!0,t,r,e,n,o)},t.prototype.unspawnArea=function(t,r,e,n,o){this.onUnspawn&&this.applySpawnAction(this.onUnspawn,!1,t,r,e,n,o)},t.prototype.applySpawnAction=function(t,r,e,n,o,i,a){for(var s in this.prethings)if(this.prethings.hasOwnProperty(s)){var p=this.prethings[s][e];if(0!==p.length)for(var h=p.length/2|0,c=this.findPreThingsSpawnStart(e,p,h,n,o,i,a),u=this.findPreThingsSpawnEnd(e,p,h,n,o,i,a),f=c;f<=u;f+=1){var d=p[f];d.spawned!==r&&(d.spawned=r,t.call(this.commandScope,d))}}},t.prototype.findPreThingsSpawnStart=function(r,e,n,o,i,a,s){for(var p=t.directionKeys[r],h=this.getDirectionEnd(p,o,i,a,s),c=0;c<e.length;c+=1)if(e[c][p]>=h)return c;return e.length},t.prototype.findPreThingsSpawnEnd=function(r,e,n,o,i,a,s){for(var p=t.directionKeys[r],h=t.directionKeys[t.directionOpposites[r]],c=this.getDirectionEnd(h,o,i,a,s),u=e.length-1;u>=0;u-=1)if(e[u][p]<=c)return u;return-1},t.prototype.getDirectionEnd=function(t,r,e,n,o){switch(t){case"top":return r;case"right":return e;case"bottom":return n;case"left":return o;default:throw new Error("Unknown directionKey: '"+t+"'.")}},t.directionKeys={xInc:"left",xDec:"right",yInc:"top",yDec:"bottom"},t.directionOpposites={xInc:"xDec",xDec:"xInc",yInc:"yDec",yDec:"yInc"},t}();r.AreaSpawnr=e});
//# sourceMappingURL=AreaSpawnr.js.map

@@ -1,4 +0,4 @@

import { IArea, ILocation, IMap, IMapsCreatr, IPreThingsContainers } from "mapscreatr/lib/imapscreatr";
import { IPreThing, IPreThingSettings } from "mapscreatr/lib/iprething";
import { IMapScreenr } from "mapscreenr/lib/imapscreenr";
import { IArea, ILocation, IMap, IMapsCreatr, IPreThingsContainers } from "mapscreatr/lib/IMapsCreatr";
import { IPreThing, IPreThingSettings } from "mapscreatr/lib/IPreThing";
import { IMapScreenr } from "mapscreenr/lib/IMapScreenr";
/**

@@ -21,7 +21,7 @@ * A Function to add a map command, such as an after or stretch.

*/
MapsCreator: IMapsCreatr;
mapsCreatr: IMapsCreatr;
/**
* A MapScreenr used to store attributes of Areas.
*/
MapScreener: IMapScreenr;
mapScreenr: IMapScreenr;
/**

@@ -59,10 +59,2 @@ * Function for when a PreThing's Thing should be spawned.

/**
* @returns The internal MapsCreator.
*/
getMapsCreator(): IMapsCreatr;
/**
* @returns The internal MapScreener.
*/
getMapScreener(): IMapScreenr;
/**
* @returns The attribute names to be copied to MapScreener.

@@ -138,4 +130,5 @@ */

* @param name The key of the Location to start in.
* @returns The newly set Location.
*/
setLocation(name: string): void;
setLocation(name: string): ILocation;
/**

@@ -142,0 +135,0 @@ * Applies the stretchAdd Function to each given "stretch" command and

{
"name": "areaspawnr",
"description": "Loads GameStartr maps to spawn and unspawn areas on demand.",
"version": "0.5.4",
"version": "0.6.0",
"author": {

@@ -18,10 +18,10 @@ "name": "Josh Goldberg",

"dependencies": {
"itemsholdr": "^0.5.2",
"mapscreatr": "^0.5.2",
"mapscreenr": "^0.5.2",
"objectmakr": "^0.5.2"
"itemsholdr": "0.6.X",
"mapscreatr": "0.6.X",
"mapscreenr": "0.6.X",
"objectmakr": "0.6.X"
},
"devDependencies": {
"gulp-shenanigans": "^0.5.19"
"gulp-shenanigans": "0.6.X"
}
}
{
"dependencies": {
"ItemsHoldr": "^0.5.2",
"MapsCreatr": "^0.5.2",
"MapScreenr": "^0.5.2",
"ObjectMakr": "^0.5.2"
"ItemsHoldr": "0.6.X",
"MapsCreatr": "0.6.X",
"MapScreenr": "0.6.X",
"ObjectMakr": "0.6.X"
},

@@ -11,4 +11,4 @@ "package": {

"name": "AreaSpawnr",
"version": "0.5.4"
"version": "0.6.0"
}
}

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

import { IArea, ILocation, IMap, IMapsCreatr, IPreThingsContainers } from "mapscreatr/lib/imapscreatr";
import { IPreThingSettings } from "mapscreatr/lib/iprething";
import { IMapScreenr } from "mapscreenr/lib/imapscreenr";
import { IArea, ILocation, IMap, IPreThingsContainers } from "mapscreatr/lib/IMapsCreatr";
import { IPreThingSettings } from "mapscreatr/lib/IPreThing";
import { IAreaSpawnr, IAreaSpawnrSettings } from "./IAreaSpawnr";

@@ -12,3 +11,3 @@ /**

*/
static directionKeys: {
static readonly directionKeys: {
[i: string]: string;

@@ -19,13 +18,13 @@ };

*/
static directionOpposites: {
static readonly directionOpposites: {
[i: string]: string;
};
/**
* MapsCreatr container for Maps from which this obtains Thing settings.
* Storage container and lazy loader for GameStartr maps.
*/
private MapsCreator;
private mapsCreator;
/**
* MapScreenr container for attributes copied from Areas.
*/
private MapScreener;
private mapScreenr;
/**

@@ -90,10 +89,2 @@ * The names of attributes to be copied to the MapScreenr during setLocation.

/**
* @returns The internal MapsCreator.
*/
getMapsCreator(): IMapsCreatr;
/**
* @returns The internal MapScreener.
*/
getMapScreener(): IMapScreenr;
/**
* @returns The attribute names to be copied to MapScreener.

@@ -169,4 +160,5 @@ */

* @param name The key of the Location to start in.
* @returns The newly set Location.
*/
setLocation(name: string): void;
setLocation(name: string): ILocation;
/**

@@ -173,0 +165,0 @@ * Applies the stretchAdd Function to each given "stretch" command and

@@ -16,10 +16,10 @@ define(["require", "exports"], function (require, exports) {

}
if (!settings.MapsCreator) {
throw new Error("No MapsCreator provided to AreaSpawnr.");
if (!settings.mapsCreatr) {
throw new Error("No mapsCreatr provided to AreaSpawnr.");
}
if (!settings.MapScreener) {
throw new Error("No MapScreener provided to AreaSpawnr.");
if (!settings.mapScreenr) {
throw new Error("No mapsCreatr provided to AreaSpawnr.");
}
this.MapsCreator = settings.MapsCreator;
this.MapScreener = settings.MapScreener;
this.mapsCreator = settings.mapsCreatr;
this.mapScreenr = settings.mapScreenr;
this.onSpawn = settings.onSpawn;

@@ -33,14 +33,2 @@ this.onUnspawn = settings.onUnspawn;

/**
* @returns The internal MapsCreator.
*/
AreaSpawnr.prototype.getMapsCreator = function () {
return this.MapsCreator;
};
/**
* @returns The internal MapScreener.
*/
AreaSpawnr.prototype.getMapScreener = function () {
return this.MapScreener;
};
/**
* @returns The attribute names to be copied to MapScreener.

@@ -65,8 +53,5 @@ */

AreaSpawnr.prototype.getMap = function (name) {
if (typeof name !== "undefined") {
return this.MapsCreator.getMap(name);
}
else {
return this.mapCurrent;
}
return typeof name === "undefined"
? this.mapCurrent
: this.mapsCreator.getMap(name);
};

@@ -79,3 +64,3 @@ /**

AreaSpawnr.prototype.getMaps = function () {
return this.MapsCreator.getMaps();
return this.mapsCreator.getMaps();
};

@@ -153,5 +138,5 @@ /**

* @param name The key of the Location to start in.
* @returns The newly set Location.
*/
AreaSpawnr.prototype.setLocation = function (name) {
// Query the location from the current map and ensure it exists
var location = this.mapCurrent.locations[name];

@@ -161,3 +146,2 @@ if (!location) {

}
// Since the location is valid, mark it as current (with its area)
this.locationEntered = location;

@@ -172,9 +156,9 @@ this.areaCurrent = location.area;

// Copy all the settings from that area into the MapScreenr container
for (var i = 0; i < this.screenAttributes.length; i += 1) {
var attribute = this.screenAttributes[i];
this.MapScreener.variables[attribute] = this.areaCurrent[attribute];
for (var _i = 0, _a = this.screenAttributes; _i < _a.length; _i++) {
var attribute = _a[_i];
this.mapScreenr.variables[attribute] = this.areaCurrent[attribute];
}
// Reset the prethings object, enabling it to be used as a fresh start
// for the new Area/Location placements
this.prethings = this.MapsCreator.getPreThings(location.area);
this.prethings = this.mapsCreator.getPreThings(location.area);
// Optional: set stretch commands

@@ -188,2 +172,3 @@ if (this.areaCurrent.stretches) {

}
return location;
};

@@ -402,2 +387,2 @@ /**

//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFyZWFTcGF3bnIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7SUFRQTs7T0FFRztJQUNIO1FBZ0dJOzs7O1dBSUc7UUFDSCxvQkFBWSxRQUE2QjtZQUNyQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUM7Z0JBQ1osTUFBTSxJQUFJLEtBQUssQ0FBQyxrQ0FBa0MsQ0FBQyxDQUFDO1lBQ3hELENBQUM7WUFDRCxFQUFFLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDO2dCQUN4QixNQUFNLElBQUksS0FBSyxDQUFDLHdDQUF3QyxDQUFDLENBQUM7WUFDOUQsQ0FBQztZQUNELEVBQUUsQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUM7Z0JBQ3hCLE1BQU0sSUFBSS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RoZSBsZWZ0LW1vc3QgYm91bmQgdG8gYXBwbHkgd2l0aGluLlxyXG4gICAgICovXHJcbiAgICBwcml2YXRlIGFwcGx5U3Bhd25BY3Rpb24oXHJcbiAgICAgICAgY2FsbGJhY2s6IChwcmV0aGluZzogSVByZVRoaW5nKSA9PiB2b2lkLFxyXG4gICAgICAgIHN0YXR1czogYm9vbGVhbixcclxuICAgICAgICBkaXJlY3Rpb246IHN0cmluZyxcclxuICAgICAgICB0b3A6IG51bWJlcixcclxuICAgICAgICByaWdodDogbnVtYmVyLFxyXG4gICAgICAgIGJvdHRvbTogbnVtYmVyLFxyXG4gICAgICAgIGxlZnQ6IG51bWJlcik6IHZvaWQge1xyXG4gICAgICAgIC8vIEZvciBlYWNoIGdyb3VwIG9mIFByZVRoaW5ncyBjdXJyZW50bHkgYWJsZSB0byBzcGF3bi4uLlxyXG4gICAgICAgIGZvciAobGV0IG5hbWUgaW4gdGhpcy5wcmV0aGluZ3MpIHtcclxuICAgICAgICAgICAgaWYgKCF0aGlzLnByZXRoaW5ncy5oYXNPd25Qcm9wZXJ0eShuYW1lKSkge1xyXG4gICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vIERvbid0IGJvdGhlciB0cnlpbmcgdG8gc3Bhd24gdGhlIGdyb3VwIGlmIGl0IGhhcyBubyBtZW1iZXJzXHJcbiAgICAgICAgICAgIGNvbnN0IGdyb3VwOiBJUHJlVGhpbmdbXSA9ICh0aGlzLnByZXRoaW5ncyBhcyBhbnkpW25hbWVdW2RpcmVjdGlvbl07XHJcbiAgICAgICAgICAgIGlmIChncm91cC5sZW5ndGggPT09IDApIHtcclxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvLyBGaW5kIHRoZSBzdGFydCBhbmQgZW5kIHBvaW50cyB3aXRoaW4gdGhlIFByZVRoaW5ncyBBcnJheVxy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IHRvIGFwcGx5IHdpdGhpbi5cclxuICAgICAqIEBwYXJhbSBsZWZ0ICAgIFRoZSBsZWZ0LW1vc3QgYm91bmQgdG8gYXBwbHkgd2l0aGluLlxyXG4gICAgICogQHJldHVybnMgVGhlIGluZGV4IHRvIHN0YXJ0IHNwYXduaW5nIFByZVRoaW5ncyBmcm9tLlxyXG4gICAgICovXHJcbiAgICBwcml2YXRlIGZpbmRQcmVUaGluZ3NTcGF3blN0YXJ0KFxyXG4gICAgICAgIGRpcmVjdGlvbjogc3RyaW5nLFxyXG4gICAgICAgIGdyb3VwOiBJUHJlVGhpbmdbXSxcclxuICAgICAgICBfbWlkOiBudW1iZXIsXHJcbiAgICAgICAgdG9wOiBudW1iZXIsXHJcbiAgICAgICAgcmlnaHQ6IG51bWJlcixcclxuICAgICAgICBib3R0b206IG51bWJlcixcclxuICAgICAgICBsZWZ0OiBudW1iZXIpOiBudW1iZXIge1xyXG4gICAgICAgIGNvbnN0IGRpcmVjdGlvbktleTogc3RyaW5nID0gQXJlYVNwYXduci5kaXJlY3Rpb25LZXlzW2RpcmVjdGlvbl07XHJcbiAgICAgICAgY29uc3QgZGlyZWN0aW9uRW5kOiBudW1iZXIgPSB0aGlzLmdldERpcmVjdGlvbkVuZChkaXJlY3Rpb25LZXksIHRvcCwgcmlnaHQsIGJvdHRvbSwgbGVmdCk7XHJcblxyXG4gICAgICAgIGZvciAobGV0IGk6IG51bWJlciA9IDA7IGkgPCBncm91cC5sZW5ndGg7IGkgKz0gMSkge1xyXG4gICAgICAgICAgICBpZiAoKGdyb3VwIGFzIGFueSlbaV1bZGlyZWN0aW9uS2V5XSA+PSBkaXJlY3Rpb25FbmQpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICByZXR1cm4gZ3JvdXAubGVuZ3RoO1xyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogRmluZHMgdGh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VtYmVyIHtcclxuICAgICAgICBzd2l0Y2ggKGRpcmVjdGlvbktleSkge1xyXG4gICAgICAgICAgICBjYXNlIFwidG9wXCI6XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9wO1xyXG4gICAgICAgICAgICBjYXNlIFwicmlnaHRcIjpcclxuICAgICAgICAgICAgICAgIHJldHVybiByaWdodDtcclxuICAgICAgICAgICAgY2FzZSBcImJvdHRvbVwiOlxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGJvdHRvbTtcclxuICAgICAgICAgICAgY2FzZSBcImxlZnRcIjpcclxuICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0O1xyXG4gICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBVbmtub3duIGRpcmVjdGlvbktleTogJyR7ZGlyZWN0aW9uS2V5fScuYCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59XHJcbiJdfQ==
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFyZWFTcGF3bnIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7SUFRQTs7T0FFRztJQUNIO1FBZ0dJOzs7O1dBSUc7UUFDSCxvQkFBWSxRQUE2QjtZQUNyQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUM7Z0JBQ1osTUFBTSxJQUFJLEtBQUssQ0FBQyxrQ0FBa0MsQ0FBQyxDQUFDO1lBQ3hELENBQUM7WUFDRCxFQUFFLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO2dCQUN2QixNQUFNLElBQUksS0FBSyxDQUFDLHVDQUF1QyxDQUFDLENBQUM7WUFDN0QsQ0FBQztZQUNELEVBQUUsQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDLFVBQVUsQ0FBQyxDQUF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bi5cclxuICAgICAqL1xyXG4gICAgcHJpdmF0ZSBhcHBseVNwYXduQWN0aW9uKFxyXG4gICAgICAgIGNhbGxiYWNrOiAocHJldGhpbmc6IElQcmVUaGluZykgPT4gdm9pZCxcclxuICAgICAgICBzdGF0dXM6IGJvb2xlYW4sXHJcbiAgICAgICAgZGlyZWN0aW9uOiBzdHJpbmcsXHJcbiAgICAgICAgdG9wOiBudW1iZXIsXHJcbiAgICAgICAgcmlnaHQ6IG51bWJlcixcclxuICAgICAgICBib3R0b206IG51bWJlcixcclxuICAgICAgICBsZWZ0OiBudW1iZXIpOiB2b2lkIHtcclxuICAgICAgICAvLyBGb3IgZWFjaCBncm91cCBvZiBQcmVUaGluZ3MgY3VycmVudGx5IGFibGUgdG8gc3Bhd24uLi5cclxuICAgICAgICBmb3IgKGxldCBuYW1lIGluIHRoaXMucHJldGhpbmdzKSB7XHJcbiAgICAgICAgICAgIGlmICghdGhpcy5wcmV0aGluZ3MuaGFzT3duUHJvcGVydHkobmFtZSkpIHtcclxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAvLyBEb24ndCBib3RoZXIgdHJ5aW5nIHRvIHNwYXduIHRoZSBncm91cCBpZiBpdCBoYXMgbm8gbWVtYmVyc1xyXG4gICAgICAgICAgICBjb25zdCBncm91cDogSVByZVRoaW5nW10gPSAodGhpcy5wcmV0aGluZ3MgYXMgYW55KVtuYW1lXVtkaXJlY3Rpb25dO1xyXG4gICAgICAgICAgICBpZiAoZ3JvdXAubGVuZ3RoID09PSAwKSB7XHJcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgLy8gRmluZCB0aGUgc3RhcnQgYW5kIGVuZCBwb2ludHMgd2l0aGluIHRoZSBQcmVUaGluZ3MgQXJyYXlcclxuICAgICAgICAgICAgLy8gRXguIGlmIGRpcmVjdGlvbj1cInhJbmNcI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AgICAgc3dpdGNoIChkaXJlY3Rpb25LZXkpIHtcclxuICAgICAgICAgICAgY2FzZSBcInRvcFwiOlxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRvcDtcclxuICAgICAgICAgICAgY2FzZSBcInJpZ2h0XCI6XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gcmlnaHQ7XHJcbiAgICAgICAgICAgIGNhc2UgXCJib3R0b21cIjpcclxuICAgICAgICAgICAgICAgIHJldHVybiBib3R0b207XHJcbiAgICAgICAgICAgIGNhc2UgXCJsZWZ0XCI6XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gbGVmdDtcclxuICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgVW5rbm93biBkaXJlY3Rpb25LZXk6ICcke2RpcmVjdGlvbktleX0nLmApO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG4iXX0=
import {
IArea, ILocation, IMap, IMapsCreatr, IPreThingsContainers
} from "mapscreatr/lib/imapscreatr";
import { IPreThing, IPreThingSettings } from "mapscreatr/lib/iprething";
import { IMapScreenr } from "mapscreenr/lib/imapscreenr";
} from "mapscreatr/lib/IMapsCreatr";
import { IPreThing, IPreThingSettings } from "mapscreatr/lib/IPreThing";
import { IMapScreenr } from "mapscreenr/lib/IMapScreenr";

@@ -16,3 +16,3 @@ import { IAreaSpawnr, IAreaSpawnrSettings, ICommandAdder } from "./IAreaSpawnr";

*/
public static directionKeys: { [i: string]: string } = {
public static readonly directionKeys: { [i: string]: string } = {
xInc: "left",

@@ -27,3 +27,3 @@ xDec: "right",

*/
public static directionOpposites: { [i: string]: string } = {
public static readonly directionOpposites: { [i: string]: string } = {
xInc: "xDec",

@@ -36,5 +36,5 @@ xDec: "xInc",

/**
* MapsCreatr container for Maps from which this obtains Thing settings.
* Storage container and lazy loader for GameStartr maps.
*/
private MapsCreator: IMapsCreatr;
private mapsCreator: IMapsCreatr;

@@ -44,3 +44,3 @@ /**

*/
private MapScreener: IMapScreenr;
private mapScreenr: IMapScreenr;

@@ -121,12 +121,12 @@ /**

}
if (!settings.MapsCreator) {
throw new Error("No MapsCreator provided to AreaSpawnr.");
if (!settings.mapsCreatr) {
throw new Error("No mapsCreatr provided to AreaSpawnr.");
}
if (!settings.MapScreener) {
throw new Error("No MapScreener provided to AreaSpawnr.");
if (!settings.mapScreenr) {
throw new Error("No mapsCreatr provided to AreaSpawnr.");
}
this.MapsCreator = settings.MapsCreator;
this.mapsCreator = settings.mapsCreatr;
this.MapScreener = settings.MapScreener;
this.mapScreenr = settings.mapScreenr;

@@ -143,16 +143,2 @@ this.onSpawn = settings.onSpawn;

/**
* @returns The internal MapsCreator.
*/
public getMapsCreator(): IMapsCreatr {
return this.MapsCreator;
}
/**
* @returns The internal MapScreener.
*/
public getMapScreener(): IMapScreenr {
return this.MapScreener;
}
/**
* @returns The attribute names to be copied to MapScreener.

@@ -179,7 +165,5 @@ */

public getMap(name?: string): IMap {
if (typeof name !== "undefined") {
return this.MapsCreator.getMap(name);
} else {
return this.mapCurrent;
}
return typeof name === "undefined"
? this.mapCurrent
: this.mapsCreator.getMap(name);
}

@@ -193,3 +177,3 @@

public getMaps(): { [i: string]: IMap } {
return this.MapsCreator.getMaps();
return this.mapsCreator.getMaps();
}

@@ -278,5 +262,5 @@

* @param name The key of the Location to start in.
* @returns The newly set Location.
*/
public setLocation(name: string): void {
// Query the location from the current map and ensure it exists
public setLocation(name: string): ILocation {
const location: ILocation = this.mapCurrent.locations[name];

@@ -287,3 +271,2 @@ if (!location) {

// Since the location is valid, mark it as current (with its area)
this.locationEntered = location;

@@ -299,5 +282,4 @@ this.areaCurrent = location.area;

// Copy all the settings from that area into the MapScreenr container
for (let i: number = 0; i < this.screenAttributes.length; i += 1) {
const attribute: string = this.screenAttributes[i];
this.MapScreener.variables[attribute] = (this.areaCurrent as any)[attribute];
for (const attribute of this.screenAttributes) {
this.mapScreenr.variables[attribute] = (this.areaCurrent as any)[attribute];
}

@@ -307,3 +289,3 @@

// for the new Area/Location placements
this.prethings = this.MapsCreator.getPreThings(location.area);
this.prethings = this.mapsCreator.getPreThings(location.area);

@@ -319,2 +301,4 @@ // Optional: set stretch commands

}
return location;
}

@@ -321,0 +305,0 @@

@@ -1,4 +0,4 @@

import { IArea, ILocation, IMap, IMapsCreatr, IPreThingsContainers } from "mapscreatr/lib/imapscreatr";
import { IPreThing, IPreThingSettings } from "mapscreatr/lib/iprething";
import { IMapScreenr } from "mapscreenr/lib/imapscreenr";
import { IArea, ILocation, IMap, IMapsCreatr, IPreThingsContainers } from "mapscreatr/lib/IMapsCreatr";
import { IPreThing, IPreThingSettings } from "mapscreatr/lib/IPreThing";
import { IMapScreenr } from "mapscreenr/lib/IMapScreenr";
/**

@@ -21,7 +21,7 @@ * A Function to add a map command, such as an after or stretch.

*/
MapsCreator: IMapsCreatr;
mapsCreatr: IMapsCreatr;
/**
* A MapScreenr used to store attributes of Areas.
*/
MapScreener: IMapScreenr;
mapScreenr: IMapScreenr;
/**

@@ -59,10 +59,2 @@ * Function for when a PreThing's Thing should be spawned.

/**
* @returns The internal MapsCreator.
*/
getMapsCreator(): IMapsCreatr;
/**
* @returns The internal MapScreener.
*/
getMapScreener(): IMapScreenr;
/**
* @returns The attribute names to be copied to MapScreener.

@@ -138,4 +130,5 @@ */

* @param name The key of the Location to start in.
* @returns The newly set Location.
*/
setLocation(name: string): void;
setLocation(name: string): ILocation;
/**

@@ -142,0 +135,0 @@ * Applies the stretchAdd Function to each given "stretch" command and

import {
IArea, ILocation, IMap, IMapsCreatr, IPreThingsContainers
} from "mapscreatr/lib/imapscreatr";
import { IPreThing, IPreThingSettings } from "mapscreatr/lib/iprething";
import { IMapScreenr } from "mapscreenr/lib/imapscreenr";
} from "mapscreatr/lib/IMapsCreatr";
import { IPreThing, IPreThingSettings } from "mapscreatr/lib/IPreThing";
import { IMapScreenr } from "mapscreenr/lib/IMapScreenr";

@@ -25,3 +25,3 @@ /**

*/
MapsCreator: IMapsCreatr;
mapsCreatr: IMapsCreatr;

@@ -31,3 +31,3 @@ /**

*/
MapScreener: IMapScreenr;
mapScreenr: IMapScreenr;

@@ -72,12 +72,2 @@ /**

/**
* @returns The internal MapsCreator.
*/
getMapsCreator(): IMapsCreatr;
/**
* @returns The internal MapScreener.
*/
getMapScreener(): IMapScreenr;
/**
* @returns The attribute names to be copied to MapScreener.

@@ -162,4 +152,5 @@ */

* @param name The key of the Location to start in.
* @returns The newly set Location.
*/
setLocation(name: string): void;
setLocation(name: string): ILocation;

@@ -166,0 +157,0 @@ /**

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