basicly you could do something like:
PHP Code:
function onCreated() {
this.dsize = 10;
this.data = 0;
this.mode = 1;
}
public function onAddData(temp.data) {
if (this.mode == 1) {
this.data.insert(0, temp.data);
if (this.data.size() == this.dsize+1){
this.data.delete(this.dsize-1);
}
}else if (this.mode == 2) {
this.data.add(temp.data);
if (this.data.size() == this.dsize+1) {
this.data.delete(0);
}
}
}
public function onGetData()
return this.data;
public function onGetDataAtIndex(index)
return this.data[index];
So, use onAddData() to feed the array, depending on the mode the way it's read (mode 1 = read from left to right (index 0 and up), mode 2 = read right to left (last index to index 0))
Could be made easier tho, but, an EKG with player's health.. Doesn't sound.. 'logical' with graal as combo
