Rev 252 | Rev 258 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
220 | ligi | 1 | /************************************************** |
2 | * |
||
3 | * class representing the Params Structure |
||
4 | * |
||
5 | * Author: Marcus -LiGi- Bueschleb |
||
6 | * |
||
7 | * see README for further Infos |
||
8 | * |
||
9 | *************************************************/ |
||
10 | |||
11 | package org.ligi.ufo; |
||
12 | |||
13 | |||
14 | |||
15 | public abstract class ParamsClass |
||
16 | implements MKParamDefinitions |
||
17 | { |
||
18 | |||
255 | ligi | 19 | public int[] tab_stringids; |
20 | |||
21 | // public String[] tab_names; |
||
220 | ligi | 22 | public String[][] field_names; |
23 | public int[][] field_positions; |
||
24 | public int[][] field_types; |
||
25 | public String[][] choice_strings; |
||
26 | |||
27 | abstract public int get_field_from_act(int pos); |
||
28 | |||
29 | |||
30 | abstract public void set_field_from_act(int pos,int val); |
||
31 | |||
32 | |||
252 | ligi | 33 | public void field_from_act_add_min_max(int pos,int val,int min,int max) |
34 | { |
||
35 | if (((get_field_from_act(pos)+val)>=min)&&((get_field_from_act(pos)+val)<=max)) |
||
36 | set_field_from_act(pos , get_field_from_act(pos)+val); |
||
37 | } |
||
38 | |||
220 | ligi | 39 | public void field_from_act_add(int pos,int val) |
40 | { |
||
41 | set_field_from_act(pos , get_field_from_act(pos)+val); |
||
42 | } |
||
43 | |||
44 | public void field_from_act_add_mod(int pos,int val,int mod) |
||
45 | { |
||
46 | int res=(get_field_from_act(pos)+val)%mod; |
||
47 | if ( (res)<0) res=mod-1; |
||
48 | |||
49 | set_field_from_act(pos , res); |
||
50 | } |
||
51 | |||
52 | public void field_from_act_xor(int pos,int val) |
||
53 | { |
||
54 | set_field_from_act(pos , get_field_from_act(pos)^val); |
||
55 | } |
||
56 | |||
57 | } |