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