BlueGit

timfa frameworkv3

array.remove

timfa Tim Falken · pushed by timfa

Authored 2017-02-03 · 9 years ago

Hash
545de621e0024769751c26e0cd508842712ed8bf
Parent
af3060a6
3 files changed +35 −1
frameworkv3/extentions.js added +17 −0
@@ -0,0 +1,17 @@
1 /**
2 * Extending exising functionality
3 */
4
5 Array.prototype.remove(element)
6 {
7 var index = this.indexOf(element);
8
9 if (index > -1)
10 {
11 this.splice(index, 1);
12 }
13 else
14 {
15 console.error("Element not part of array!", this, element);
16 }
17 }
@@ -0,0 +1,17 @@
1/**
2 * Extending exising functionality
3 */
4
5Array.prototype.remove(element)
6{
7 var index = this.indexOf(element);
8
9 if (index > -1)
10 {
11 this.splice(index, 1);
12 }
13 else
14 {
15 console.error("Element not part of array!", this, element);
16 }
17}
js/framework.js +17 −1
@@ -527,7 +527,23 @@ var Game =
527 527 return a.renderer.layerDepth - b.renderer.layerDepth;
528 528 })
529 529 }
530 };//<DOC> <category> Image
530 };/**
531 * Extending exising functionality
532 */
533
534 Array.prototype.remove(element)
535 {
536 var index = this.indexOf(element);
537
538 if (index > -1)
539 {
540 this.splice(index, 1);
541 }
542 else
543 {
544 console.error("Element not part of array!", this, element);
545 }
546 }//<DOC> <category> Image
531 547 //<DOC> <function> Constructor: new image(urlToImage, subImages = 1, subImagesPerRow = 1)
532 548 function image(url, subImgTotal = 1, perRow = 1)
533 549 {
@@ -527,7 +527,23 @@ var Game =
527 return a.renderer.layerDepth - b.renderer.layerDepth;
527 return a.renderer.layerDepth - b.renderer.layerDepth;
528 })
528 })
529 }
529 }
530};//<DOC> <category> Image
530};/**
531 * Extending exising functionality
532 */
533
534Array.prototype.remove(element)
535{
536 var index = this.indexOf(element);
537
538 if (index > -1)
539 {
540 this.splice(index, 1);
541 }
542 else
543 {
544 console.error("Element not part of array!", this, element);
545 }
546}//<DOC> <category> Image
531//<DOC> <function> Constructor: new image(urlToImage, subImages = 1, subImagesPerRow = 1)
547//<DOC> <function> Constructor: new image(urlToImage, subImages = 1, subImagesPerRow = 1)
532function image(url, subImgTotal = 1, perRow = 1)
548function image(url, subImgTotal = 1, perRow = 1)
533{
549{
js/lastbuild.txt +1 −0
@@ -1 +1,2 @@
1 1 2017-02-03 11:19
2 2017-02-03 12:06
@@ -1 +1,2 @@
12017-02-03 11:19
12017-02-03 11:19
22017-02-03 12:06