Browse Source

NESTile .copy() will copy the data from a given NESTile to the current one.

dev-tmpl
Bryan Miller 5 years ago
parent
commit
8d57f47874
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      app/js/models/NESTile.js

+ 10
- 0
app/js/models/NESTile.js View File

@@ -84,6 +84,10 @@ export default class NESTile{
return d;
}

get chr(){
return new Uint8Array(this.__data);
}

get base64(){
var b = ""
for (var i = 0; i < this.__data.length; i++) {
@@ -162,6 +166,12 @@ export default class NESTile{
return t;
}

copy(t){
if (!(t instanceof NESTile))
throw new TypeError("Expected NESTile object.");
this.__data.set(t.__data);
}

isEq(tile){
if (!(tile instanceof NESTile)){
throw new TypeError("Expected NESTile instance.");

Loading…
Cancel
Save