DEADSOFTWARE

Small refactoring of physics module
[cavecraft.git] / libs / Lib_particles_store.java
1 class Lib_particles_store
2 {
3 static byte[] particle_type;
4 static byte[] particle_ani;
5 static short[] particle_x;
6 static short[] particle_y;
8 public static void reset_particles(int len)
9 {
10 particle_type = new byte[len];
11 particle_ani = new byte[len];
12 particle_x = new short[len];
13 particle_y = new short[len];
14 }
16 public static void set_particle(int id, int type, int ani, int x, int y)
17 {
18 particle_type[id] = (byte) type;
19 particle_ani[id] = (byte) ani;
20 particle_x[id] = (short) x;
21 particle_y[id] = (short) y;
22 }
24 public static void set_particle_type(int id, int type)
25 {
26 particle_type[id] = (byte) type;
27 }
29 public static void set_particle_ani(int id, int ani)
30 {
31 particle_ani[id] = (byte) ani;
32 }
34 public static void set_particle_x(int id, int x)
35 {
36 particle_x[id] = (short) x;
37 }
39 public static void set_particle_y(int id, int y)
40 {
41 particle_y[id] = (short) y;
42 }
44 public static int get_particle_type(int id)
45 {
46 return particle_type[id] & 0xFF;
47 }
49 public static int get_particle_ani(int id)
50 {
51 return particle_ani[id] & 0xFF;
52 }
54 public static int get_particle_x(int id)
55 {
56 return particle_x[id];
57 }
59 public static int get_particle_y(int id)
60 {
61 return particle_y[id];
62 }
63 }