Rev 220 | Rev 255 | 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 | |||
19 | public String[] tab_names; |
||
20 | public String[][] field_names; |
||
21 | public int[][] field_positions; |
||
22 | public int[][] field_types; |
||
23 | public String[][] choice_strings; |
||
24 | |||
25 | abstract public int get_field_from_act(int pos); |
||
26 | |||
27 | |||
28 | abstract public void set_field_from_act(int pos,int val); |
||
29 | |||
30 | |||
252 | ligi | 31 | public void field_from_act_add_min_max(int pos,int val,int min,int max) |
32 | { |
||
33 | if (((get_field_from_act(pos)+val)>=min)&&((get_field_from_act(pos)+val)<=max)) |
||
34 | set_field_from_act(pos , get_field_from_act(pos)+val); |
||
35 | } |
||
36 | |||
220 | ligi | 37 | public void field_from_act_add(int pos,int val) |
38 | { |
||
39 | set_field_from_act(pos , get_field_from_act(pos)+val); |
||
40 | } |
||
41 | |||
42 | public void field_from_act_add_mod(int pos,int val,int mod) |
||
43 | { |
||
44 | int res=(get_field_from_act(pos)+val)%mod; |
||
45 | if ( (res)<0) res=mod-1; |
||
46 | |||
47 | set_field_from_act(pos , res); |
||
48 | } |
||
49 | |||
50 | public void field_from_act_xor(int pos,int val) |
||
51 | { |
||
52 | set_field_from_act(pos , get_field_from_act(pos)^val); |
||
53 | } |
||
54 | |||
55 | } |