123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
-
- import java.util.Arrays;
-
-
-
- public class AFrame {
- private short[] data = new short[64];
- private short duration = 1;
- private String name = "Frame";
- private static int lastIndex = 1;
-
-
-
- public void toggleLED(int x, int y, int z) {
- if (x < 8) {
- if (y < 8) {
- if (z < 8) {
- data[y + (8 * z)] ^= (1 << x);
- }
- }
- }
- }
-
-
-
- public AFrame() {
- name = "Frame " + lastIndex++;
- }
-
-
-
- public String getName() {
- return name;
- }
-
-
-
- public void setName(String s) {
- name = s;
- }
-
-
-
- public void setData(short[] d) {
- for (int i = 0; i < 64; i++) {
- data[i] = d[i];
- }
- }
-
-
-
- public short[] getData() {
- return data;
- }
-
-
-
- public void setTime(short t) {
- duration = t;
- }
-
-
-
- public short getTime() {
- return duration;
- }
-
-
-
- public short[] getLayer(int i) {
- return Arrays.copyOfRange(data, (i * 8), (i * 8) + 8);
- }
- }
|